@ember-data-mirror/request 5.6.0-alpha.1 → 5.6.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -16
- package/addon-main.cjs +1 -1
- package/dist/fetch.js +1 -184
- package/dist/fetch.js.map +1 -1
- package/dist/index.js +2 -687
- package/dist/index.js.map +1 -1
- package/package.json +4 -14
- package/unstable-preview-types/fetch.d.ts +2 -19
- package/unstable-preview-types/fetch.d.ts.map +1 -1
- package/unstable-preview-types/index.d.ts +430 -13
- package/unstable-preview-types/index.d.ts.map +1 -1
- package/dist/debug-CyVgT8K4.js +0 -636
- package/dist/debug-CyVgT8K4.js.map +0 -1
- package/unstable-preview-types/-private/context.d.ts +0 -44
- package/unstable-preview-types/-private/context.d.ts.map +0 -1
- package/unstable-preview-types/-private/debug.d.ts +0 -7
- package/unstable-preview-types/-private/debug.d.ts.map +0 -1
- package/unstable-preview-types/-private/future.d.ts +0 -10
- package/unstable-preview-types/-private/future.d.ts.map +0 -1
- package/unstable-preview-types/-private/manager.d.ts +0 -140
- package/unstable-preview-types/-private/manager.d.ts.map +0 -1
- package/unstable-preview-types/-private/promise-cache.d.ts +0 -22
- package/unstable-preview-types/-private/promise-cache.d.ts.map +0 -1
- package/unstable-preview-types/-private/types.d.ts +0 -246
- package/unstable-preview-types/-private/types.d.ts.map +0 -1
- package/unstable-preview-types/-private/utils.d.ts +0 -18
- package/unstable-preview-types/-private/utils.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debug-CyVgT8K4.js","sources":["../src/-private/promise-cache.ts","../src/-private/utils.ts","../src/-private/future.ts","../src/-private/context.ts","../src/-private/debug.ts"],"sourcesContent":["import { getOrSetUniversal } from '@warp-drive-mirror/core-types/-private';\n\nexport type CacheResult<T = unknown, E = unknown> = { isError: true; result: E } | { isError: false; result: T };\n\nexport type Awaitable<T = unknown, E = unknown> = {\n then: (onFulfilled: (value: T) => unknown, onRejected: (reason: E) => unknown) => unknown;\n catch: (onRejected: (reason: E) => unknown) => unknown;\n finally: (onFinally: () => unknown) => unknown;\n};\n\nexport const PromiseCache = getOrSetUniversal('PromiseCache', new WeakMap<Awaitable, CacheResult>());\nexport const RequestMap = getOrSetUniversal('RequestMap', new Map<number, CacheResult>());\n\nexport function setRequestResult(requestId: number, result: CacheResult) {\n RequestMap.set(requestId, result);\n}\nexport function clearRequestResult(requestId: number) {\n RequestMap.delete(requestId);\n}\nexport function getRequestResult(requestId: number): CacheResult | undefined {\n return RequestMap.get(requestId);\n}\n\nexport function setPromiseResult(promise: Promise<unknown> | Awaitable, result: CacheResult) {\n PromiseCache.set(promise, result);\n}\n\nexport function getPromiseResult<T, E>(promise: Promise<T> | Awaitable<T, E>): CacheResult<T, E> | undefined {\n return PromiseCache.get(promise) as CacheResult<T, E> | undefined;\n}\n","import { DEBUG } from '@warp-drive-mirror/build-config/env';\nimport { getOrSetGlobal } from '@warp-drive-mirror/core-types/-private';\nimport type {\n RequestInfo,\n StructuredDataDocument,\n StructuredDocument,\n StructuredErrorDocument,\n} from '@warp-drive-mirror/core-types/request';\nimport { STRUCTURED } from '@warp-drive-mirror/core-types/request';\n\nimport { Context, ContextOwner } from './context';\nimport { assertValidRequest } from './debug';\nimport { createFuture, isFuture } from './future';\nimport { setRequestResult } from './promise-cache';\nimport type { DeferredFuture, Future, GodContext, Handler } from './types';\n\nexport const IS_CACHE_HANDLER = getOrSetGlobal('IS_CACHE_HANDLER', Symbol('IS_CACHE_HANDLER'));\nexport function curryFuture<T>(owner: ContextOwner, inbound: Future<T>, outbound: DeferredFuture<T>): Future<T> {\n owner.setStream(inbound.getStream());\n\n inbound.then(\n (doc: StructuredDataDocument<T>) => {\n const document = {\n [STRUCTURED]: true as const,\n request: owner.request,\n response: doc.response,\n content: doc.content,\n };\n outbound.resolve(document);\n },\n (error: Error & StructuredErrorDocument) => {\n if (isDoc(error)) {\n owner.setStream(owner.god.stream);\n }\n if (!error || !(error instanceof Error)) {\n try {\n throw new Error(error ? error : `Request Rejected with an Unknown Error`);\n } catch (e: unknown) {\n if (error && typeof error === 'object') {\n Object.assign(e as Error, error);\n (e as Error & StructuredErrorDocument).message =\n (error as Error).message || `Request Rejected with an Unknown Error`;\n }\n error = e as Error & StructuredErrorDocument;\n }\n }\n\n error[STRUCTURED] = true;\n error.request = owner.request;\n error.response = owner.getResponse();\n error.error = error.error || error.message;\n\n outbound.reject(error);\n }\n );\n return outbound.promise;\n}\n\nfunction isDoc<T>(doc: T | StructuredDataDocument<T>): doc is StructuredDataDocument<T> {\n return doc && (doc as StructuredDataDocument<T>)[STRUCTURED] === true;\n}\n\nfunction ensureDoc<T>(owner: ContextOwner, content: T | Error, isError: boolean): StructuredDocument<T> {\n if (isDoc(content)) {\n return content as StructuredDocument<T>;\n }\n\n if (isError) {\n return {\n [STRUCTURED]: true,\n request: owner.request,\n response: owner.getResponse(),\n error: content as Error,\n } as StructuredErrorDocument<T>;\n }\n\n return {\n [STRUCTURED]: true,\n request: owner.request,\n response: owner.getResponse(),\n content: content as T,\n };\n}\n\nexport interface HttpErrorProps extends DOMException {\n code: number;\n name: string;\n status: number;\n statusText: string;\n isRequestError: boolean;\n}\n\nexport function enhanceReason(reason?: string) {\n return new DOMException(reason || 'The user aborted a request.', 'AbortError');\n}\n\nexport function handleOutcome<T>(\n owner: ContextOwner,\n inbound: Promise<T | StructuredDataDocument<T>>,\n outbound: DeferredFuture<T>\n): Future<T> {\n inbound.then(\n (content: T | StructuredDataDocument<T>) => {\n if (owner.controller.signal.aborted) {\n // the next function did not respect the signal, we handle it here\n outbound.reject(enhanceReason(owner.controller.signal.reason as string));\n return;\n }\n if (isDoc(content)) {\n owner.setStream(owner.god.stream);\n content = content.content;\n }\n const document = {\n [STRUCTURED]: true as const,\n request: owner.request,\n response: owner.getResponse(),\n content,\n };\n outbound.resolve(document);\n },\n (error: Error & StructuredErrorDocument) => {\n if (isDoc(error)) {\n owner.setStream(owner.god.stream);\n }\n if (!error || !(error instanceof Error)) {\n try {\n throw new Error(error ? error : `Request Rejected with an Unknown Error`);\n } catch (e: unknown) {\n if (error && typeof error === 'object') {\n Object.assign(e as Error, error);\n (e as Error & StructuredErrorDocument).message =\n (error as Error).message || `Request Rejected with an Unknown Error`;\n }\n error = e as Error & StructuredErrorDocument;\n }\n }\n\n error[STRUCTURED] = true;\n error.request = owner.request;\n error.response = owner.getResponse();\n error.error = error.error || error.message;\n outbound.reject(error);\n }\n );\n return outbound.promise;\n}\n\nfunction isCacheHandler(handler: Handler & { [IS_CACHE_HANDLER]?: boolean }, index: number): boolean {\n return index === 0 && Boolean(handler[IS_CACHE_HANDLER]);\n}\n\nexport function executeNextHandler<T>(\n wares: Readonly<Handler[]>,\n request: RequestInfo,\n i: number,\n god: GodContext\n): Future<T> {\n if (DEBUG) {\n if (i === wares.length) {\n throw new Error(`No handler was able to handle this request.`);\n }\n assertValidRequest(request, false);\n }\n const owner = new ContextOwner(request, god, i === 0);\n\n function next(r: RequestInfo): Future<T> {\n owner.nextCalled++;\n return executeNextHandler(wares, r, i + 1, god);\n }\n\n const _isCacheHandler = isCacheHandler(wares[i], i);\n const context = new Context(owner, _isCacheHandler);\n let outcome: Promise<T | StructuredDataDocument<T>> | Future<T>;\n try {\n outcome = wares[i].request<T>(context, next);\n if (_isCacheHandler) {\n context._finalize();\n }\n if (!!outcome && _isCacheHandler) {\n if (!(outcome instanceof Promise)) {\n setRequestResult(owner.requestId, { isError: false, result: ensureDoc(owner, outcome, false) });\n outcome = Promise.resolve(outcome);\n }\n } else if (DEBUG) {\n if (!outcome || (!(outcome instanceof Promise) && !(typeof outcome === 'object' && 'then' in outcome))) {\n // eslint-disable-next-line no-console\n console.log({ request, handler: wares[i], outcome });\n if (outcome === undefined) {\n throw new Error(`Expected handler.request to return a promise, instead received undefined.`);\n }\n throw new Error(`Expected handler.request to return a promise, instead received a synchronous value.`);\n }\n }\n } catch (e) {\n if (_isCacheHandler) {\n setRequestResult(owner.requestId, { isError: true, result: ensureDoc(owner, e, true) });\n }\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors\n outcome = Promise.reject<StructuredDataDocument<T>>(e);\n }\n const future = createFuture<T>(owner);\n\n if (isFuture<T>(outcome)) {\n return curryFuture(owner, outcome, future);\n }\n\n return handleOutcome(owner, outcome, future);\n}\n","import { IS_FUTURE, type StructuredDocument } from '@warp-drive-mirror/core-types/request';\n\nimport type { ContextOwner } from './context';\nimport type { Deferred, DeferredFuture, Future } from './types';\nimport { enhanceReason } from './utils';\n\nexport function isFuture<T>(maybe: unknown): maybe is Future<T> {\n return Boolean(maybe && maybe instanceof Promise && (maybe as Future<T>)[IS_FUTURE] === true);\n}\n\nexport function createDeferred<T>(): Deferred<T> {\n let resolve!: (v: T) => void;\n let reject!: (v: unknown) => void;\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { resolve, reject, promise };\n}\n\nexport function upgradePromise<T>(promise: Promise<StructuredDocument<T>>, future: Future<T>): Future<T> {\n (promise as Future<T>)[IS_FUTURE] = true;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n (promise as Future<T>).getStream = future.getStream;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n (promise as Future<T>).abort = future.abort;\n // eslint-disable-next-line @typescript-eslint/unbound-method\n (promise as Future<T>).onFinalize = future.onFinalize;\n (promise as Future<T>).id = future.id;\n (promise as Future<T>).lid = future.lid;\n\n return promise as Future<T>;\n}\n\nexport function createFuture<T>(owner: ContextOwner): DeferredFuture<T> {\n const deferred = createDeferred<T>() as unknown as DeferredFuture<T>;\n let { promise } = deferred;\n let cbs: Array<() => void> | undefined;\n promise = promise.finally(() => {\n owner.resolveStream();\n if (cbs) {\n cbs.forEach((cb) => cb());\n }\n }) as Future<T>;\n promise.onFinalize = (fn: () => void) => {\n cbs = cbs || [];\n cbs.push(fn);\n };\n promise[IS_FUTURE] = true;\n promise.getStream = () => {\n return owner.getStream();\n };\n promise.abort = (reason?: string) => {\n owner.abort(enhanceReason(reason));\n };\n promise.id = owner.requestId;\n promise.lid = owner.god.identifier;\n\n deferred.promise = promise;\n return deferred;\n}\n","import { DEBUG } from '@warp-drive-mirror/build-config/env';\nimport { assert } from '@warp-drive-mirror/build-config/macros';\nimport type { StableDocumentIdentifier } from '@warp-drive-mirror/core-types/identifier';\nimport type { ImmutableHeaders, ImmutableRequestInfo, RequestInfo, ResponseInfo } from '@warp-drive-mirror/core-types/request';\nimport { SkipCache } from '@warp-drive-mirror/core-types/request';\n\nimport { deepFreeze } from './debug';\nimport { createDeferred } from './future';\nimport type { DeferredStream, GodContext } from './types';\n\nexport function upgradeHeaders(headers: Headers | ImmutableHeaders): ImmutableHeaders {\n (headers as ImmutableHeaders).clone = () => {\n return new Headers(headers);\n };\n (headers as ImmutableHeaders).toJSON = () => {\n return Array.from(headers as unknown as Iterable<[string, string]>);\n };\n return headers as ImmutableHeaders;\n}\n\nexport function cloneResponseProperties(response: Response): ResponseInfo {\n const { headers, ok, redirected, status, statusText, type, url } = response;\n upgradeHeaders(headers);\n return {\n headers: headers as ImmutableHeaders,\n ok,\n redirected,\n status,\n statusText,\n type,\n url,\n };\n}\n\nexport class ContextOwner {\n hasSetStream = false;\n hasSetResponse = false;\n hasSubscribers = false;\n stream: DeferredStream = createDeferred<ReadableStream | null>();\n response: ResponseInfo | null = null;\n declare request: ImmutableRequestInfo;\n declare enhancedRequest: ImmutableRequestInfo;\n nextCalled = 0;\n declare god: GodContext;\n declare controller: AbortController;\n declare requestId: number;\n declare isRoot: boolean;\n\n constructor(request: RequestInfo, god: GodContext, isRoot = false) {\n this.isRoot = isRoot;\n this.requestId = god.id;\n this.controller = request.controller || god.controller;\n this.stream.promise.sizeHint = 0;\n\n if (request.controller) {\n if (request.controller !== god.controller) {\n god.controller.signal.addEventListener('abort', () => {\n this.controller.abort(god.controller.signal.reason);\n });\n }\n delete request.controller;\n }\n let enhancedRequest: ImmutableRequestInfo = Object.assign(\n { signal: this.controller.signal },\n request\n ) as ImmutableRequestInfo;\n if (DEBUG) {\n if (!request?.cacheOptions?.[SkipCache]) {\n request = deepFreeze(request) as ImmutableRequestInfo;\n enhancedRequest = deepFreeze(enhancedRequest);\n }\n } else {\n if (request.headers) {\n upgradeHeaders(request.headers);\n }\n }\n this.enhancedRequest = enhancedRequest;\n this.request = request as ImmutableRequestInfo;\n this.god = god;\n this.stream.promise = this.stream.promise.then((stream: ReadableStream | null) => {\n if (this.god.stream === stream && this.hasSubscribers) {\n this.god.stream = null;\n }\n return stream;\n });\n }\n\n get hasRequestedStream(): boolean {\n return this.god.hasRequestedStream;\n }\n\n getResponse(): ResponseInfo | null {\n if (this.hasSetResponse) {\n return this.response;\n }\n if (this.nextCalled === 1) {\n return this.god.response;\n }\n return null;\n }\n getStream(): Promise<ReadableStream | null> {\n if (this.isRoot) {\n this.god.hasRequestedStream = true;\n }\n if (!this.hasSetResponse) {\n const hint = this.god.response?.headers?.get('content-length');\n this.stream.promise.sizeHint = hint ? parseInt(hint, 10) : 0;\n }\n this.hasSubscribers = true;\n return this.stream.promise;\n }\n abort(reason: DOMException) {\n this.controller.abort(reason);\n }\n\n setStream(stream: ReadableStream | Promise<ReadableStream | null> | null) {\n if (!this.hasSetStream) {\n this.hasSetStream = true;\n\n if (!(stream instanceof Promise)) {\n this.god.stream = stream;\n }\n // @ts-expect-error\n this.stream.resolve(stream);\n }\n }\n\n resolveStream() {\n this.setStream(this.nextCalled === 1 ? this.god.stream : null);\n }\n\n setResponse(response: ResponseInfo | Response | null) {\n if (this.hasSetResponse) {\n if (DEBUG) {\n throw new Error(`Cannot setResponse when a response has already been set`);\n }\n return;\n }\n this.hasSetResponse = true;\n if (response instanceof Response) {\n // TODO potentially avoid cloning in prod\n let responseData = cloneResponseProperties(response);\n\n if (DEBUG) {\n responseData = deepFreeze(responseData);\n }\n this.response = responseData;\n this.god.response = responseData;\n const sizeHint = response.headers?.get('content-length');\n this.stream.promise.sizeHint = sizeHint ? parseInt(sizeHint, 10) : 0;\n } else {\n this.response = response;\n this.god.response = response;\n }\n }\n}\n\nexport class Context {\n #owner: ContextOwner;\n declare request: ImmutableRequestInfo;\n declare id: number;\n declare private _isCacheHandler: boolean;\n declare private _finalized: boolean;\n\n constructor(owner: ContextOwner, isCacheHandler: boolean) {\n this.id = owner.requestId;\n this.#owner = owner;\n this.request = owner.enhancedRequest;\n this._isCacheHandler = isCacheHandler;\n this._finalized = false;\n }\n setStream(stream: ReadableStream | Promise<ReadableStream | null>) {\n this.#owner.setStream(stream);\n }\n setResponse(response: ResponseInfo | Response | null) {\n this.#owner.setResponse(response);\n }\n\n setIdentifier(identifier: StableDocumentIdentifier) {\n assert(\n `setIdentifier may only be used synchronously from a CacheHandler`,\n identifier && this._isCacheHandler && !this._finalized\n );\n this.#owner.god.identifier = identifier;\n }\n\n get hasRequestedStream() {\n return this.#owner.hasRequestedStream;\n }\n\n _finalize() {\n this._finalized = true;\n }\n}\nexport type HandlerRequestContext = Context;\n","import { DEBUG } from '@warp-drive-mirror/build-config/env';\nimport { getOrSetGlobal } from '@warp-drive-mirror/core-types/-private';\nimport type { ImmutableHeaders, RequestInfo } from '@warp-drive-mirror/core-types/request';\n\nimport { Context, upgradeHeaders } from './context';\n\nconst BODY_TYPES = {\n type: 'string',\n klass: ['Blob', 'ArrayBuffer', 'TypedArray', 'DataView', 'FormData', 'URLSearchParams', 'ReadableStream'],\n};\nconst ValidKeys = new Map<string, string | string[] | typeof BODY_TYPES>([\n ['duplex', ['half']],\n ['records', 'array'],\n ['data', 'json'],\n ['body', BODY_TYPES],\n ['disableTestWaiter', 'boolean'],\n ['options', 'object'],\n ['cacheOptions', 'object'],\n ['op', 'string'],\n ['store', 'object'],\n ['url', 'string'],\n ['cache', ['default', 'force-cache', 'no-cache', 'no-store', 'only-if-cached', 'reload']],\n ['credentials', ['include', 'omit', 'same-origin']],\n [\n 'destination',\n [\n '',\n 'object',\n 'audio',\n 'audioworklet',\n 'document',\n 'embed',\n 'font',\n 'frame',\n 'iframe',\n 'image',\n 'manifest',\n 'paintworklet',\n 'report',\n 'script',\n 'sharedworker',\n 'style',\n 'track',\n 'video',\n 'worker',\n 'xslt',\n ],\n ],\n ['headers', 'headers'],\n ['integrity', 'string'],\n ['keepalive', 'boolean'],\n ['method', ['QUERY', 'GET', 'PUT', 'PATCH', 'DELETE', 'POST', 'OPTIONS', 'HEAD', 'CONNECT', 'TRACE']],\n ['mode', ['same-origin', 'cors', 'navigate', 'no-cors']],\n ['redirect', ['error', 'follow', 'manual']],\n ['referrer', 'string'],\n ['signal', 'AbortSignal'],\n ['controller', 'AbortController'],\n [\n 'referrerPolicy',\n [\n '',\n 'same-origin',\n 'no-referrer',\n 'no-referrer-when-downgrade',\n 'origin',\n 'origin-when-cross-origin',\n 'strict-origin',\n 'strict-origin-when-cross-origin',\n 'unsafe-url',\n ],\n ],\n]);\n\nconst IS_FROZEN = getOrSetGlobal('IS_FROZEN', Symbol('FROZEN'));\nconst IS_COLLECTION = getOrSetGlobal('IS_COLLECTION', Symbol.for('Collection'));\n\nfunction freezeHeaders(headers: Headers | ImmutableHeaders): ImmutableHeaders {\n headers.delete =\n headers.set =\n headers.append =\n () => {\n throw new Error(`Cannot Mutate Immutatable Headers, use headers.clone to get a copy`);\n };\n upgradeHeaders(headers);\n return headers as ImmutableHeaders;\n}\n\nexport function deepFreeze<T = unknown>(value: T): T {\n if (value && (value as { [IS_FROZEN]?: true })[IS_FROZEN]) {\n return value;\n }\n const _type = typeof value;\n switch (_type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'undefined':\n case 'bigint':\n return value;\n case 'function':\n throw new Error(`Cannot deep-freeze a function`);\n case 'object': {\n const _niceType = niceTypeOf(value);\n switch (_niceType) {\n case 'array': {\n if ((value as unknown[] & { [IS_COLLECTION]?: true })[IS_COLLECTION]) {\n return value;\n }\n const arr = (value as unknown[]).map(deepFreeze);\n arr[IS_FROZEN as unknown as number] = true;\n return Object.freeze(arr) as T;\n }\n case 'null':\n return value;\n case 'object':\n Object.keys(value as Record<string, unknown>).forEach((key) => {\n try {\n (value as Record<string, unknown>)[key] = deepFreeze((value as Record<string, unknown>)[key]) as object;\n } catch {\n // continue\n }\n });\n (value as Record<string | symbol, unknown>)[IS_FROZEN] = true;\n return Object.freeze(value);\n case 'headers':\n return freezeHeaders(value as Headers) as T;\n case 'Collection':\n case 'Store':\n case 'AbortSignal':\n return value;\n case 'date':\n case 'map':\n case 'set':\n case 'error':\n case 'stream':\n default:\n // console.log(`Cannot deep-freeze ${_niceType}`);\n return value;\n }\n }\n }\n}\n\nfunction isMaybeContext(request: unknown) {\n if (request && typeof request === 'object') {\n const keys = Object.keys(request);\n if (keys.length === 1 && keys[0] === 'request') {\n return true;\n }\n }\n return false;\n}\n\nfunction niceTypeOf(v: unknown) {\n if (v === null) {\n return 'null';\n }\n if (typeof v === 'string') {\n return v ? 'non-empty-string' : 'empty-string';\n }\n if (!v) {\n return typeof v;\n }\n if (Array.isArray(v)) {\n return 'array';\n }\n if (v instanceof Date) {\n return 'date';\n }\n if (v instanceof Map) {\n return 'map';\n }\n if (v instanceof Set) {\n return 'set';\n }\n if (v instanceof Error) {\n return 'error';\n }\n if (v instanceof ReadableStream || v instanceof WritableStream || v instanceof TransformStream) {\n return 'stream';\n }\n if (v instanceof Headers) {\n return 'headers';\n }\n if (typeof v === 'object' && v.constructor && v.constructor.name !== 'Object') {\n return v.constructor.name;\n }\n return typeof v;\n}\n\nfunction validateKey(key: string, value: unknown, errors: string[]) {\n const schema = ValidKeys.get(key);\n if (!schema && !IgnoredKeys.has(key)) {\n errors.push(`InvalidKey: '${key}'`);\n return;\n }\n if (schema) {\n if (schema === BODY_TYPES) {\n if (typeof value === 'string' || value instanceof ReadableStream) {\n return;\n }\n const type = niceTypeOf(value);\n if (schema.klass.includes(type)) {\n return;\n }\n errors.push(\n `InvalidValue: key 'body' should be a string or one of '${schema.klass.join(\"', '\")}', received ${\n '<a value of type ' + niceTypeOf(value) + '>'\n }`\n );\n return;\n }\n if (Array.isArray(schema)) {\n if (!schema.includes(value as string)) {\n errors.push(\n `InvalidValue: key ${key} should be one of '${schema.join(\"', '\")}', received ${\n typeof value === 'string' ? value : '<a value of type ' + niceTypeOf(value) + '>'\n }`\n );\n }\n return;\n } else if (schema === 'json') {\n try {\n JSON.stringify(value);\n } catch (e) {\n errors.push(\n `InvalidValue: key ${key} should be a JSON serializable value, but failed to serialize with Error - ${\n (e as Error).message\n }`\n );\n }\n return;\n } else if (schema === 'headers') {\n if (!(value instanceof Headers)) {\n errors.push(`InvalidValue: key ${key} should be an instance of Headers, received ${niceTypeOf(value)}`);\n }\n return;\n } else if (schema === 'record') {\n const _type = typeof value;\n // record must extend plain object or Object.create(null)\n if (!value || _type !== 'object' || (value.constructor && value.constructor !== Object)) {\n errors.push(\n `InvalidValue: key ${key} should be a dictionary of string keys to string values, received ${niceTypeOf(\n value\n )}`\n );\n return;\n }\n const keys = Object.keys(value);\n keys.forEach((k) => {\n const v: unknown = (value as Record<string, unknown>)[k];\n if (typeof k !== 'string') {\n errors.push(`\\tThe key ${String(k)} on ${key} should be a string key`);\n } else if (typeof v !== 'string') {\n errors.push(`\\tThe value of ${key}.${k} should be a string not ${niceTypeOf(v)}`);\n }\n });\n return;\n } else if (schema === 'string') {\n if (typeof value !== 'string' || value.length === 0) {\n errors.push(\n `InvalidValue: key ${key} should be a non-empty string, received ${\n typeof value === 'string' ? \"''\" : typeof value\n }`\n );\n }\n return;\n } else if (schema === 'object') {\n if (!value || Array.isArray(value) || typeof value !== 'object') {\n errors.push(`InvalidValue: key ${key} should be an object`);\n }\n return;\n } else if (schema === 'boolean') {\n if (typeof value !== 'boolean') {\n errors.push(`InvalidValue: key ${key} should be a boolean, received ${typeof value}`);\n }\n return;\n } else if (schema === 'array') {\n if (!Array.isArray(value)) {\n errors.push(`InvalidValue: key ${key} should be an array, received ${typeof value}`);\n }\n return;\n }\n }\n}\n\nconst IgnoredKeys = new Set<string>([]);\n\nexport function assertValidRequest(\n request: RequestInfo | Context,\n isTopLevel: boolean\n): asserts request is RequestInfo {\n if (DEBUG) {\n // handle basic shape\n if (!request) {\n throw new Error(\n `Expected ${\n isTopLevel ? 'RequestManager.request' : 'next'\n }(<request>) to be called with a request, but none was provided.`\n );\n }\n if (Array.isArray(request) || typeof request !== 'object') {\n throw new Error(\n `The \\`request\\` passed to \\`${\n isTopLevel ? 'RequestManager.request' : 'next'\n }(<request>)\\` should be an object, received \\`${niceTypeOf(request)}\\``\n );\n }\n if (Object.keys(request).length === 0) {\n throw new Error(\n `The \\`request\\` passed to \\`${\n isTopLevel ? 'RequestManager.request' : 'next'\n }(<request>)\\` was empty (\\`{}\\`). Requests need at least one valid key.`\n );\n }\n\n // handle accidentally passing context entirely\n if (request instanceof Context) {\n throw new Error(\n `Expected a request passed to \\`${\n isTopLevel ? 'RequestManager.request' : 'next'\n }(<request>)\\` but received the previous handler's context instead`\n );\n }\n // handle Object.assign({}, context);\n if (isMaybeContext(request)) {\n throw new Error(\n `Expected a request passed to \\`${\n isTopLevel ? 'RequestManager.request' : 'next'\n }(<request>)\\` but received an object with a request key instead.`\n );\n }\n\n // handle schema\n const keys = Object.keys(request) as Array<keyof RequestInfo>;\n const validationErrors: string[] = [];\n const isLegacyRequest = Boolean('op' in request && !request.url);\n keys.forEach((key) => {\n if (isLegacyRequest && key === 'data') {\n return;\n }\n validateKey(key, request[key], validationErrors);\n });\n if (validationErrors.length) {\n const error: Error & { errors: string[] } = new Error(\n `Invalid Request passed to \\`${\n isTopLevel ? 'RequestManager.request' : 'next'\n }(<request>)\\`.\\n\\nThe following issues were found:\\n\\n\\t${validationErrors.join('\\n\\t')}`\n ) as Error & { errors: string[] };\n error.errors = validationErrors;\n throw error;\n }\n }\n}\n"],"names":["PromiseCache","getOrSetUniversal","WeakMap","RequestMap","Map","setRequestResult","requestId","result","set","clearRequestResult","delete","getRequestResult","get","setPromiseResult","promise","getPromiseResult","IS_CACHE_HANDLER","getOrSetGlobal","Symbol","curryFuture","owner","inbound","outbound","setStream","getStream","then","doc","document","STRUCTURED","request","response","content","resolve","error","isDoc","god","stream","Error","e","Object","assign","message","getResponse","reject","ensureDoc","isError","enhanceReason","reason","DOMException","handleOutcome","controller","signal","aborted","isCacheHandler","handler","index","Boolean","executeNextHandler","wares","i","macroCondition","getGlobalConfig","WarpDrive","env","DEBUG","length","assertValidRequest","ContextOwner","next","r","nextCalled","_isCacheHandler","context","Context","outcome","_finalize","Promise","console","log","undefined","future","createFuture","isFuture","maybe","IS_FUTURE","createDeferred","res","rej","upgradePromise","abort","onFinalize","id","lid","deferred","cbs","finally","resolveStream","forEach","cb","fn","push","identifier","upgradeHeaders","headers","clone","Headers","toJSON","Array","from","cloneResponseProperties","ok","redirected","status","statusText","type","url","hasSetStream","hasSetResponse","hasSubscribers","constructor","isRoot","sizeHint","addEventListener","enhancedRequest","cacheOptions","SkipCache","deepFreeze","hasRequestedStream","hint","parseInt","setResponse","Response","responseData","_finalized","setIdentifier","test","BODY_TYPES","klass","ValidKeys","IS_FROZEN","IS_COLLECTION","for","freezeHeaders","append","value","_type","_niceType","niceTypeOf","arr","map","freeze","keys","key","isMaybeContext","v","isArray","Date","Set","ReadableStream","WritableStream","TransformStream","name","validateKey","errors","schema","IgnoredKeys","has","includes","join","JSON","stringify","k","String","isTopLevel","validationErrors","isLegacyRequest"],"mappings":";;;;AAUO,MAAMA,YAAY,GAAGC,iBAAiB,CAAC,cAAc,EAAE,IAAIC,OAAO,EAA0B,CAAC;AAC7F,MAAMC,UAAU,GAAGF,iBAAiB,CAAC,YAAY,EAAE,IAAIG,GAAG,EAAuB,CAAC;AAElF,SAASC,gBAAgBA,CAACC,SAAiB,EAAEC,MAAmB,EAAE;AACvEJ,EAAAA,UAAU,CAACK,GAAG,CAACF,SAAS,EAAEC,MAAM,CAAC;AACnC;AACO,SAASE,kBAAkBA,CAACH,SAAiB,EAAE;AACpDH,EAAAA,UAAU,CAACO,MAAM,CAACJ,SAAS,CAAC;AAC9B;AACO,SAASK,gBAA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I,MAAM,GAAGW,gBAAgB;AAC/B,MAAA,MAAM7I,KAAK;AACb;AACF;AACF;;;;"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data-mirror/request/-private/context' {
|
|
2
|
-
import type { StableDocumentIdentifier } from '@warp-drive-mirror/core-types/identifier';
|
|
3
|
-
import type { ImmutableHeaders, ImmutableRequestInfo, RequestInfo, ResponseInfo } from '@warp-drive-mirror/core-types/request';
|
|
4
|
-
import type { DeferredStream, GodContext } from '@ember-data-mirror/request/-private/types';
|
|
5
|
-
export function upgradeHeaders(headers: Headers | ImmutableHeaders): ImmutableHeaders;
|
|
6
|
-
export function cloneResponseProperties(response: Response): ResponseInfo;
|
|
7
|
-
export class ContextOwner {
|
|
8
|
-
hasSetStream: boolean;
|
|
9
|
-
hasSetResponse: boolean;
|
|
10
|
-
hasSubscribers: boolean;
|
|
11
|
-
stream: DeferredStream;
|
|
12
|
-
response: ResponseInfo | null;
|
|
13
|
-
request: ImmutableRequestInfo;
|
|
14
|
-
enhancedRequest: ImmutableRequestInfo;
|
|
15
|
-
nextCalled: number;
|
|
16
|
-
god: GodContext;
|
|
17
|
-
controller: AbortController;
|
|
18
|
-
requestId: number;
|
|
19
|
-
isRoot: boolean;
|
|
20
|
-
constructor(request: RequestInfo, god: GodContext, isRoot?: boolean);
|
|
21
|
-
get hasRequestedStream(): boolean;
|
|
22
|
-
getResponse(): ResponseInfo | null;
|
|
23
|
-
getStream(): Promise<ReadableStream | null>;
|
|
24
|
-
abort(reason: DOMException): void;
|
|
25
|
-
setStream(stream: ReadableStream | Promise<ReadableStream | null> | null): void;
|
|
26
|
-
resolveStream(): void;
|
|
27
|
-
setResponse(response: ResponseInfo | Response | null): void;
|
|
28
|
-
}
|
|
29
|
-
export class Context {
|
|
30
|
-
#private;
|
|
31
|
-
request: ImmutableRequestInfo;
|
|
32
|
-
id: number;
|
|
33
|
-
private _isCacheHandler;
|
|
34
|
-
private _finalized;
|
|
35
|
-
constructor(owner: ContextOwner, isCacheHandler: boolean);
|
|
36
|
-
setStream(stream: ReadableStream | Promise<ReadableStream | null>): void;
|
|
37
|
-
setResponse(response: ResponseInfo | Response | null): void;
|
|
38
|
-
setIdentifier(identifier: StableDocumentIdentifier): void;
|
|
39
|
-
get hasRequestedStream(): boolean;
|
|
40
|
-
_finalize(): void;
|
|
41
|
-
}
|
|
42
|
-
export type HandlerRequestContext = Context;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/-private/context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAKxH,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1D,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB,GAAG,gBAAgB,CAQpF;AAED,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAYxE;AAED,qBAAa,YAAY;IACvB,YAAY,UAAS;IACrB,cAAc,UAAS;IACvB,cAAc,UAAS;IACvB,MAAM,EAAE,cAAc,CAA2C;IACjE,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAQ;IAC7B,OAAO,EAAE,oBAAoB,CAAC;IAC9B,eAAe,EAAE,oBAAoB,CAAC;IAC9C,UAAU,SAAK;IACP,GAAG,EAAE,UAAU,CAAC;IAChB,UAAU,EAAE,eAAe,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;gBAEZ,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,UAAQ;IAuCjE,IAAI,kBAAkB,IAAI,OAAO,CAEhC;IAED,WAAW,IAAI,YAAY,GAAG,IAAI;IASlC,SAAS,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAW3C,KAAK,CAAC,MAAM,EAAE,YAAY;IAI1B,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,IAAI;IAYxE,aAAa;IAIb,WAAW,CAAC,QAAQ,EAAE,YAAY,GAAG,QAAQ,GAAG,IAAI;CAwBrD;AAED,qBAAa,OAAO;;IAEV,OAAO,EAAE,oBAAoB,CAAC;IAC9B,EAAE,EAAE,MAAM,CAAC;IACnB,QAAgB,eAAe,CAAU;IACzC,QAAgB,UAAU,CAAU;gBAExB,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO;IAOxD,SAAS,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAGjE,WAAW,CAAC,QAAQ,EAAE,YAAY,GAAG,QAAQ,GAAG,IAAI;IAIpD,aAAa,CAAC,UAAU,EAAE,wBAAwB;IAQlD,IAAI,kBAAkB,YAErB;IAED,SAAS;CAGV;AACD,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data-mirror/request/-private/debug' {
|
|
2
|
-
import type { RequestInfo } from '@warp-drive-mirror/core-types/request';
|
|
3
|
-
import { Context } from '@ember-data-mirror/request/-private/context';
|
|
4
|
-
export function deepFreeze<T = unknown>(value: T): T;
|
|
5
|
-
export function assertValidRequest(request: RequestInfo | Context, isTopLevel: boolean): asserts request is RequestInfo;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=debug.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/-private/debug.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAoB,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAEpF,OAAO,EAAE,OAAO,EAAkB,MAAM,WAAW,CAAC;AAmFpD,wBAAgB,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAuDnD;AAmJD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,GAAG,OAAO,EAC9B,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,OAAO,IAAI,WAAW,CA8DhC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data-mirror/request/-private/future' {
|
|
2
|
-
import { type StructuredDocument } from '@warp-drive-mirror/core-types/request';
|
|
3
|
-
import type { ContextOwner } from '@ember-data-mirror/request/-private/context';
|
|
4
|
-
import type { Deferred, DeferredFuture, Future } from '@ember-data-mirror/request/-private/types';
|
|
5
|
-
export function isFuture<T>(maybe: unknown): maybe is Future<T>;
|
|
6
|
-
export function createDeferred<T>(): Deferred<T>;
|
|
7
|
-
export function upgradePromise<T>(promise: Promise<StructuredDocument<T>>, future: Future<T>): Future<T>;
|
|
8
|
-
export function createFuture<T>(owner: ContextOwner): DeferredFuture<T>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=future.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"future.d.ts","sourceRoot":"","sources":["../../src/-private/future.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGhE,wBAAgB,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,CAE9D;AAED,wBAAgB,cAAc,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAQ/C;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAYvG;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,GAAG,cAAc,CAAC,CAAC,CAAC,CA0BtE"}
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data-mirror/request/-private/manager' {
|
|
2
|
-
import type { StableDocumentIdentifier } from '@warp-drive-mirror/core-types/identifier';
|
|
3
|
-
import type { RequestInfo } from '@warp-drive-mirror/core-types/request';
|
|
4
|
-
import type { CacheHandler, Future, GenericCreateArgs, Handler, ManagedRequestPriority } from '@ember-data-mirror/request/-private/types';
|
|
5
|
-
import { IS_CACHE_HANDLER } from '@ember-data-mirror/request/-private/utils';
|
|
6
|
-
/**
|
|
7
|
-
* ```js
|
|
8
|
-
* import RequestManager from '@ember-data-mirror/request';
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* A RequestManager provides a request/response flow in which configured
|
|
12
|
-
* handlers are successively given the opportunity to handle, modify, or
|
|
13
|
-
* pass-along a request.
|
|
14
|
-
*
|
|
15
|
-
* ```ts
|
|
16
|
-
* interface RequestManager {
|
|
17
|
-
* request<T>(req: RequestInfo): Future<T>;
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* For example:
|
|
22
|
-
*
|
|
23
|
-
* ```ts
|
|
24
|
-
* import RequestManager from '@ember-data-mirror/request';
|
|
25
|
-
* import Fetch from '@ember-data-mirror/request/fetch';
|
|
26
|
-
* import Auth from 'ember-simple-auth/ember-data-handler';
|
|
27
|
-
* import Config from './config';
|
|
28
|
-
*
|
|
29
|
-
* const { apiUrl } = Config;
|
|
30
|
-
*
|
|
31
|
-
* // ... create manager
|
|
32
|
-
* const manager = new RequestManager().use([Auth, Fetch]);
|
|
33
|
-
*
|
|
34
|
-
* // ... execute a request
|
|
35
|
-
* const response = await manager.request({
|
|
36
|
-
* url: `${apiUrl}/users`
|
|
37
|
-
* });
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* ### Futures
|
|
41
|
-
*
|
|
42
|
-
* The return value of `manager.request` is a `Future`, which allows
|
|
43
|
-
* access to limited information about the request while it is still
|
|
44
|
-
* pending and fulfills with the final state when the request completes.
|
|
45
|
-
*
|
|
46
|
-
* A `Future` is cancellable via `abort`.
|
|
47
|
-
*
|
|
48
|
-
* Handlers may optionally expose a `ReadableStream` to the `Future` for
|
|
49
|
-
* streaming data; however, when doing so the future should not resolve
|
|
50
|
-
* until the response stream is fully read.
|
|
51
|
-
*
|
|
52
|
-
* ```ts
|
|
53
|
-
* interface Future<T> extends Promise<StructuredDocument<T>> {
|
|
54
|
-
* abort(): void;
|
|
55
|
-
*
|
|
56
|
-
* async getStream(): ReadableStream | null;
|
|
57
|
-
* }
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* ### StructuredDocuments
|
|
61
|
-
*
|
|
62
|
-
* A Future resolves with a `StructuredDataDocument` or rejects with a `StructuredErrorDocument`.
|
|
63
|
-
*
|
|
64
|
-
* ```ts
|
|
65
|
-
* interface StructuredDataDocument<T> {
|
|
66
|
-
* request: ImmutableRequestInfo;
|
|
67
|
-
* response: ImmutableResponseInfo;
|
|
68
|
-
* content: T;
|
|
69
|
-
* }
|
|
70
|
-
* interface StructuredErrorDocument extends Error {
|
|
71
|
-
* request: ImmutableRequestInfo;
|
|
72
|
-
* response: ImmutableResponseInfo;
|
|
73
|
-
* error: string | object;
|
|
74
|
-
* }
|
|
75
|
-
* type StructuredDocument<T> = StructuredDataDocument<T> | StructuredErrorDocument;
|
|
76
|
-
* ```
|
|
77
|
-
*
|
|
78
|
-
* @class RequestManager
|
|
79
|
-
* @public
|
|
80
|
-
*/
|
|
81
|
-
export class RequestManager {
|
|
82
|
-
#private;
|
|
83
|
-
_hasCacheHandler: boolean;
|
|
84
|
-
/**
|
|
85
|
-
* A map of pending requests from request.id to their
|
|
86
|
-
* associated CacheHandler promise.
|
|
87
|
-
*
|
|
88
|
-
* This queue is managed by the CacheHandler
|
|
89
|
-
*
|
|
90
|
-
* @internal
|
|
91
|
-
*/
|
|
92
|
-
_pending: Map<number, Promise<unknown>>;
|
|
93
|
-
_deduped: Map<StableDocumentIdentifier, {
|
|
94
|
-
priority: ManagedRequestPriority;
|
|
95
|
-
promise: Promise<unknown>;
|
|
96
|
-
}>;
|
|
97
|
-
constructor(options?: GenericCreateArgs);
|
|
98
|
-
/**
|
|
99
|
-
* Register a handler to use for primary cache intercept.
|
|
100
|
-
*
|
|
101
|
-
* Only one such handler may exist. If using the same
|
|
102
|
-
* RequestManager as the Store instance the Store
|
|
103
|
-
* registers itself as a Cache handler.
|
|
104
|
-
*
|
|
105
|
-
* @method useCache
|
|
106
|
-
* @public
|
|
107
|
-
* @param {Handler[]} cacheHandler
|
|
108
|
-
* @return {ThisType}
|
|
109
|
-
*/
|
|
110
|
-
useCache(cacheHandler: CacheHandler & {
|
|
111
|
-
[IS_CACHE_HANDLER]?: true;
|
|
112
|
-
}): this;
|
|
113
|
-
/**
|
|
114
|
-
* Register handler(s) to use when a request is issued.
|
|
115
|
-
*
|
|
116
|
-
* Handlers will be invoked in the order they are registered.
|
|
117
|
-
* Each Handler is given the opportunity to handle the request,
|
|
118
|
-
* curry the request, or pass along a modified request.
|
|
119
|
-
*
|
|
120
|
-
* @method use
|
|
121
|
-
* @public
|
|
122
|
-
* @param {Handler[]} newHandlers
|
|
123
|
-
* @return {ThisType}
|
|
124
|
-
*/
|
|
125
|
-
use(newHandlers: Handler[]): this;
|
|
126
|
-
/**
|
|
127
|
-
* Issue a Request.
|
|
128
|
-
*
|
|
129
|
-
* Returns a Future that fulfills with a StructuredDocument
|
|
130
|
-
*
|
|
131
|
-
* @method request
|
|
132
|
-
* @public
|
|
133
|
-
* @param {RequestInfo} request
|
|
134
|
-
* @return {Future}
|
|
135
|
-
*/
|
|
136
|
-
request<RT, T = unknown>(request: RequestInfo<T, RT>): Future<RT>;
|
|
137
|
-
static create(options?: GenericCreateArgs): RequestManager;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/-private/manager.ts"],"names":[],"mappings":"AA+aA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAA2B,MAAM,gCAAgC,CAAC;AAK3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACxG,OAAO,EAAsB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,qBAAa,cAAc;;IAEjB,gBAAgB,EAAE,OAAO,CAAC;IAClC;;;;;;;OAOG;IACK,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACxC,QAAQ,EAAE,GAAG,CAAC,wBAAwB,EAAE;QAAE,QAAQ,EAAE,sBAAsB,CAAC;QAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;gBAErG,OAAO,CAAC,EAAE,iBAAiB;IAMvC;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,YAAY,EAAE,YAAY,GAAG;QAAE,CAAC,gBAAgB,CAAC,CAAC,EAAE,IAAI,CAAA;KAAE,GAAG,IAAI;IAiB1E;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,GAAG,IAAI;IAuBjC;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,EAAE,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC;IA0FjE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,iBAAiB;CAG1C"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
declare module '@ember-data-mirror/request/-private/promise-cache' {
|
|
2
|
-
export type CacheResult<T = unknown, E = unknown> = {
|
|
3
|
-
isError: true;
|
|
4
|
-
result: E;
|
|
5
|
-
} | {
|
|
6
|
-
isError: false;
|
|
7
|
-
result: T;
|
|
8
|
-
};
|
|
9
|
-
export type Awaitable<T = unknown, E = unknown> = {
|
|
10
|
-
then: (onFulfilled: (value: T) => unknown, onRejected: (reason: E) => unknown) => unknown;
|
|
11
|
-
catch: (onRejected: (reason: E) => unknown) => unknown;
|
|
12
|
-
finally: (onFinally: () => unknown) => unknown;
|
|
13
|
-
};
|
|
14
|
-
export const PromiseCache: WeakMap<Awaitable<unknown, unknown>, CacheResult<unknown, unknown>>;
|
|
15
|
-
export const RequestMap: Map<number, CacheResult<unknown, unknown>>;
|
|
16
|
-
export function setRequestResult(requestId: number, result: CacheResult): void;
|
|
17
|
-
export function clearRequestResult(requestId: number): void;
|
|
18
|
-
export function getRequestResult(requestId: number): CacheResult | undefined;
|
|
19
|
-
export function setPromiseResult(promise: Promise<unknown> | Awaitable, result: CacheResult): void;
|
|
20
|
-
export function getPromiseResult<T, E>(promise: Promise<T> | Awaitable<T, E>): CacheResult<T, E> | undefined;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=promise-cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promise-cache.d.ts","sourceRoot":"","sources":["../../src/-private/promise-cache.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG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
2
|
-
import type { StableDocumentIdentifier } from '@warp-drive-mirror/core-types/identifier';
|
|
3
|
-
import type { IS_FUTURE, RequestContext, RequestInfo, ResponseInfo, StructuredDataDocument } from '@warp-drive-mirror/core-types/request';
|
|
4
|
-
/**
|
|
5
|
-
* @module @ember-data-mirror/request
|
|
6
|
-
*/
|
|
7
|
-
export interface GodContext {
|
|
8
|
-
controller: AbortController;
|
|
9
|
-
response: ResponseInfo | null;
|
|
10
|
-
stream: ReadableStream | Promise<ReadableStream | null> | null;
|
|
11
|
-
hasRequestedStream: boolean;
|
|
12
|
-
id: number;
|
|
13
|
-
identifier: StableDocumentIdentifier | null;
|
|
14
|
-
}
|
|
15
|
-
export type Deferred<T> = {
|
|
16
|
-
resolve(v: T): void;
|
|
17
|
-
reject(v: unknown): void;
|
|
18
|
-
promise: Promise<T>;
|
|
19
|
-
};
|
|
20
|
-
export type ManagedRequestPriority = {
|
|
21
|
-
blocking: boolean;
|
|
22
|
-
};
|
|
23
|
-
export type DeferredStream = {
|
|
24
|
-
resolve(v: ReadableStream | null): void;
|
|
25
|
-
reject(v: unknown): void;
|
|
26
|
-
promise: Promise<ReadableStream | null> & {
|
|
27
|
-
sizeHint?: number;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* A Future is a Promise which resolves to a StructuredDocument
|
|
32
|
-
* while providing the ability to `abort` the underlying request,
|
|
33
|
-
* `getStream` the response before the outer promise resolves;
|
|
34
|
-
*
|
|
35
|
-
* @class Future
|
|
36
|
-
* @extends Promise
|
|
37
|
-
* @public
|
|
38
|
-
*/
|
|
39
|
-
export type Future<T> = Promise<StructuredDataDocument<T>> & {
|
|
40
|
-
[IS_FUTURE]: true;
|
|
41
|
-
/**
|
|
42
|
-
* Cancel this request by firing the AbortController's signal.
|
|
43
|
-
*
|
|
44
|
-
* @method abort
|
|
45
|
-
* @param {String} [reason] optional reason for aborting the request
|
|
46
|
-
* @public
|
|
47
|
-
* @return {void}
|
|
48
|
-
*/
|
|
49
|
-
abort(reason?: string): void;
|
|
50
|
-
/**
|
|
51
|
-
* Get the response stream, if any, once made available.
|
|
52
|
-
*
|
|
53
|
-
* @method getStream
|
|
54
|
-
* @public
|
|
55
|
-
* @return {Promise<ReadableStream | null>}
|
|
56
|
-
*/
|
|
57
|
-
getStream(): Promise<ReadableStream | null>;
|
|
58
|
-
/**
|
|
59
|
-
* Run a callback when this request completes. Use sparingly,
|
|
60
|
-
* mostly useful for instrumentation and infrastructure.
|
|
61
|
-
*
|
|
62
|
-
* @method onFinalize
|
|
63
|
-
* @param cb the callback to run
|
|
64
|
-
* @public
|
|
65
|
-
* @return void
|
|
66
|
-
*/
|
|
67
|
-
onFinalize(cb: () => void): void;
|
|
68
|
-
/**
|
|
69
|
-
* The identifier of the associated request, if any, as
|
|
70
|
-
* assigned by the CacheHandler.
|
|
71
|
-
*
|
|
72
|
-
* @property lid
|
|
73
|
-
* @type {StableDocumentIdentifier | null}
|
|
74
|
-
* @public
|
|
75
|
-
*/
|
|
76
|
-
lid: StableDocumentIdentifier | null;
|
|
77
|
-
/**
|
|
78
|
-
* The id of the associated request, if any, as assigned
|
|
79
|
-
* by the RequestManager
|
|
80
|
-
*
|
|
81
|
-
* @property id
|
|
82
|
-
* @type {Number}
|
|
83
|
-
* @public
|
|
84
|
-
*/
|
|
85
|
-
id: number;
|
|
86
|
-
};
|
|
87
|
-
export type DeferredFuture<T> = {
|
|
88
|
-
resolve(v: StructuredDataDocument<T>): void;
|
|
89
|
-
reject(v: unknown): void;
|
|
90
|
-
promise: Future<T>;
|
|
91
|
-
};
|
|
92
|
-
export type NextFn<P = unknown> = (req: RequestInfo) => Future<P>;
|
|
93
|
-
/**
|
|
94
|
-
* Requests are fulfilled by handlers. A handler receives the request context
|
|
95
|
-
as well as a `next` function with which to pass along a request to the next
|
|
96
|
-
handler if it so chooses.
|
|
97
|
-
|
|
98
|
-
A handler may be any object with a `request` method. This allows both stateful and non-stateful
|
|
99
|
-
handlers to be utilized.
|
|
100
|
-
|
|
101
|
-
If a handler calls `next`, it receives a `Future` which resolves to a `StructuredDocument`
|
|
102
|
-
that it can then compose how it sees fit with its own response.
|
|
103
|
-
|
|
104
|
-
```ts
|
|
105
|
-
type NextFn<P> = (req: RequestInfo) => Future<P>;
|
|
106
|
-
|
|
107
|
-
interface Handler {
|
|
108
|
-
async request<T>(context: RequestContext, next: NextFn<P>): T;
|
|
109
|
-
}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
`RequestContext` contains a readonly version of the RequestInfo as well as a few methods for building up the `StructuredDocument` and `Future` that will be part of the response.
|
|
113
|
-
|
|
114
|
-
```ts
|
|
115
|
-
interface RequestContext<T> {
|
|
116
|
-
readonly request: RequestInfo;
|
|
117
|
-
|
|
118
|
-
setStream(stream: ReadableStream | Promise<ReadableStream>): void;
|
|
119
|
-
setResponse(response: Response | ResponseInfo): void;
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
A basic `fetch` handler with support for streaming content updates while
|
|
124
|
-
the download is still underway might look like the following, where we use
|
|
125
|
-
[`response.clone()`](https://developer.mozilla.org/en-US/docs/Web/API/Response/clone) to `tee` the `ReadableStream` into two streams.
|
|
126
|
-
|
|
127
|
-
A more efficient handler might read from the response stream, building up the
|
|
128
|
-
response content before passing along the chunk downstream.
|
|
129
|
-
|
|
130
|
-
```ts
|
|
131
|
-
const FetchHandler = {
|
|
132
|
-
async request(context) {
|
|
133
|
-
const response = await fetch(context.request);
|
|
134
|
-
context.setResponse(reponse);
|
|
135
|
-
context.setStream(response.clone().body);
|
|
136
|
-
|
|
137
|
-
return response.json();
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Stream Currying
|
|
143
|
-
|
|
144
|
-
`RequestManager.request` and `next` differ from `fetch` in one **crucial detail** in that the outer Promise resolves only once the response stream has been processed.
|
|
145
|
-
|
|
146
|
-
For context, it helps to understand a few of the use-cases that RequestManager
|
|
147
|
-
is intended to allow.
|
|
148
|
-
|
|
149
|
-
- to manage and return streaming content (such as video files)
|
|
150
|
-
- to fulfill a request from multiple sources or by splitting one request into multiple requests
|
|
151
|
-
- for instance one API call for a user and another for the user's friends
|
|
152
|
-
- or e.g. fulfilling part of the request from one source (one API, in-memory, localStorage, IndexedDB etc.) and the rest from another source (a different API, a WebWorker, etc.)
|
|
153
|
-
- to coalesce multiple requests
|
|
154
|
-
- to decorate a request with additional info
|
|
155
|
-
- e.g. an Auth handler that ensures the correct tokens or headers or cookies are attached.
|
|
156
|
-
|
|
157
|
-
----
|
|
158
|
-
|
|
159
|
-
`await fetch(<req>)` resolves at the moment headers are received. This allows for the body of the request to be processed as a stream by application
|
|
160
|
-
code *while chunks are still being received by the browser*.
|
|
161
|
-
|
|
162
|
-
When an app chooses to `await response.json()` what occurs is the browser reads the stream to completion and then returns the result. Additionally, this stream may only be read **once**.
|
|
163
|
-
|
|
164
|
-
The `RequestManager` preserves this ability to subscribe to and utilize the stream by either the application or the handler – thereby delivering the full power and flexibility of native APIs – without restricting developers in ways that lead to complicated workarounds.
|
|
165
|
-
|
|
166
|
-
Each handler may call `setStream` only once, but may do so *at any time* until the promise that the handler returns has resolved. The associated promise returned by calling `future.getStream` will resolve with the stream set by `setStream` if that method is called, or `null` if that method
|
|
167
|
-
has not been called by the time that the handler's request method has resolved.
|
|
168
|
-
|
|
169
|
-
Handlers that do not create a stream of their own, but which call `next`, should defensively pipe the stream forward. While this is not required (see automatic currying below) it is better to do so in most cases as otherwise the stream may not become available to downstream handlers or the application until the upstream handler has fully read it.
|
|
170
|
-
|
|
171
|
-
```ts
|
|
172
|
-
context.setStream(future.getStream());
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
Handlers that either call `next` multiple times or otherwise have reason to create multiple fetch requests should either choose to return no stream, meaningfully combine the streams, or select a single prioritized stream.
|
|
176
|
-
|
|
177
|
-
Of course, any handler may choose to read and handle the stream, and return either no stream or a different stream in the process.
|
|
178
|
-
|
|
179
|
-
### Automatic Currying of Stream and Response
|
|
180
|
-
|
|
181
|
-
In order to simplify the common case for handlers which decorate a request, if `next` is called only a single time and `setResponse` was never called by the handler, the response set by the next handler in the chain will be applied to that handler's outcome. For instance, this makes the following pattern possible `return (await next(<req>)).content;`.
|
|
182
|
-
|
|
183
|
-
Similarly, if `next` is called only a single time and neither `setStream` nor `getStream` was called, we automatically curry the stream from the future returned by `next` onto the future returned by the handler.
|
|
184
|
-
|
|
185
|
-
Finally, if the return value of a handler is a `Future`, we curry `content` and `errors` as well, thus enabling the simplest form `return next(<req>)`.
|
|
186
|
-
|
|
187
|
-
In the case of the `Future` being returned, `Stream` proxying is automatic and immediate and does not wait for the `Future` to resolve.
|
|
188
|
-
|
|
189
|
-
### Handler Order
|
|
190
|
-
|
|
191
|
-
Request handlers are registered by configuring the manager via `use`
|
|
192
|
-
|
|
193
|
-
```ts
|
|
194
|
-
const manager = new RequestManager()
|
|
195
|
-
.use([Handler1, Handler2]);
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
Handlers will be invoked in the order they are registered ("fifo", first-in first-out), and may only be registered up until the first request is made. It is recommended but not required to register all handlers at one time in order to ensure explicitly visible handler ordering.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
@class <Interface> Handler
|
|
202
|
-
@public
|
|
203
|
-
*/
|
|
204
|
-
export interface Handler {
|
|
205
|
-
/**
|
|
206
|
-
* Method to implement to handle requests. Receives the request
|
|
207
|
-
* context and a nextFn to call to pass-along the request to
|
|
208
|
-
* other handlers.
|
|
209
|
-
*
|
|
210
|
-
* @method request
|
|
211
|
-
* @public
|
|
212
|
-
* @param context
|
|
213
|
-
* @param next
|
|
214
|
-
*/
|
|
215
|
-
request<T = unknown>(context: RequestContext, next: NextFn<T>): Promise<T | StructuredDataDocument<T>> | Future<T>;
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* The CacheHandler is identical to other handlers ecxept that it
|
|
219
|
-
* is allowed to return a value synchronously. This is useful for
|
|
220
|
-
* features like reducing microtask queueing when de-duping.
|
|
221
|
-
*
|
|
222
|
-
* A RequestManager may only have one CacheHandler, registered via
|
|
223
|
-
* `manager.useCache(CacheHandler)`.
|
|
224
|
-
*
|
|
225
|
-
* @class <Interface> CacheHandler
|
|
226
|
-
* @public
|
|
227
|
-
*/
|
|
228
|
-
export interface CacheHandler {
|
|
229
|
-
/**
|
|
230
|
-
* Method to implement to handle requests. Receives the request
|
|
231
|
-
* context and a nextFn to call to pass-along the request to
|
|
232
|
-
* other handlers.
|
|
233
|
-
*
|
|
234
|
-
* @method request
|
|
235
|
-
* @public
|
|
236
|
-
* @param context
|
|
237
|
-
* @param next
|
|
238
|
-
*/
|
|
239
|
-
request<T = unknown>(context: RequestContext, next: NextFn<T>): Promise<T | StructuredDataDocument<T>> | Future<T> | T;
|
|
240
|
-
}
|
|
241
|
-
export interface RequestResponse<T> {
|
|
242
|
-
result: T;
|
|
243
|
-
}
|
|
244
|
-
export type GenericCreateArgs = Record<string | symbol, unknown>;
|
|
245
|
-
}
|
|
246
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/-private/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EACd,WAAW,EACX,YAAY,EACZ,sBAAsB,EACvB,MAAM,gCAAgC,CAAC;AAExC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,eAAe,CAAC;IAC5B,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC/D,kBAAkB,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,wBAAwB,GAA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