@apifuse/provider-sdk 2.2.0-beta.28 → 2.2.0-beta.29
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 +4 -0
- package/bin/apifuse-dev.ts +32 -3
- package/bin/apifuse-pack-types.ts +24 -1
- package/bin/apifuse-record.ts +39 -6
- package/dist/auth.d.ts +14 -0
- package/dist/auth.js +38 -0
- package/dist/config/loader.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime/browser.js +45 -2
- package/dist/runtime/proxy-telemetry.js +3 -0
- package/dist/runtime/resolver-public.d.ts +1 -0
- package/dist/runtime/resolver-public.js +1 -0
- package/dist/runtime/resolver-vendors/browser.js +14 -4
- package/dist/runtime/resolver-vendors/twocaptcha.js +84 -17
- package/dist/runtime/resolver-vendors/types.d.ts +2 -2
- package/dist/runtime/resolver-vendors/types.js +3 -1
- package/dist/runtime/resolver.d.ts +12 -3
- package/dist/runtime/resolver.js +80 -12
- package/dist/runtime/stealth.d.ts +1 -0
- package/dist/runtime/stealth.js +1 -1
- package/dist/server/serve-implementation.js +20 -2
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.js +1 -0
- package/package.json +4 -4
- package/src/auth.ts +78 -0
- package/src/config/loader.ts +3 -0
- package/src/index.ts +0 -1
- package/src/runtime/browser.ts +50 -2
- package/src/runtime/proxy-telemetry.ts +5 -0
- package/src/runtime/resolver-public.ts +18 -0
- package/src/runtime/resolver-vendors/browser.ts +14 -4
- package/src/runtime/resolver-vendors/twocaptcha.ts +102 -19
- package/src/runtime/resolver-vendors/types.ts +7 -2
- package/src/runtime/resolver.ts +104 -17
- package/src/runtime/stealth.ts +1 -1
- package/src/server/serve-implementation.ts +20 -2
- package/src/testing/index.ts +1 -0
|
@@ -594,6 +594,7 @@ function createProviderContext(
|
|
|
594
594
|
const baseUrl = getProviderBaseUrl(provider);
|
|
595
595
|
const stealthBaseUrl = getProviderStealthBaseUrl(provider);
|
|
596
596
|
const stealthProfile = getProviderStealthProfile(provider);
|
|
597
|
+
const proxyPolicy = resolveNativeProxyPolicy(provider);
|
|
597
598
|
const proxyClientOptions = {
|
|
598
599
|
upstream: { proxy: provider.proxy },
|
|
599
600
|
affinityKey: resolveProviderProxyAffinityKey(provider, request, operationId),
|
|
@@ -704,7 +705,15 @@ function createProviderContext(
|
|
|
704
705
|
allowedHosts: provider.allowedHosts,
|
|
705
706
|
cache,
|
|
706
707
|
identityScope: resolverIdentityScope,
|
|
707
|
-
|
|
708
|
+
...(proxyPolicy
|
|
709
|
+
? {
|
|
710
|
+
proxyIntent: {
|
|
711
|
+
mode: proxyPolicy.mode,
|
|
712
|
+
...proxyClientOptions,
|
|
713
|
+
...(stealthProfile ? { userAgent: stealthProfile.userAgent } : {}),
|
|
714
|
+
},
|
|
715
|
+
}
|
|
716
|
+
: {}),
|
|
708
717
|
}),
|
|
709
718
|
signal,
|
|
710
719
|
)
|
|
@@ -773,6 +782,7 @@ function createAuthFlowContext(
|
|
|
773
782
|
const baseUrl = getProviderBaseUrl(provider);
|
|
774
783
|
const stealthBaseUrl = getProviderStealthBaseUrl(provider);
|
|
775
784
|
const stealthProfile = getProviderStealthProfile(provider);
|
|
785
|
+
const proxyPolicy = resolveNativeProxyPolicy(provider);
|
|
776
786
|
const contextData = request.context ?? {};
|
|
777
787
|
const flowContextStore = createFlowContextStore(
|
|
778
788
|
provider.context?.keys ?? Object.keys(contextData),
|
|
@@ -875,7 +885,15 @@ function createAuthFlowContext(
|
|
|
875
885
|
allowedHosts: provider.allowedHosts,
|
|
876
886
|
cache,
|
|
877
887
|
identityScope: resolverIdentityScope,
|
|
878
|
-
|
|
888
|
+
...(proxyPolicy
|
|
889
|
+
? {
|
|
890
|
+
proxyIntent: {
|
|
891
|
+
mode: proxyPolicy.mode,
|
|
892
|
+
...proxyClientOptions,
|
|
893
|
+
...(stealthProfile ? { userAgent: stealthProfile.userAgent } : {}),
|
|
894
|
+
},
|
|
895
|
+
}
|
|
896
|
+
: {}),
|
|
879
897
|
}),
|
|
880
898
|
signal,
|
|
881
899
|
)
|