@zapier/kitcore 0.17.1 → 0.18.0
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/CHANGELOG.md +32 -0
- package/dist/index.cjs +14 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.mjs +12 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4521,7 +4521,7 @@ type SendHttpRequest = (request: HttpRequest) => ReturnType<typeof fetch>;
|
|
|
4521
4521
|
* removes the only boundary below `initializeHttpRequest`, and a retry wrap
|
|
4522
4522
|
* would then re-initialize and mint a fresh `operationId` per attempt.
|
|
4523
4523
|
*/
|
|
4524
|
-
declare const attemptHttpRequestPlugin: MethodPlugin<"attemptHttpRequest", AttemptHttpRequestInput, Promise<Response>, readonly [], AttemptHttpRequestInput> & LeafSummary<"kitcore", "attemptHttpRequest", readonly [MethodPlugin<"prepareHttpRequest", PrepareHttpRequestInput, Promise<HttpRequest>, readonly [], PrepareHttpRequestInput> & LeafSummary<"kitcore", "prepareHttpRequest", readonly []>, MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>, MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly []>, MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>]>;
|
|
4524
|
+
declare const attemptHttpRequestPlugin: MethodPlugin<"attemptHttpRequest", AttemptHttpRequestInput, Promise<Response>, readonly [], AttemptHttpRequestInput> & LeafSummary<"kitcore", "attemptHttpRequest", readonly [MethodPlugin<"prepareHttpRequest", PrepareHttpRequestInput, Promise<HttpRequest>, readonly [], PrepareHttpRequestInput> & LeafSummary<"kitcore", "prepareHttpRequest", readonly []>, MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>, MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly [PropertyPlugin<"httpFetch", typeof fetch | undefined> & PluginSummary<never, never> & StandInId<"kitcore/httpFetch">]>, MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>]>;
|
|
4525
4525
|
|
|
4526
4526
|
/**
|
|
4527
4527
|
* Completes the operation context: normalizes the caller's request and records
|
|
@@ -4594,7 +4594,15 @@ declare const prepareHttpRequestPlugin: MethodPlugin<"prepareHttpRequest", Prepa
|
|
|
4594
4594
|
|
|
4595
4595
|
declare const authorizeHttpRequestPlugin: MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>;
|
|
4596
4596
|
|
|
4597
|
-
declare const
|
|
4597
|
+
declare const HTTP_FETCH_ID = "kitcore/httpFetch";
|
|
4598
|
+
/**
|
|
4599
|
+
* Optional fetch implementation for the default dispatch stage. Keeping it a
|
|
4600
|
+
* property lets an SDK provide a debug wrapper or test double without using the
|
|
4601
|
+
* `dispatchHttpRequest` wrap slot that hosts use to replace dispatch. When
|
|
4602
|
+
* absent, dispatch uses `globalThis.fetch`.
|
|
4603
|
+
*/
|
|
4604
|
+
declare const httpFetchPluginRef: PropertyPlugin<"httpFetch", typeof fetch | undefined> & PluginSummary<never, never> & StandInId<"kitcore/httpFetch">;
|
|
4605
|
+
declare const dispatchHttpRequestPlugin: MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly [PropertyPlugin<"httpFetch", typeof fetch | undefined> & PluginSummary<never, never> & StandInId<"kitcore/httpFetch">]>;
|
|
4598
4606
|
|
|
4599
4607
|
declare const receiveHttpResponsePlugin: MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>;
|
|
4600
4608
|
|
|
@@ -4625,7 +4633,7 @@ declare const receiveHttpResponsePlugin: MethodPlugin<"receiveHttpResponse", Rec
|
|
|
4625
4633
|
* No retry by default: with nothing composed this runs exactly one attempt.
|
|
4626
4634
|
* `retryHttpRequestPlugin` is opt-in.
|
|
4627
4635
|
*/
|
|
4628
|
-
declare const sendHttpRequestPlugin: MethodPlugin<"sendHttpRequest", HttpRequestInput, Promise<Response>, readonly [], HttpRequestInput> & LeafSummary<"kitcore", "sendHttpRequest", readonly [MethodPlugin<"initializeHttpRequest", InitializeHttpRequestInput, Promise<HttpOperationContext>, readonly [], InitializeHttpRequestInput> & LeafSummary<"kitcore", "initializeHttpRequest", readonly []>, MethodPlugin<"attemptHttpRequest", AttemptHttpRequestInput, Promise<Response>, readonly [], AttemptHttpRequestInput> & LeafSummary<"kitcore", "attemptHttpRequest", readonly [MethodPlugin<"prepareHttpRequest", PrepareHttpRequestInput, Promise<HttpRequest>, readonly [], PrepareHttpRequestInput> & LeafSummary<"kitcore", "prepareHttpRequest", readonly []>, MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>, MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly []>, MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>]>]>;
|
|
4636
|
+
declare const sendHttpRequestPlugin: MethodPlugin<"sendHttpRequest", HttpRequestInput, Promise<Response>, readonly [], HttpRequestInput> & LeafSummary<"kitcore", "sendHttpRequest", readonly [MethodPlugin<"initializeHttpRequest", InitializeHttpRequestInput, Promise<HttpOperationContext>, readonly [], InitializeHttpRequestInput> & LeafSummary<"kitcore", "initializeHttpRequest", readonly []>, MethodPlugin<"attemptHttpRequest", AttemptHttpRequestInput, Promise<Response>, readonly [], AttemptHttpRequestInput> & LeafSummary<"kitcore", "attemptHttpRequest", readonly [MethodPlugin<"prepareHttpRequest", PrepareHttpRequestInput, Promise<HttpRequest>, readonly [], PrepareHttpRequestInput> & LeafSummary<"kitcore", "prepareHttpRequest", readonly []>, MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>, MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly [PropertyPlugin<"httpFetch", typeof fetch | undefined> & PluginSummary<never, never> & StandInId<"kitcore/httpFetch">]>, MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>]>]>;
|
|
4629
4637
|
|
|
4630
4638
|
/**
|
|
4631
4639
|
* `fetch` — native `fetch(url, init)` ergonomics over the transport. It
|
|
@@ -4654,7 +4662,7 @@ declare const fetchPlugin: MethodPlugin<"fetch", {
|
|
|
4654
4662
|
}, Promise<Response>, readonly ["url", "init"], {
|
|
4655
4663
|
url: string | URL;
|
|
4656
4664
|
init?: Omit<HttpRequestInput, "url">;
|
|
4657
|
-
}> & LeafSummary<"kitcore", "fetch", readonly [MethodPlugin<"sendHttpRequest", HttpRequestInput, Promise<Response>, readonly [], HttpRequestInput> & LeafSummary<"kitcore", "sendHttpRequest", readonly [MethodPlugin<"initializeHttpRequest", InitializeHttpRequestInput, Promise<HttpOperationContext>, readonly [], InitializeHttpRequestInput> & LeafSummary<"kitcore", "initializeHttpRequest", readonly []>, MethodPlugin<"attemptHttpRequest", AttemptHttpRequestInput, Promise<Response>, readonly [], AttemptHttpRequestInput> & LeafSummary<"kitcore", "attemptHttpRequest", readonly [MethodPlugin<"prepareHttpRequest", PrepareHttpRequestInput, Promise<HttpRequest>, readonly [], PrepareHttpRequestInput> & LeafSummary<"kitcore", "prepareHttpRequest", readonly []>, MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>, MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly []>, MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>]>]>]>;
|
|
4665
|
+
}> & LeafSummary<"kitcore", "fetch", readonly [MethodPlugin<"sendHttpRequest", HttpRequestInput, Promise<Response>, readonly [], HttpRequestInput> & LeafSummary<"kitcore", "sendHttpRequest", readonly [MethodPlugin<"initializeHttpRequest", InitializeHttpRequestInput, Promise<HttpOperationContext>, readonly [], InitializeHttpRequestInput> & LeafSummary<"kitcore", "initializeHttpRequest", readonly []>, MethodPlugin<"attemptHttpRequest", AttemptHttpRequestInput, Promise<Response>, readonly [], AttemptHttpRequestInput> & LeafSummary<"kitcore", "attemptHttpRequest", readonly [MethodPlugin<"prepareHttpRequest", PrepareHttpRequestInput, Promise<HttpRequest>, readonly [], PrepareHttpRequestInput> & LeafSummary<"kitcore", "prepareHttpRequest", readonly []>, MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>, MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly [PropertyPlugin<"httpFetch", typeof fetch | undefined> & PluginSummary<never, never> & StandInId<"kitcore/httpFetch">]>, MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>]>]>]>;
|
|
4658
4666
|
|
|
4659
4667
|
/**
|
|
4660
4668
|
* Headers with every credential value masked, as a plain object a logger can
|
|
@@ -4722,4 +4730,4 @@ declare const normalizeConnectionPlugin: MethodPlugin<"normalizeConnection", Nor
|
|
|
4722
4730
|
*/
|
|
4723
4731
|
declare const resolveConnectionPlugin: MethodPlugin<"resolveConnection", ResolveConnectionInput, string | undefined, readonly [], ResolveConnectionInput> & LeafSummary<"kitcore", "resolveConnection", readonly []>;
|
|
4724
4732
|
|
|
4725
|
-
export { type AdaptError, type AdaptErrorOptions, type AdaptPage, type AggregatePlugin, type Annotations, type ArrayResolver$1 as ArrayResolver, type AsyncContext, type AttemptHttpRequestInput, type AuthorizeHttpRequestInput, type BoundFormatter, type BoundResolver, CONTEXT, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, type CallContext, type CallOrigin, type CategoryDefinition, type ComposedAnnotator, type ConstantResolver$1 as ConstantResolver, type Controller, type ControllerAction, type ControllerAffordance, type ControllerAnswerFn, type ControllerChoice, type ControllerError, type ControllerIssue, type ControllerListingPage, type ControllerListingPosition, type ControllerMethodDescription, type ControllerMethodSummary, type ControllerPagination, type ControllerParameterDescription, type ControllerPath, type ControllerQuestion, type ControllerResult, type ControllerSdk, type ControllerSelectPage, type ControllerState, type CoreApiError, CoreCancelledSignal, CoreDisposeError, CoreError, CoreErrorCode, type CoreErrorOptions, type CoreOptions, CoreSignal, type CreateSdkOptions, type DefaultConnectionSchemeInput, type DeprecatedPromptConfigChoice, type DeprecationLogger, type DeprecationWarning, type DispatchHttpRequestInput, type DisposeFn, type DynamicListResolver, type DynamicMember, type DynamicResolver$1 as DynamicResolver, type DynamicSearchResolver, type FieldsResolver, type FormattedItem, type Formatter, type FunctionDeprecation, type FunctionRegistryEntry, type HookAnnotator, type HookPlugin, type HttpAttemptContext, type HttpFetchInit, type HttpOperationContext, type HttpOperationStart, type HttpPipelineState, type HttpRequest, type HttpRequestInput, type HttpResponse, type InitializeHttpRequestInput, type LeafMeta, type LeafSummary, type LegacyMergePlugin, type LegacyPlugin, type ListItemsResult, type ListPromptConfig, type MethodAnnotator, type MethodAttachment, type MethodHooks, type MethodOverridePlugin, type MethodPlugin, type MethodScope, type Resolver as ModelResolver, type NegatableMetadata, type NormalizeConnectionInput, type NormalizedConnection, type OnMethodEnd, type OnMethodEndContext, type OnMethodStart, type OnMethodStartContext, type OutputDataValidationReport, type OutputFormatter, type OverridableMetaFields, type PaginatedSdkFunction, type PaginatedSdkResult, type Plugin, type PluginMeta, type PluginProvides, type PluginStack, type PluginSummary, type PluginSurface, type PositionalMetadata, type PrepareHttpRequestInput, type PromptConfig, type PromptConfigChoice, type PropertyPlugin, RETRY_HTTP_REQUEST_OPTIONS_ID, type ReceiveHttpResponseInput, type RegistryResult, type RequiredSdkOf, type ResolveConnectionInput, type Resolver$1 as Resolver, type ResolverConfig, type ResolverFieldItem, type ResolverMetadata, type ResolverPromptConfig, type ResolverRequirement, type ResolverType, type ResponseMeta, type RetryHttpRequestOptions, STABILITY_LEVELS, STABILITY_TITLES, type Sdk, type SdkContext, type SdkContextCarrier, type SdkPage, type SendHttpRequest, type StabilityLevel, type StabilityNotice, type StabilityNoticeLogger, type StandInId, type StaticResolver$1 as StaticResolver, type ValidResolvers, addPlugin, applyStabilityLabel, attemptHttpRequestPlugin, authorizeHttpRequestPlugin, canonicalInputSchema, composePlugins, concatLists, concatPaginated, coreOptionsPluginRef, createAsyncContext, createController, createCoreError, createCorePlugin, createDeprecationLogger, createFunction, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createPrefixedCursor, createSdk, createStabilityNoticeLogger, createValidator, dangerousContextPlugin, declareDefault, declareMethod, declareOptionalMethod, declareOptionalProperty, declarePlugin, declareProperty, decodeIncomingCursor, defaultConnectionSchemePlugin, defaultLogDeprecation, defineFormatter, defineHook, defineLegacyMerge, defineMethod, defineMethodOverride, defineOverride, definePlugin, defineProperty, defineResolver, dispatchHttpRequestPlugin, disposeSdk, fetchPlugin, fromFunctionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCurrentDepth, getCurrentScope, getFieldDescriptions, getNegatable, getOutputSchema, getRegistry, getRegistryPlugin, getSchemaDescription, initializeHttpRequestPlugin, isCoreCancelledSignal, isCoreError, isCoreSignal, isNestedMethodCall, isPositional, isTelemetryNested, normalizeConnectionPlugin, normalizeStability, objectShapeOf, omitExports, openEnum, paginate, paginateBuffered, paginateMaxItems, prepareHttpRequestPlugin, receiveHttpResponsePlugin, redactHeaders, redactHttpRequest, resolveConnectionPlugin, resolvePlugin, retryHttpRequestOptionsPluginRef, retryHttpRequestPlugin, runInMethodScope, runWithTelemetryContext, selectExports, sendHttpRequestPlugin, splitPrefixedCursor, toIterable, toSnakeCase, toTitleCase, unwrapSchema, validateOptions, withOutputSchema, withPositional, withResolver };
|
|
4733
|
+
export { type AdaptError, type AdaptErrorOptions, type AdaptPage, type AggregatePlugin, type Annotations, type ArrayResolver$1 as ArrayResolver, type AsyncContext, type AttemptHttpRequestInput, type AuthorizeHttpRequestInput, type BoundFormatter, type BoundResolver, CONTEXT, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, type CallContext, type CallOrigin, type CategoryDefinition, type ComposedAnnotator, type ConstantResolver$1 as ConstantResolver, type Controller, type ControllerAction, type ControllerAffordance, type ControllerAnswerFn, type ControllerChoice, type ControllerError, type ControllerIssue, type ControllerListingPage, type ControllerListingPosition, type ControllerMethodDescription, type ControllerMethodSummary, type ControllerPagination, type ControllerParameterDescription, type ControllerPath, type ControllerQuestion, type ControllerResult, type ControllerSdk, type ControllerSelectPage, type ControllerState, type CoreApiError, CoreCancelledSignal, CoreDisposeError, CoreError, CoreErrorCode, type CoreErrorOptions, type CoreOptions, CoreSignal, type CreateSdkOptions, type DefaultConnectionSchemeInput, type DeprecatedPromptConfigChoice, type DeprecationLogger, type DeprecationWarning, type DispatchHttpRequestInput, type DisposeFn, type DynamicListResolver, type DynamicMember, type DynamicResolver$1 as DynamicResolver, type DynamicSearchResolver, type FieldsResolver, type FormattedItem, type Formatter, type FunctionDeprecation, type FunctionRegistryEntry, HTTP_FETCH_ID, type HookAnnotator, type HookPlugin, type HttpAttemptContext, type HttpFetchInit, type HttpOperationContext, type HttpOperationStart, type HttpPipelineState, type HttpRequest, type HttpRequestInput, type HttpResponse, type InitializeHttpRequestInput, type LeafMeta, type LeafSummary, type LegacyMergePlugin, type LegacyPlugin, type ListItemsResult, type ListPromptConfig, type MethodAnnotator, type MethodAttachment, type MethodHooks, type MethodOverridePlugin, type MethodPlugin, type MethodScope, type Resolver as ModelResolver, type NegatableMetadata, type NormalizeConnectionInput, type NormalizedConnection, type OnMethodEnd, type OnMethodEndContext, type OnMethodStart, type OnMethodStartContext, type OutputDataValidationReport, type OutputFormatter, type OverridableMetaFields, type PaginatedSdkFunction, type PaginatedSdkResult, type Plugin, type PluginMeta, type PluginProvides, type PluginStack, type PluginSummary, type PluginSurface, type PositionalMetadata, type PrepareHttpRequestInput, type PromptConfig, type PromptConfigChoice, type PropertyPlugin, RETRY_HTTP_REQUEST_OPTIONS_ID, type ReceiveHttpResponseInput, type RegistryResult, type RequiredSdkOf, type ResolveConnectionInput, type Resolver$1 as Resolver, type ResolverConfig, type ResolverFieldItem, type ResolverMetadata, type ResolverPromptConfig, type ResolverRequirement, type ResolverType, type ResponseMeta, type RetryHttpRequestOptions, STABILITY_LEVELS, STABILITY_TITLES, type Sdk, type SdkContext, type SdkContextCarrier, type SdkPage, type SendHttpRequest, type StabilityLevel, type StabilityNotice, type StabilityNoticeLogger, type StandInId, type StaticResolver$1 as StaticResolver, type ValidResolvers, addPlugin, applyStabilityLabel, attemptHttpRequestPlugin, authorizeHttpRequestPlugin, canonicalInputSchema, composePlugins, concatLists, concatPaginated, coreOptionsPluginRef, createAsyncContext, createController, createCoreError, createCorePlugin, createDeprecationLogger, createFunction, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createPrefixedCursor, createSdk, createStabilityNoticeLogger, createValidator, dangerousContextPlugin, declareDefault, declareMethod, declareOptionalMethod, declareOptionalProperty, declarePlugin, declareProperty, decodeIncomingCursor, defaultConnectionSchemePlugin, defaultLogDeprecation, defineFormatter, defineHook, defineLegacyMerge, defineMethod, defineMethodOverride, defineOverride, definePlugin, defineProperty, defineResolver, dispatchHttpRequestPlugin, disposeSdk, fetchPlugin, fromFunctionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCurrentDepth, getCurrentScope, getFieldDescriptions, getNegatable, getOutputSchema, getRegistry, getRegistryPlugin, getSchemaDescription, httpFetchPluginRef, initializeHttpRequestPlugin, isCoreCancelledSignal, isCoreError, isCoreSignal, isNestedMethodCall, isPositional, isTelemetryNested, normalizeConnectionPlugin, normalizeStability, objectShapeOf, omitExports, openEnum, paginate, paginateBuffered, paginateMaxItems, prepareHttpRequestPlugin, receiveHttpResponsePlugin, redactHeaders, redactHttpRequest, resolveConnectionPlugin, resolvePlugin, retryHttpRequestOptionsPluginRef, retryHttpRequestPlugin, runInMethodScope, runWithTelemetryContext, selectExports, sendHttpRequestPlugin, splitPrefixedCursor, toIterable, toSnakeCase, toTitleCase, unwrapSchema, validateOptions, withOutputSchema, withPositional, withResolver };
|
package/dist/index.d.ts
CHANGED
|
@@ -4521,7 +4521,7 @@ type SendHttpRequest = (request: HttpRequest) => ReturnType<typeof fetch>;
|
|
|
4521
4521
|
* removes the only boundary below `initializeHttpRequest`, and a retry wrap
|
|
4522
4522
|
* would then re-initialize and mint a fresh `operationId` per attempt.
|
|
4523
4523
|
*/
|
|
4524
|
-
declare const attemptHttpRequestPlugin: MethodPlugin<"attemptHttpRequest", AttemptHttpRequestInput, Promise<Response>, readonly [], AttemptHttpRequestInput> & LeafSummary<"kitcore", "attemptHttpRequest", readonly [MethodPlugin<"prepareHttpRequest", PrepareHttpRequestInput, Promise<HttpRequest>, readonly [], PrepareHttpRequestInput> & LeafSummary<"kitcore", "prepareHttpRequest", readonly []>, MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>, MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly []>, MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>]>;
|
|
4524
|
+
declare const attemptHttpRequestPlugin: MethodPlugin<"attemptHttpRequest", AttemptHttpRequestInput, Promise<Response>, readonly [], AttemptHttpRequestInput> & LeafSummary<"kitcore", "attemptHttpRequest", readonly [MethodPlugin<"prepareHttpRequest", PrepareHttpRequestInput, Promise<HttpRequest>, readonly [], PrepareHttpRequestInput> & LeafSummary<"kitcore", "prepareHttpRequest", readonly []>, MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>, MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly [PropertyPlugin<"httpFetch", typeof fetch | undefined> & PluginSummary<never, never> & StandInId<"kitcore/httpFetch">]>, MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>]>;
|
|
4525
4525
|
|
|
4526
4526
|
/**
|
|
4527
4527
|
* Completes the operation context: normalizes the caller's request and records
|
|
@@ -4594,7 +4594,15 @@ declare const prepareHttpRequestPlugin: MethodPlugin<"prepareHttpRequest", Prepa
|
|
|
4594
4594
|
|
|
4595
4595
|
declare const authorizeHttpRequestPlugin: MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>;
|
|
4596
4596
|
|
|
4597
|
-
declare const
|
|
4597
|
+
declare const HTTP_FETCH_ID = "kitcore/httpFetch";
|
|
4598
|
+
/**
|
|
4599
|
+
* Optional fetch implementation for the default dispatch stage. Keeping it a
|
|
4600
|
+
* property lets an SDK provide a debug wrapper or test double without using the
|
|
4601
|
+
* `dispatchHttpRequest` wrap slot that hosts use to replace dispatch. When
|
|
4602
|
+
* absent, dispatch uses `globalThis.fetch`.
|
|
4603
|
+
*/
|
|
4604
|
+
declare const httpFetchPluginRef: PropertyPlugin<"httpFetch", typeof fetch | undefined> & PluginSummary<never, never> & StandInId<"kitcore/httpFetch">;
|
|
4605
|
+
declare const dispatchHttpRequestPlugin: MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly [PropertyPlugin<"httpFetch", typeof fetch | undefined> & PluginSummary<never, never> & StandInId<"kitcore/httpFetch">]>;
|
|
4598
4606
|
|
|
4599
4607
|
declare const receiveHttpResponsePlugin: MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>;
|
|
4600
4608
|
|
|
@@ -4625,7 +4633,7 @@ declare const receiveHttpResponsePlugin: MethodPlugin<"receiveHttpResponse", Rec
|
|
|
4625
4633
|
* No retry by default: with nothing composed this runs exactly one attempt.
|
|
4626
4634
|
* `retryHttpRequestPlugin` is opt-in.
|
|
4627
4635
|
*/
|
|
4628
|
-
declare const sendHttpRequestPlugin: MethodPlugin<"sendHttpRequest", HttpRequestInput, Promise<Response>, readonly [], HttpRequestInput> & LeafSummary<"kitcore", "sendHttpRequest", readonly [MethodPlugin<"initializeHttpRequest", InitializeHttpRequestInput, Promise<HttpOperationContext>, readonly [], InitializeHttpRequestInput> & LeafSummary<"kitcore", "initializeHttpRequest", readonly []>, MethodPlugin<"attemptHttpRequest", AttemptHttpRequestInput, Promise<Response>, readonly [], AttemptHttpRequestInput> & LeafSummary<"kitcore", "attemptHttpRequest", readonly [MethodPlugin<"prepareHttpRequest", PrepareHttpRequestInput, Promise<HttpRequest>, readonly [], PrepareHttpRequestInput> & LeafSummary<"kitcore", "prepareHttpRequest", readonly []>, MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>, MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly []>, MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>]>]>;
|
|
4636
|
+
declare const sendHttpRequestPlugin: MethodPlugin<"sendHttpRequest", HttpRequestInput, Promise<Response>, readonly [], HttpRequestInput> & LeafSummary<"kitcore", "sendHttpRequest", readonly [MethodPlugin<"initializeHttpRequest", InitializeHttpRequestInput, Promise<HttpOperationContext>, readonly [], InitializeHttpRequestInput> & LeafSummary<"kitcore", "initializeHttpRequest", readonly []>, MethodPlugin<"attemptHttpRequest", AttemptHttpRequestInput, Promise<Response>, readonly [], AttemptHttpRequestInput> & LeafSummary<"kitcore", "attemptHttpRequest", readonly [MethodPlugin<"prepareHttpRequest", PrepareHttpRequestInput, Promise<HttpRequest>, readonly [], PrepareHttpRequestInput> & LeafSummary<"kitcore", "prepareHttpRequest", readonly []>, MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>, MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly [PropertyPlugin<"httpFetch", typeof fetch | undefined> & PluginSummary<never, never> & StandInId<"kitcore/httpFetch">]>, MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>]>]>;
|
|
4629
4637
|
|
|
4630
4638
|
/**
|
|
4631
4639
|
* `fetch` — native `fetch(url, init)` ergonomics over the transport. It
|
|
@@ -4654,7 +4662,7 @@ declare const fetchPlugin: MethodPlugin<"fetch", {
|
|
|
4654
4662
|
}, Promise<Response>, readonly ["url", "init"], {
|
|
4655
4663
|
url: string | URL;
|
|
4656
4664
|
init?: Omit<HttpRequestInput, "url">;
|
|
4657
|
-
}> & LeafSummary<"kitcore", "fetch", readonly [MethodPlugin<"sendHttpRequest", HttpRequestInput, Promise<Response>, readonly [], HttpRequestInput> & LeafSummary<"kitcore", "sendHttpRequest", readonly [MethodPlugin<"initializeHttpRequest", InitializeHttpRequestInput, Promise<HttpOperationContext>, readonly [], InitializeHttpRequestInput> & LeafSummary<"kitcore", "initializeHttpRequest", readonly []>, MethodPlugin<"attemptHttpRequest", AttemptHttpRequestInput, Promise<Response>, readonly [], AttemptHttpRequestInput> & LeafSummary<"kitcore", "attemptHttpRequest", readonly [MethodPlugin<"prepareHttpRequest", PrepareHttpRequestInput, Promise<HttpRequest>, readonly [], PrepareHttpRequestInput> & LeafSummary<"kitcore", "prepareHttpRequest", readonly []>, MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>, MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly []>, MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>]>]>]>;
|
|
4665
|
+
}> & LeafSummary<"kitcore", "fetch", readonly [MethodPlugin<"sendHttpRequest", HttpRequestInput, Promise<Response>, readonly [], HttpRequestInput> & LeafSummary<"kitcore", "sendHttpRequest", readonly [MethodPlugin<"initializeHttpRequest", InitializeHttpRequestInput, Promise<HttpOperationContext>, readonly [], InitializeHttpRequestInput> & LeafSummary<"kitcore", "initializeHttpRequest", readonly []>, MethodPlugin<"attemptHttpRequest", AttemptHttpRequestInput, Promise<Response>, readonly [], AttemptHttpRequestInput> & LeafSummary<"kitcore", "attemptHttpRequest", readonly [MethodPlugin<"prepareHttpRequest", PrepareHttpRequestInput, Promise<HttpRequest>, readonly [], PrepareHttpRequestInput> & LeafSummary<"kitcore", "prepareHttpRequest", readonly []>, MethodPlugin<"authorizeHttpRequest", AuthorizeHttpRequestInput, Promise<HttpRequest>, readonly [], AuthorizeHttpRequestInput> & LeafSummary<"kitcore", "authorizeHttpRequest", readonly []>, MethodPlugin<"dispatchHttpRequest", DispatchHttpRequestInput, Promise<Response>, readonly [], DispatchHttpRequestInput> & LeafSummary<"kitcore", "dispatchHttpRequest", readonly [PropertyPlugin<"httpFetch", typeof fetch | undefined> & PluginSummary<never, never> & StandInId<"kitcore/httpFetch">]>, MethodPlugin<"receiveHttpResponse", ReceiveHttpResponseInput, Promise<Response>, readonly [], ReceiveHttpResponseInput> & LeafSummary<"kitcore", "receiveHttpResponse", readonly []>]>]>]>;
|
|
4658
4666
|
|
|
4659
4667
|
/**
|
|
4660
4668
|
* Headers with every credential value masked, as a plain object a logger can
|
|
@@ -4722,4 +4730,4 @@ declare const normalizeConnectionPlugin: MethodPlugin<"normalizeConnection", Nor
|
|
|
4722
4730
|
*/
|
|
4723
4731
|
declare const resolveConnectionPlugin: MethodPlugin<"resolveConnection", ResolveConnectionInput, string | undefined, readonly [], ResolveConnectionInput> & LeafSummary<"kitcore", "resolveConnection", readonly []>;
|
|
4724
4732
|
|
|
4725
|
-
export { type AdaptError, type AdaptErrorOptions, type AdaptPage, type AggregatePlugin, type Annotations, type ArrayResolver$1 as ArrayResolver, type AsyncContext, type AttemptHttpRequestInput, type AuthorizeHttpRequestInput, type BoundFormatter, type BoundResolver, CONTEXT, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, type CallContext, type CallOrigin, type CategoryDefinition, type ComposedAnnotator, type ConstantResolver$1 as ConstantResolver, type Controller, type ControllerAction, type ControllerAffordance, type ControllerAnswerFn, type ControllerChoice, type ControllerError, type ControllerIssue, type ControllerListingPage, type ControllerListingPosition, type ControllerMethodDescription, type ControllerMethodSummary, type ControllerPagination, type ControllerParameterDescription, type ControllerPath, type ControllerQuestion, type ControllerResult, type ControllerSdk, type ControllerSelectPage, type ControllerState, type CoreApiError, CoreCancelledSignal, CoreDisposeError, CoreError, CoreErrorCode, type CoreErrorOptions, type CoreOptions, CoreSignal, type CreateSdkOptions, type DefaultConnectionSchemeInput, type DeprecatedPromptConfigChoice, type DeprecationLogger, type DeprecationWarning, type DispatchHttpRequestInput, type DisposeFn, type DynamicListResolver, type DynamicMember, type DynamicResolver$1 as DynamicResolver, type DynamicSearchResolver, type FieldsResolver, type FormattedItem, type Formatter, type FunctionDeprecation, type FunctionRegistryEntry, type HookAnnotator, type HookPlugin, type HttpAttemptContext, type HttpFetchInit, type HttpOperationContext, type HttpOperationStart, type HttpPipelineState, type HttpRequest, type HttpRequestInput, type HttpResponse, type InitializeHttpRequestInput, type LeafMeta, type LeafSummary, type LegacyMergePlugin, type LegacyPlugin, type ListItemsResult, type ListPromptConfig, type MethodAnnotator, type MethodAttachment, type MethodHooks, type MethodOverridePlugin, type MethodPlugin, type MethodScope, type Resolver as ModelResolver, type NegatableMetadata, type NormalizeConnectionInput, type NormalizedConnection, type OnMethodEnd, type OnMethodEndContext, type OnMethodStart, type OnMethodStartContext, type OutputDataValidationReport, type OutputFormatter, type OverridableMetaFields, type PaginatedSdkFunction, type PaginatedSdkResult, type Plugin, type PluginMeta, type PluginProvides, type PluginStack, type PluginSummary, type PluginSurface, type PositionalMetadata, type PrepareHttpRequestInput, type PromptConfig, type PromptConfigChoice, type PropertyPlugin, RETRY_HTTP_REQUEST_OPTIONS_ID, type ReceiveHttpResponseInput, type RegistryResult, type RequiredSdkOf, type ResolveConnectionInput, type Resolver$1 as Resolver, type ResolverConfig, type ResolverFieldItem, type ResolverMetadata, type ResolverPromptConfig, type ResolverRequirement, type ResolverType, type ResponseMeta, type RetryHttpRequestOptions, STABILITY_LEVELS, STABILITY_TITLES, type Sdk, type SdkContext, type SdkContextCarrier, type SdkPage, type SendHttpRequest, type StabilityLevel, type StabilityNotice, type StabilityNoticeLogger, type StandInId, type StaticResolver$1 as StaticResolver, type ValidResolvers, addPlugin, applyStabilityLabel, attemptHttpRequestPlugin, authorizeHttpRequestPlugin, canonicalInputSchema, composePlugins, concatLists, concatPaginated, coreOptionsPluginRef, createAsyncContext, createController, createCoreError, createCorePlugin, createDeprecationLogger, createFunction, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createPrefixedCursor, createSdk, createStabilityNoticeLogger, createValidator, dangerousContextPlugin, declareDefault, declareMethod, declareOptionalMethod, declareOptionalProperty, declarePlugin, declareProperty, decodeIncomingCursor, defaultConnectionSchemePlugin, defaultLogDeprecation, defineFormatter, defineHook, defineLegacyMerge, defineMethod, defineMethodOverride, defineOverride, definePlugin, defineProperty, defineResolver, dispatchHttpRequestPlugin, disposeSdk, fetchPlugin, fromFunctionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCurrentDepth, getCurrentScope, getFieldDescriptions, getNegatable, getOutputSchema, getRegistry, getRegistryPlugin, getSchemaDescription, initializeHttpRequestPlugin, isCoreCancelledSignal, isCoreError, isCoreSignal, isNestedMethodCall, isPositional, isTelemetryNested, normalizeConnectionPlugin, normalizeStability, objectShapeOf, omitExports, openEnum, paginate, paginateBuffered, paginateMaxItems, prepareHttpRequestPlugin, receiveHttpResponsePlugin, redactHeaders, redactHttpRequest, resolveConnectionPlugin, resolvePlugin, retryHttpRequestOptionsPluginRef, retryHttpRequestPlugin, runInMethodScope, runWithTelemetryContext, selectExports, sendHttpRequestPlugin, splitPrefixedCursor, toIterable, toSnakeCase, toTitleCase, unwrapSchema, validateOptions, withOutputSchema, withPositional, withResolver };
|
|
4733
|
+
export { type AdaptError, type AdaptErrorOptions, type AdaptPage, type AggregatePlugin, type Annotations, type ArrayResolver$1 as ArrayResolver, type AsyncContext, type AttemptHttpRequestInput, type AuthorizeHttpRequestInput, type BoundFormatter, type BoundResolver, CONTEXT, CORE_ERROR_SYMBOL, CORE_OPTIONS_ID, CORE_SIGNAL_SYMBOL, type CallContext, type CallOrigin, type CategoryDefinition, type ComposedAnnotator, type ConstantResolver$1 as ConstantResolver, type Controller, type ControllerAction, type ControllerAffordance, type ControllerAnswerFn, type ControllerChoice, type ControllerError, type ControllerIssue, type ControllerListingPage, type ControllerListingPosition, type ControllerMethodDescription, type ControllerMethodSummary, type ControllerPagination, type ControllerParameterDescription, type ControllerPath, type ControllerQuestion, type ControllerResult, type ControllerSdk, type ControllerSelectPage, type ControllerState, type CoreApiError, CoreCancelledSignal, CoreDisposeError, CoreError, CoreErrorCode, type CoreErrorOptions, type CoreOptions, CoreSignal, type CreateSdkOptions, type DefaultConnectionSchemeInput, type DeprecatedPromptConfigChoice, type DeprecationLogger, type DeprecationWarning, type DispatchHttpRequestInput, type DisposeFn, type DynamicListResolver, type DynamicMember, type DynamicResolver$1 as DynamicResolver, type DynamicSearchResolver, type FieldsResolver, type FormattedItem, type Formatter, type FunctionDeprecation, type FunctionRegistryEntry, HTTP_FETCH_ID, type HookAnnotator, type HookPlugin, type HttpAttemptContext, type HttpFetchInit, type HttpOperationContext, type HttpOperationStart, type HttpPipelineState, type HttpRequest, type HttpRequestInput, type HttpResponse, type InitializeHttpRequestInput, type LeafMeta, type LeafSummary, type LegacyMergePlugin, type LegacyPlugin, type ListItemsResult, type ListPromptConfig, type MethodAnnotator, type MethodAttachment, type MethodHooks, type MethodOverridePlugin, type MethodPlugin, type MethodScope, type Resolver as ModelResolver, type NegatableMetadata, type NormalizeConnectionInput, type NormalizedConnection, type OnMethodEnd, type OnMethodEndContext, type OnMethodStart, type OnMethodStartContext, type OutputDataValidationReport, type OutputFormatter, type OverridableMetaFields, type PaginatedSdkFunction, type PaginatedSdkResult, type Plugin, type PluginMeta, type PluginProvides, type PluginStack, type PluginSummary, type PluginSurface, type PositionalMetadata, type PrepareHttpRequestInput, type PromptConfig, type PromptConfigChoice, type PropertyPlugin, RETRY_HTTP_REQUEST_OPTIONS_ID, type ReceiveHttpResponseInput, type RegistryResult, type RequiredSdkOf, type ResolveConnectionInput, type Resolver$1 as Resolver, type ResolverConfig, type ResolverFieldItem, type ResolverMetadata, type ResolverPromptConfig, type ResolverRequirement, type ResolverType, type ResponseMeta, type RetryHttpRequestOptions, STABILITY_LEVELS, STABILITY_TITLES, type Sdk, type SdkContext, type SdkContextCarrier, type SdkPage, type SendHttpRequest, type StabilityLevel, type StabilityNotice, type StabilityNoticeLogger, type StandInId, type StaticResolver$1 as StaticResolver, type ValidResolvers, addPlugin, applyStabilityLabel, attemptHttpRequestPlugin, authorizeHttpRequestPlugin, canonicalInputSchema, composePlugins, concatLists, concatPaginated, coreOptionsPluginRef, createAsyncContext, createController, createCoreError, createCorePlugin, createDeprecationLogger, createFunction, createPaginatedFunction, createPaginatedPluginMethod, createPluginMethod, createPluginStack, createPrefixedCursor, createSdk, createStabilityNoticeLogger, createValidator, dangerousContextPlugin, declareDefault, declareMethod, declareOptionalMethod, declareOptionalProperty, declarePlugin, declareProperty, decodeIncomingCursor, defaultConnectionSchemePlugin, defaultLogDeprecation, defineFormatter, defineHook, defineLegacyMerge, defineMethod, defineMethodOverride, defineOverride, definePlugin, defineProperty, defineResolver, dispatchHttpRequestPlugin, disposeSdk, fetchPlugin, fromFunctionPlugin, getContext, getCoreErrorCause, getCoreErrorCode, getCurrentDepth, getCurrentScope, getFieldDescriptions, getNegatable, getOutputSchema, getRegistry, getRegistryPlugin, getSchemaDescription, httpFetchPluginRef, initializeHttpRequestPlugin, isCoreCancelledSignal, isCoreError, isCoreSignal, isNestedMethodCall, isPositional, isTelemetryNested, normalizeConnectionPlugin, normalizeStability, objectShapeOf, omitExports, openEnum, paginate, paginateBuffered, paginateMaxItems, prepareHttpRequestPlugin, receiveHttpResponsePlugin, redactHeaders, redactHttpRequest, resolveConnectionPlugin, resolvePlugin, retryHttpRequestOptionsPluginRef, retryHttpRequestPlugin, runInMethodScope, runWithTelemetryContext, selectExports, sendHttpRequestPlugin, splitPrefixedCursor, toIterable, toSnakeCase, toTitleCase, unwrapSchema, validateOptions, withOutputSchema, withPositional, withResolver };
|
package/dist/index.mjs
CHANGED
|
@@ -4816,6 +4816,8 @@ var authorizeHttpRequestPlugin = defineMethod({
|
|
|
4816
4816
|
|
|
4817
4817
|
// src/transport/dispatch-http-request.ts
|
|
4818
4818
|
import { z as z7 } from "zod";
|
|
4819
|
+
var HTTP_FETCH_ID = "kitcore/httpFetch";
|
|
4820
|
+
var httpFetchPluginRef = declareOptionalProperty({ id: HTTP_FETCH_ID });
|
|
4819
4821
|
function toFetchInput(request) {
|
|
4820
4822
|
const init = { ...request };
|
|
4821
4823
|
const { url } = request;
|
|
@@ -4826,11 +4828,12 @@ function toFetchInput(request) {
|
|
|
4826
4828
|
var dispatchHttpRequestPlugin = defineMethod({
|
|
4827
4829
|
name: "dispatchHttpRequest",
|
|
4828
4830
|
namespace: "kitcore",
|
|
4831
|
+
imports: [httpFetchPluginRef],
|
|
4829
4832
|
inputSchema: z7.custom(),
|
|
4830
4833
|
skipInputValidation: true,
|
|
4831
|
-
run: async ({ input }) => {
|
|
4834
|
+
run: async ({ input, imports }) => {
|
|
4832
4835
|
const { url, init } = toFetchInput(input.request);
|
|
4833
|
-
return fetch(url, init);
|
|
4836
|
+
return (imports.httpFetch ?? fetch)(url, init);
|
|
4834
4837
|
}
|
|
4835
4838
|
});
|
|
4836
4839
|
|
|
@@ -4930,6 +4933,7 @@ var DEFAULT_IDEMPOTENT_METHODS = [
|
|
|
4930
4933
|
];
|
|
4931
4934
|
var BASE_BACKOFF_MILLISECONDS = 1e3;
|
|
4932
4935
|
var JITTER_FACTOR = 0.5;
|
|
4936
|
+
var EPOCH_THRESHOLD_SECONDS = 1e9;
|
|
4933
4937
|
function directedDelayMilliseconds(response) {
|
|
4934
4938
|
const retryAfter = response.headers.get("retry-after");
|
|
4935
4939
|
if (retryAfter) {
|
|
@@ -4938,11 +4942,12 @@ function directedDelayMilliseconds(response) {
|
|
|
4938
4942
|
const date = Date.parse(retryAfter);
|
|
4939
4943
|
if (!Number.isNaN(date)) return Math.max(0, date - Date.now());
|
|
4940
4944
|
}
|
|
4945
|
+
if (response.status !== 429) return void 0;
|
|
4941
4946
|
const reset = response.headers.get("x-ratelimit-reset");
|
|
4942
4947
|
if (reset) {
|
|
4943
|
-
const
|
|
4944
|
-
if (!Number.isNaN(
|
|
4945
|
-
return Math.max(0,
|
|
4948
|
+
const resetValue = Number.parseInt(reset, 10);
|
|
4949
|
+
if (!Number.isNaN(resetValue)) {
|
|
4950
|
+
return resetValue >= EPOCH_THRESHOLD_SECONDS ? Math.max(0, resetValue * 1e3 - Date.now()) : Math.max(0, resetValue * 1e3);
|
|
4946
4951
|
}
|
|
4947
4952
|
}
|
|
4948
4953
|
return void 0;
|
|
@@ -5180,6 +5185,7 @@ export {
|
|
|
5180
5185
|
CoreError,
|
|
5181
5186
|
CoreErrorCode,
|
|
5182
5187
|
CoreSignal,
|
|
5188
|
+
HTTP_FETCH_ID,
|
|
5183
5189
|
RETRY_HTTP_REQUEST_OPTIONS_ID,
|
|
5184
5190
|
STABILITY_LEVELS,
|
|
5185
5191
|
STABILITY_TITLES,
|
|
@@ -5240,6 +5246,7 @@ export {
|
|
|
5240
5246
|
getRegistry,
|
|
5241
5247
|
getRegistryPlugin,
|
|
5242
5248
|
getSchemaDescription,
|
|
5249
|
+
httpFetchPluginRef,
|
|
5243
5250
|
initializeHttpRequestPlugin,
|
|
5244
5251
|
isCoreCancelledSignal,
|
|
5245
5252
|
isCoreError,
|