Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@urql/exchange-persisted

Package Overview
Dependencies
Maintainers
6
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@urql/exchange-persisted - npm Package Compare versions

Comparing version 0.0.0-canary-20230320071346 to 0.0.0-canary-20230320071349

11

CHANGELOG.md
# @urql/exchange-persisted-fetch
## 0.0.0-canary-20230320071346
## 0.0.0-canary-20230320071349

@@ -12,7 +12,2 @@ ### Major Changes

### Minor Changes
- Update exchanges to drop redundant `share` calls, since `@urql/core`’s `composeExchanges` utility now automatically does so for us
Submitted by [@kitten](https://github.com/kitten) (See [#3082](https://github.com/urql-graphql/urql/pull/3082))
### Patch Changes

@@ -24,4 +19,4 @@

Submitted by [@kitten](https://github.com/kitten) (See [#3072](https://github.com/urql-graphql/urql/pull/3072))
- Updated dependencies (See [#3033](https://github.com/urql-graphql/urql/pull/3033), [#3054](https://github.com/urql-graphql/urql/pull/3054), [#3053](https://github.com/urql-graphql/urql/pull/3053), [#3060](https://github.com/urql-graphql/urql/pull/3060), [#3039](https://github.com/urql-graphql/urql/pull/3039), [#3082](https://github.com/urql-graphql/urql/pull/3082), [#3061](https://github.com/urql-graphql/urql/pull/3061), [#3055](https://github.com/urql-graphql/urql/pull/3055), [#3085](https://github.com/urql-graphql/urql/pull/3085), [#3079](https://github.com/urql-graphql/urql/pull/3079), [#3059](https://github.com/urql-graphql/urql/pull/3059), [#3055](https://github.com/urql-graphql/urql/pull/3055), [#3057](https://github.com/urql-graphql/urql/pull/3057), [#3050](https://github.com/urql-graphql/urql/pull/3050), [#3062](https://github.com/urql-graphql/urql/pull/3062), [#3051](https://github.com/urql-graphql/urql/pull/3051), [#3043](https://github.com/urql-graphql/urql/pull/3043), [#3063](https://github.com/urql-graphql/urql/pull/3063), [#3054](https://github.com/urql-graphql/urql/pull/3054), [#3058](https://github.com/urql-graphql/urql/pull/3058), and [#3062](https://github.com/urql-graphql/urql/pull/3062))
- @urql/core@0.0.0-canary-20230320071346
- Updated dependencies (See [#3033](https://github.com/urql-graphql/urql/pull/3033), [#3054](https://github.com/urql-graphql/urql/pull/3054), [#3053](https://github.com/urql-graphql/urql/pull/3053), [#3060](https://github.com/urql-graphql/urql/pull/3060), [#3039](https://github.com/urql-graphql/urql/pull/3039), [#3061](https://github.com/urql-graphql/urql/pull/3061), [#3055](https://github.com/urql-graphql/urql/pull/3055), [#3085](https://github.com/urql-graphql/urql/pull/3085), [#3079](https://github.com/urql-graphql/urql/pull/3079), [#3059](https://github.com/urql-graphql/urql/pull/3059), [#3055](https://github.com/urql-graphql/urql/pull/3055), [#3057](https://github.com/urql-graphql/urql/pull/3057), [#3050](https://github.com/urql-graphql/urql/pull/3050), [#3062](https://github.com/urql-graphql/urql/pull/3062), [#3051](https://github.com/urql-graphql/urql/pull/3051), [#3043](https://github.com/urql-graphql/urql/pull/3043), [#3063](https://github.com/urql-graphql/urql/pull/3063), [#3054](https://github.com/urql-graphql/urql/pull/3054), [#3058](https://github.com/urql-graphql/urql/pull/3058), and [#3062](https://github.com/urql-graphql/urql/pull/3062))
- @urql/core@0.0.0-canary-20230320071349

@@ -28,0 +23,0 @@ ## 2.1.0

@@ -85,3 +85,4 @@ Object.defineProperty(exports, '__esModule', {

var retries = wonka.makeSubject();
var forwardedOps$ = wonka.filter(operation => !operationFilter(operation))(operations$);
var sharedOps$ = wonka.share(operations$);
var forwardedOps$ = wonka.filter(operation => !operationFilter(operation))(sharedOps$);
var persistedOps$ = wonka.mergeMap(wonka.fromPromise)(wonka.map(async operation => {

@@ -106,3 +107,3 @@ var persistedOperation = core.makeOperation(operation.kind, operation, {

return persistedOperation;
})(wonka.filter(operationFilter)(operations$)));
})(wonka.filter(operationFilter)(sharedOps$)));
return wonka.filter(result => !!result)(wonka.map(result => {

@@ -109,0 +110,0 @@ if (!enforcePersistedQueries && result.operation.extensions && result.operation.extensions.persistedQuery) {

@@ -1,2 +0,2 @@

Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("wonka"),t=require("@urql/core"),n="undefined"!=typeof window?window.crypto:"undefined"!=typeof self?self.crypto:null,s=async r=>{if(n&&n.subtle){var t=await n.subtle.digest({name:"SHA-256"},(new TextEncoder).encode(r));return new Uint8Array(t).reduce(((e,r)=>e+r.toString(16).padStart(2,"0")),"")}return await(async()=>{if(!e)try{e=new Function("require",'return require("crypto")')(require)}catch(r){try{e=new Function('return import("crypto")')()}catch(e){}}return e})()?(await e).createHash("sha256").update(r).digest("hex"):""};exports.persistedExchange=e=>({forward:n})=>{e||(e={});var i=!!e.preferGetForPersistedQueries,o=!!e.enforcePersistedQueries,a=e.generateHash||s,u=!!e.enableForMutation,p=!0,d=e=>p&&!e.context.persistAttempt&&(u&&"mutation"===e.kind||"query"===e.kind);return e=>{var s=r.makeSubject(),u=r.filter((e=>!d(e)))(e),c=r.mergeMap(r.fromPromise)(r.map((async e=>{var r=t.makeOperation(e.kind,e,{...e.context,persistAttempt:!0}),n=await a(t.stringifyDocument(e.query),e.query);return n&&(r.extensions={...r.extensions,persistedQuery:{version:1,sha256Hash:n}},"query"===r.kind&&i&&(r.context.preferGetMethod="force")),r}))(r.filter(d)(e)));return r.filter((e=>!!e))(r.map((e=>{if(!o&&e.operation.extensions&&e.operation.extensions.persistedQuery){if(e.error&&e.error.graphQLErrors.some((e=>"PersistedQueryNotSupported"===e.message))){p=!1;var r=t.makeOperation(e.operation.kind,e.operation);return r.extensions&&delete r.extensions.persistedQuery,s.next(r),null}if(e.error&&e.error.graphQLErrors.some((e=>"PersistedQueryNotFound"===e.message))){var n=t.makeOperation(e.operation.kind,e.operation);return n.extensions={...n.extensions,persistedQuery:{...(n.extensions||{}).persistedQuery,miss:!0}},s.next(n),null}}return e}))(n(r.merge([c,u,s.source]))))}};
Object.defineProperty(exports,"__esModule",{value:!0});var e,r=require("wonka"),t=require("@urql/core"),n="undefined"!=typeof window?window.crypto:"undefined"!=typeof self?self.crypto:null,s=async r=>{if(n&&n.subtle){var t=await n.subtle.digest({name:"SHA-256"},(new TextEncoder).encode(r));return new Uint8Array(t).reduce(((e,r)=>e+r.toString(16).padStart(2,"0")),"")}return await(async()=>{if(!e)try{e=new Function("require",'return require("crypto")')(require)}catch(r){try{e=new Function('return import("crypto")')()}catch(e){}}return e})()?(await e).createHash("sha256").update(r).digest("hex"):""};exports.persistedExchange=e=>({forward:n})=>{e||(e={});var i=!!e.preferGetForPersistedQueries,o=!!e.enforcePersistedQueries,a=e.generateHash||s,u=!!e.enableForMutation,p=!0,d=e=>p&&!e.context.persistAttempt&&(u&&"mutation"===e.kind||"query"===e.kind);return e=>{var s=r.makeSubject(),u=r.share(e),c=r.filter((e=>!d(e)))(u),y=r.mergeMap(r.fromPromise)(r.map((async e=>{var r=t.makeOperation(e.kind,e,{...e.context,persistAttempt:!0}),n=await a(t.stringifyDocument(e.query),e.query);return n&&(r.extensions={...r.extensions,persistedQuery:{version:1,sha256Hash:n}},"query"===r.kind&&i&&(r.context.preferGetMethod="force")),r}))(r.filter(d)(u)));return r.filter((e=>!!e))(r.map((e=>{if(!o&&e.operation.extensions&&e.operation.extensions.persistedQuery){if(e.error&&e.error.graphQLErrors.some((e=>"PersistedQueryNotSupported"===e.message))){p=!1;var r=t.makeOperation(e.operation.kind,e.operation);return r.extensions&&delete r.extensions.persistedQuery,s.next(r),null}if(e.error&&e.error.graphQLErrors.some((e=>"PersistedQueryNotFound"===e.message))){var n=t.makeOperation(e.operation.kind,e.operation);return n.extensions={...n.extensions,persistedQuery:{...(n.extensions||{}).persistedQuery,miss:!0}},s.next(n),null}}return e}))(n(r.merge([y,c,s.source]))))}};
//# sourceMappingURL=urql-exchange-persisted.min.js.map
{
"name": "@urql/exchange-persisted",
"version": "0.0.0-canary-20230320071346",
"version": "0.0.0-canary-20230320071349",
"description": "An exchange that allows for persisted queries support when fetching queries",

@@ -40,3 +40,3 @@ "sideEffects": false,

"dependencies": {
"@urql/core": "0.0.0-canary-20230320071346",
"@urql/core": "0.0.0-canary-20230320071349",
"wonka": "^6.0.0"

@@ -49,3 +49,3 @@ },

"graphql": "^16.0.0",
"@urql/core": "0.0.0-canary-20230320071346"
"@urql/core": "0.0.0-canary-20230320071349"
},

@@ -52,0 +52,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc