diff --git a/.changeset/pre.json b/.changeset/pre.json index 92a4e328c..17708f11b 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -1,5 +1,5 @@ { - "mode": "pre", + "mode": "exit", "tag": "typescript", "initialVersions": { "@onflow/config": "1.1.2", diff --git a/packages/config/CHANGELOG.md b/packages/config/CHANGELOG.md index ad8d825cc..b15da29f7 100644 --- a/packages/config/CHANGELOG.md +++ b/packages/config/CHANGELOG.md @@ -1,20 +1,5 @@ # @onflow/config -## 1.2.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`6b81c1ff`](https://github.com/onflow/fcl-js/commit/6b81c1ffc54ed1c073d0b6581df5fb34d7a33ec5) Thanks [@nialexsan](https://github.com/nialexsan)! - Add Typescript to @onflow/config - -### Patch Changes - -- Updated dependencies [[`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b), [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2), [`0960cdce`](https://github.com/onflow/fcl-js/commit/0960cdce6808b265ef92791da06a6772e9353537)]: - - @onflow/util-invariant@1.2.0-typescript.0 - - @onflow/util-logger@1.3.0-typescript.0 - - @onflow/util-actor@1.3.0-typescript.0 - ## 1.1.2 ### Patch Changes diff --git a/packages/fcl-bundle/CHANGELOG.md b/packages/fcl-bundle/CHANGELOG.md index 301c92ac5..b182bc8e7 100644 --- a/packages/fcl-bundle/CHANGELOG.md +++ b/packages/fcl-bundle/CHANGELOG.md @@ -1,13 +1,5 @@ # @onflow/fcl-bundle -## 1.4.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b) Thanks [@nialexsan](https://github.com/nialexsan)! - Switched to rollup-plugin-typescript2 - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - ## 1.3.1 ### Patch Changes diff --git a/packages/fcl-wc/CHANGELOG.md b/packages/fcl-wc/CHANGELOG.md index 5c7527319..612d3c282 100644 --- a/packages/fcl-wc/CHANGELOG.md +++ b/packages/fcl-wc/CHANGELOG.md @@ -1,19 +1,5 @@ # @onflow/fcl-wc -## 5.0.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - -### Patch Changes - -- Updated dependencies [[`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b), [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2), [`6b81c1ff`](https://github.com/onflow/fcl-js/commit/6b81c1ffc54ed1c073d0b6581df5fb34d7a33ec5)]: - - @onflow/util-invariant@1.2.0-typescript.0 - - @onflow/util-logger@1.3.0-typescript.0 - - @onflow/config@1.2.0-typescript.0 - - @onflow/fcl@1.8.0-typescript.0 - ## 4.0.0 ### Patch Changes diff --git a/packages/fcl/CHANGELOG.md b/packages/fcl/CHANGELOG.md index 1f080e91c..503389d36 100644 --- a/packages/fcl/CHANGELOG.md +++ b/packages/fcl/CHANGELOG.md @@ -1,25 +1,5 @@ # @onflow/fcl -## 1.8.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - -### Patch Changes - -- Updated dependencies [[`81d4b40e`](https://github.com/onflow/fcl-js/commit/81d4b40e5b76ffb85b6185a274ae1cbce5988e7b), [`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b), [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2), [`6b81c1ff`](https://github.com/onflow/fcl-js/commit/6b81c1ffc54ed1c073d0b6581df5fb34d7a33ec5), [`0960cdce`](https://github.com/onflow/fcl-js/commit/0960cdce6808b265ef92791da06a6772e9353537)]: - - @onflow/types@1.2.0-typescript.0 - - @onflow/util-invariant@1.2.0-typescript.0 - - @onflow/util-template@1.2.0-typescript.0 - - @onflow/util-address@1.2.0-typescript.0 - - @onflow/util-logger@1.3.0-typescript.0 - - @onflow/util-uid@1.2.0-typescript.0 - - @onflow/rlp@1.2.0-typescript.0 - - @onflow/util-actor@1.3.0-typescript.0 - - @onflow/config@1.2.0-typescript.0 - - @onflow/sdk@1.3.0-typescript.0 - ## 1.7.0 ### Minor Changes diff --git a/packages/rlp/CHANGELOG.md b/packages/rlp/CHANGELOG.md index 99b31e860..7b291c04e 100644 --- a/packages/rlp/CHANGELOG.md +++ b/packages/rlp/CHANGELOG.md @@ -1,13 +1,5 @@ # @onflow/rlp -## 1.2.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b) Thanks [@nialexsan](https://github.com/nialexsan)! - Convert to Typescript - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - ## 1.1.0 ### Minor Changes diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md index f9aecf820..0a81749b7 100644 --- a/packages/sdk/CHANGELOG.md +++ b/packages/sdk/CHANGELOG.md @@ -1,23 +1,5 @@ # @onflow/sdk -## 1.3.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - -### Patch Changes - -- Updated dependencies [[`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b), [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2), [`6b81c1ff`](https://github.com/onflow/fcl-js/commit/6b81c1ffc54ed1c073d0b6581df5fb34d7a33ec5), [`0960cdce`](https://github.com/onflow/fcl-js/commit/0960cdce6808b265ef92791da06a6772e9353537)]: - - @onflow/util-invariant@1.2.0-typescript.0 - - @onflow/util-template@1.2.0-typescript.0 - - @onflow/util-address@1.2.0-typescript.0 - - @onflow/util-logger@1.3.0-typescript.0 - - @onflow/rlp@1.2.0-typescript.0 - - @onflow/transport-http@1.8.0-typescript.0 - - @onflow/util-actor@1.3.0-typescript.0 - - @onflow/config@1.2.0-typescript.0 - ## 1.2.3 ### Patch Changes diff --git a/packages/sdk/src/build/build-payer.js b/packages/sdk/src/build/build-payer.js index 7e27fa817..e791af322 100644 --- a/packages/sdk/src/build/build-payer.js +++ b/packages/sdk/src/build/build-payer.js @@ -1,4 +1,4 @@ -import {pipe, prepAccount, PAYER} from "../interaction/interaction.js" +import {pipe, prepAccount, PAYER} from "../interaction/interaction" export function payer(ax = []) { if (!Array.isArray(ax)) ax = [ax] diff --git a/packages/sdk/src/test-utils/authz-fn.ts b/packages/sdk/src/test-utils/authz-fn.ts index 175c8acfe..79b5af1a2 100644 --- a/packages/sdk/src/test-utils/authz-fn.ts +++ b/packages/sdk/src/test-utils/authz-fn.ts @@ -61,7 +61,7 @@ interface IAuthzResolveMany { } export function authzResolveMany(opts: IAuthzResolveMany = {authorizations: []}) { - return function (account: IAcct) { + return function (account: IAcct): IAcct { const tempId = opts.tempId || "AUTHZ_RESOLVE_MANY" return { ...account, @@ -79,8 +79,8 @@ export function authzResolveMany(opts: IAuthzResolveMany = {authorizations: []}) } } -export function authzDeepResolveMany(opts = {}, depth = 1) { - return function (account) { +export function authzDeepResolveMany(opts: IAuthzResolveMany = {authorizations: []}, depth = 1) { + return function (account: IAcct): IAcct { const tempId = opts.tempId || "AUTHZ_DEEP_RESOLVE_MANY" return { ...account, diff --git a/packages/transport-grpc/CHANGELOG.md b/packages/transport-grpc/CHANGELOG.md index 60b4edf4b..b9aedc552 100644 --- a/packages/transport-grpc/CHANGELOG.md +++ b/packages/transport-grpc/CHANGELOG.md @@ -1,19 +1,5 @@ # @onflow/transport-grpc -## 1.3.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - -### Patch Changes - -- Updated dependencies [[`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b), [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2)]: - - @onflow/util-invariant@1.2.0-typescript.0 - - @onflow/util-template@1.2.0-typescript.0 - - @onflow/util-address@1.2.0-typescript.0 - - @onflow/rlp@1.2.0-typescript.0 - ## 1.2.2 ### Patch Changes diff --git a/packages/transport-http/CHANGELOG.md b/packages/transport-http/CHANGELOG.md index df89ead5e..d21ec051f 100644 --- a/packages/transport-http/CHANGELOG.md +++ b/packages/transport-http/CHANGELOG.md @@ -1,19 +1,5 @@ # @onflow/transport-http -## 1.8.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - -### Patch Changes - -- Updated dependencies [[`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b), [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2)]: - - @onflow/util-invariant@1.2.0-typescript.0 - - @onflow/util-template@1.2.0-typescript.0 - - @onflow/util-address@1.2.0-typescript.0 - - @onflow/util-logger@1.3.0-typescript.0 - ## 1.7.2 ### Patch Changes diff --git a/packages/typedefs/CHANGELOG.md b/packages/typedefs/CHANGELOG.md index 69aa86833..2180a078a 100644 --- a/packages/typedefs/CHANGELOG.md +++ b/packages/typedefs/CHANGELOG.md @@ -1,11 +1,5 @@ # @onflow/typedefs -## 1.2.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - ## 1.1.1 ### Patch Changes diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index cdc39904d..d346f1c99 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,18 +1,5 @@ # @onflow/types -## 1.2.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`81d4b40e`](https://github.com/onflow/fcl-js/commit/81d4b40e5b76ffb85b6185a274ae1cbce5988e7b) Thanks [@nialexsan](https://github.com/nialexsan)! - Convert @onflow/types to TypeScript - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - -### Patch Changes - -- Updated dependencies [[`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b), [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2)]: - - @onflow/util-logger@1.3.0-typescript.0 - ## 1.1.0 ### Minor Changes diff --git a/packages/util-actor/CHANGELOG.md b/packages/util-actor/CHANGELOG.md index 572bd2299..c01689dd0 100644 --- a/packages/util-actor/CHANGELOG.md +++ b/packages/util-actor/CHANGELOG.md @@ -1,13 +1,5 @@ # @onflow/util-actor -## 1.3.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`0960cdce`](https://github.com/onflow/fcl-js/commit/0960cdce6808b265ef92791da06a6772e9353537) Thanks [@nialexsan](https://github.com/nialexsan)! - Enhance TS support for @onflow/util-actor - ## 1.2.0 ### Minor Changes diff --git a/packages/util-address/CHANGELOG.md b/packages/util-address/CHANGELOG.md index fb931d5d4..c014ddafa 100644 --- a/packages/util-address/CHANGELOG.md +++ b/packages/util-address/CHANGELOG.md @@ -1,13 +1,5 @@ # @onflow/util-address -## 1.2.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b) Thanks [@nialexsan](https://github.com/nialexsan)! - Convert to Typescript - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - ## 1.1.0 ### Minor Changes diff --git a/packages/util-encode-key/CHANGELOG.md b/packages/util-encode-key/CHANGELOG.md index 7a2ec43da..a2a08e51f 100644 --- a/packages/util-encode-key/CHANGELOG.md +++ b/packages/util-encode-key/CHANGELOG.md @@ -1,19 +1,5 @@ # @onflow/util-encode-key -## 1.2.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b) Thanks [@nialexsan](https://github.com/nialexsan)! - Convert to Typescript - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - -### Patch Changes - -- Updated dependencies [[`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b), [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2)]: - - @onflow/util-invariant@1.2.0-typescript.0 - - @onflow/rlp@1.2.0-typescript.0 - ## 1.1.0 ### Minor Changes diff --git a/packages/util-encode-key/src/index.ts b/packages/util-encode-key/src/index.ts index 897727d31..9ba359091 100644 --- a/packages/util-encode-key/src/index.ts +++ b/packages/util-encode-key/src/index.ts @@ -15,7 +15,6 @@ const VALID_HASHINGS = new Set([SHA2_256, SHA3_256]) /** * Encodes a key into a hex string - * * @param key - The key to encode (DER Hex) * @param curve - The curve Flow needs to use with your key [ECDSA_P256|ECDSA_secp256k1] * @param hash - The hashing algorythm Flow needs to use with your key [SHA2_256|SHA3_256] diff --git a/packages/util-invariant/CHANGELOG.md b/packages/util-invariant/CHANGELOG.md index e2aa26bbf..826b3b5d4 100644 --- a/packages/util-invariant/CHANGELOG.md +++ b/packages/util-invariant/CHANGELOG.md @@ -1,13 +1,5 @@ # @onflow/util-invariant -## 1.2.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b) Thanks [@nialexsan](https://github.com/nialexsan)! - Convert to Typescript - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - ## 1.1.0 ### Minor Changes diff --git a/packages/util-logger/CHANGELOG.md b/packages/util-logger/CHANGELOG.md index 89d086a5c..7d532bf11 100644 --- a/packages/util-logger/CHANGELOG.md +++ b/packages/util-logger/CHANGELOG.md @@ -1,13 +1,5 @@ # @onflow/util-logger -## 1.3.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b) Thanks [@nialexsan](https://github.com/nialexsan)! - Convert to Typescript - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - ## 1.2.2 ### Patch Changes diff --git a/packages/util-logger/src/util-logger.ts b/packages/util-logger/src/util-logger.ts index b69a58f14..d6c3e2552 100644 --- a/packages/util-logger/src/util-logger.ts +++ b/packages/util-logger/src/util-logger.ts @@ -1,5 +1,11 @@ +interface IConfig { + get: (key: string) => T; +} + +type Config = IConfig & (() => IConfig) | null + // Config dependency injected into logger to break circular dependency -let config: any = null +let config: Config = null export const setConfig = (_config: any) => { config = _config } @@ -61,7 +67,7 @@ export const log = async (options: { always?: boolean }) => { const {title, message, level, always} = options - const configLoggerLevel = await config.get("logger.level", LEVELS.warn) + const configLoggerLevel = (await config?.()?.get("logger.level")) ?? LEVELS.warn // If config level is below message level then don't show it if (!always && configLoggerLevel < level) return diff --git a/packages/util-template/CHANGELOG.md b/packages/util-template/CHANGELOG.md index ed98b7483..1d6b910bd 100644 --- a/packages/util-template/CHANGELOG.md +++ b/packages/util-template/CHANGELOG.md @@ -1,18 +1,5 @@ # @onflow/util-template -## 1.2.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b) Thanks [@nialexsan](https://github.com/nialexsan)! - Convert to Typescript - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - -### Patch Changes - -- Updated dependencies [[`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b), [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2)]: - - @onflow/util-logger@1.3.0-typescript.0 - ## 1.1.0 ### Minor Changes diff --git a/packages/util-uid/CHANGELOG.md b/packages/util-uid/CHANGELOG.md index 49e19395e..841eb6100 100644 --- a/packages/util-uid/CHANGELOG.md +++ b/packages/util-uid/CHANGELOG.md @@ -1,13 +1,5 @@ # @onflow/util-uid -## 1.2.0-typescript.0 - -### Minor Changes - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`9fca84a3`](https://github.com/onflow/fcl-js/commit/9fca84a3151d7f6aeb33870a302e9793f024516b) Thanks [@nialexsan](https://github.com/nialexsan)! - Convert to Typescript - -- [#1801](https://github.com/onflow/fcl-js/pull/1801) [`86ce9f75`](https://github.com/onflow/fcl-js/commit/86ce9f75b5542a6bce76012e36a7a3d4fb6867f2) Thanks [@nialexsan](https://github.com/nialexsan)! - TS build - ## 1.1.0 ### Minor Changes