@xyo-network/react-api 2.41.32 → 2.41.34

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../../src/address/contexts/HistoryDiviner/Context.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAEpD,gFAAgF;AAChF,eAAO,MAAM,4BAA4B,0GAAgD,CAAA"}
1
+ {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../../src/address/contexts/HistoryDiviner/Context.ts"],"names":[],"mappings":";AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAEpD,gFAAgF;AAChF,eAAO,MAAM,4BAA4B,0GAAgD,CAAA"}
@@ -1,3 +1,5 @@
1
+ /* eslint-disable deprecation/deprecation */
2
+ /* eslint-disable import/no-deprecated */
1
3
  import { createContextEx } from '@xyo-network/react-shared';
2
4
  /** @deprecated - use useAddressHistory in @xyo-network/react-address-history */
3
5
  export const AddressHistoryDivinerContext = createContextEx();
@@ -1 +1 @@
1
- {"version":3,"file":"Context.js","sourceRoot":"","sources":["../../../../../src/address/contexts/HistoryDiviner/Context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAI3D,gFAAgF;AAChF,MAAM,CAAC,MAAM,4BAA4B,GAAG,eAAe,EAA8B,CAAA"}
1
+ {"version":3,"file":"Context.js","sourceRoot":"","sources":["../../../../../src/address/contexts/HistoryDiviner/Context.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,yCAAyC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAI3D,gFAAgF;AAChF,MAAM,CAAC,MAAM,4BAA4B,GAAG,eAAe,EAA8B,CAAA"}
@@ -2,7 +2,7 @@
2
2
  import { FlexBoxProps } from '@xylabs/react-flexbox';
3
3
  import { ReactJsonViewProps } from 'react-json-view';
4
4
  export interface JsonFromPromiseProps extends FlexBoxProps {
5
- callback: () => Promise<object | undefined>;
5
+ callback?: () => Promise<object | undefined>;
6
6
  noBackButton?: boolean;
7
7
  noJsonButton?: boolean;
8
8
  jsonViewProps?: ReactJsonViewProps;
@@ -1 +1 @@
1
- {"version":3,"file":"JsonRouteWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/JsonRouteWrapper/JsonRouteWrapper.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAoB,MAAM,uBAAuB,CAAA;AAItE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAOpD,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,QAAQ,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC3C,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,aAAa,CAAC,EAAE,kBAAkB,CAAA;CACnC;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAkE3D,CAAA"}
1
+ {"version":3,"file":"JsonRouteWrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/JsonRouteWrapper/JsonRouteWrapper.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAoB,MAAM,uBAAuB,CAAA;AAItE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAOpD,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,aAAa,CAAC,EAAE,kBAAkB,CAAA;CACnC;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAkE3D,CAAA"}
@@ -17,7 +17,7 @@ export const JsonRouteWrapper = ({ callback, children, noBackButton = false, noJ
17
17
  async (mounted) => {
18
18
  if (active) {
19
19
  try {
20
- const response = await callback();
20
+ const response = await callback?.();
21
21
  if (mounted()) {
22
22
  setApiResponse(response);
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"JsonRouteWrapper.js","sourceRoot":"","sources":["../../../../src/components/JsonRouteWrapper/JsonRouteWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAgB,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,kCAAkC,CAAC,iBAAiB,CAAC,CAAC,CAAA;AASzF,MAAM,CAAC,MAAM,gBAAgB,GAAmC,CAAC,EAC/D,QAAQ,EACR,QAAQ,EACR,YAAY,GAAG,KAAK,EACpB,YAAY,GAAG,KAAK,EACpB,aAAa,EACb,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,EAAU,CAAA;IACxD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,EAAe,CAAA;IACvD,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,eAAe,EAAE,CAAA;IACzD,MAAM,MAAM,GAAG,CAAC,CAAC,YAAY,CAAC,G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,YAAY,IAAI,KAAC,aAAa,IAAC,SAAS,EAAE,CAAC,GAAI,IAChD,CACJ,GACO,CACX,CAAA;AACH,CAAC,CAAA"}
package/package.json CHANGED
@@ -10,24 +10,24 @@
10
10
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-react-js/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xylabs/react-button": "^2.15.8",
14
- "@xylabs/react-common": "^2.15.8",
15
- "@xylabs/react-dialogs": "^2.15.8",
16
- "@xylabs/react-flexbox": "^2.15.8",
17
- "@xylabs/react-shared": "^2.15.8",
18
- "@xyo-network/api": "^2.43.7",
19
- "@xyo-network/api-models": "^2.43.7",
20
- "@xyo-network/archivist-wrapper": "^2.43.7",
21
- "@xyo-network/boundwitness-model": "^2.43.7",
22
- "@xyo-network/diviner": "^2.43.7",
23
- "@xyo-network/huri": "^2.43.7",
24
- "@xyo-network/module": "^2.43.7",
25
- "@xyo-network/network": "^2.43.7",
26
- "@xyo-network/payload-builder": "^2.43.7",
27
- "@xyo-network/payload-model": "^2.43.7",
28
- "@xyo-network/react-archivist": "^2.41.32",
29
- "@xyo-network/react-network": "^2.41.32",
30
- "@xyo-network/react-shared": "^2.41.32",
13
+ "@xylabs/react-button": "^2.15.9",
14
+ "@xylabs/react-common": "^2.15.9",
15
+ "@xylabs/react-dialogs": "^2.15.9",
16
+ "@xylabs/react-flexbox": "^2.15.9",
17
+ "@xylabs/react-shared": "^2.15.9",
18
+ "@xyo-network/api": "^2.43.9",
19
+ "@xyo-network/api-models": "^2.43.9",
20
+ "@xyo-network/archivist-wrapper": "^2.43.9",
21
+ "@xyo-network/boundwitness-model": "^2.43.9",
22
+ "@xyo-network/diviner": "^2.43.9",
23
+ "@xyo-network/huri": "^2.43.9",
24
+ "@xyo-network/module": "^2.43.9",
25
+ "@xyo-network/network": "^2.43.9",
26
+ "@xyo-network/payload-builder": "^2.43.9",
27
+ "@xyo-network/payload-model": "^2.43.9",
28
+ "@xyo-network/react-archivist": "^2.41.34",
29
+ "@xyo-network/react-network": "^2.41.34",
30
+ "@xyo-network/react-shared": "^2.41.34",
31
31
  "lodash": "^4.17.21",
32
32
  "react-json-view": "^1.21.3"
33
33
  },
@@ -35,12 +35,13 @@
35
35
  "@mui/icons-material": "^5.11.0",
36
36
  "@mui/material": "^5.11.5",
37
37
  "@mui/styles": "^5.11.2",
38
- "@xylabs/ts-scripts-yarn3": "2.12.0",
39
- "@xyo-network/react-storybook": "^2.41.32",
38
+ "@xylabs/ts-scripts-yarn3": "2.12.21",
39
+ "@xyo-network/react-storybook": "^2.41.34",
40
+ "@xyo-network/utils": "^2.43.9",
40
41
  "react": "^18.2.0",
41
42
  "react-dom": "^18.2.0",
42
43
  "react-icons": "^4.7.1",
43
- "react-router-dom": "^6.6.2",
44
+ "react-router-dom": "^6.7.0",
44
45
  "rollbar": "^2.26.1"
45
46
  },
46
47
  "peerDependencies": {
@@ -100,5 +101,5 @@
100
101
  },
101
102
  "sideEffects": false,
102
103
  "types": "dist/esm/index.d.ts",
103
- "version": "2.41.32"
104
+ "version": "2.41.34"
104
105
  }
@@ -1,3 +1,5 @@
1
+ /* eslint-disable deprecation/deprecation */
2
+ /* eslint-disable import/no-deprecated */
1
3
  import { createContextEx } from '@xyo-network/react-shared'
2
4
 
3
5
  import { AddressHistoryDivinerState } from './State'
@@ -3,10 +3,8 @@ import { Typography } from '@mui/material'
3
3
  import { ComponentMeta, ComponentStory } from '@storybook/react'
4
4
  import { useAsyncEffect } from '@xylabs/react-shared'
5
5
  import { XyoArchive } from '@xyo-network/api'
6
- import { useAuthState } from '@xyo-network/react-auth'
7
- import { AuthServiceWrapper } from '@xyo-network/react-auth-service'
8
6
  import { authDecorator, WrappedAuthComponent } from '@xyo-network/react-storybook'
9
- import { useEffect, useState } from 'react'
7
+ import { useState } from 'react'
10
8
 
11
9
  import { ApiProvider, useApi } from '../../contexts'
12
10
  import { ApiHistory } from './ApiHistory'
@@ -28,38 +26,27 @@ const StorybookEntry = {
28
26
 
29
27
  const DemoArchiveFetcher = () => {
30
28
  const [myArchives, setMyArchives] = useState<XyoArchive[]>([])
31
- const { api, currentToken } = useApi()
32
- const { state } = useAuthState()
29
+ const { api } = useApi()
33
30
  const [successfulCall, setSuccessfulCall] = useState(false)
34
31
 
35
32
  useAsyncEffect(
36
33
  // eslint-disable-next-line react-hooks/exhaustive-deps
37
34
  async (mounted) => {
38
- if (state?.jwtToken && currentToken && state?.loggedInAccount) {
39
- const archives = await api?.archives?.get()
40
- if (archives && mounted()) {
41
- setMyArchives(archives)
42
- setSuccessfulCall(true)
43
- }
35
+ const archives = await api?.archives?.get()
36
+ if (archives && mounted()) {
37
+ setMyArchives(archives)
38
+ setSuccessfulCall(true)
44
39
  }
45
40
  },
46
- [api, state?.jwtToken, currentToken, state?.loggedInAccount, setSuccessfulCall],
41
+ [api?.archives],
47
42
  )
48
43
 
49
- useEffect(() => {
50
- if (!state?.loggedInAccount) {
51
- setMyArchives([])
52
- setSuccessfulCall(false)
53
- }
54
- }, [state?.loggedInAccount])
55
-
56
44
  return (
57
45
  <>
58
- <AuthServiceWrapper />
59
- <p>My Archives</p>
46
+ <p>Archives</p>
60
47
  {successfulCall && (
61
48
  <Typography color="success.main" variant="body1">
62
- Successfully made authenticated request!!
49
+ Successfully made request
63
50
  </Typography>
64
51
  )}
65
52
  <ul>
@@ -74,8 +61,6 @@ const DemoArchiveFetcher = () => {
74
61
  }
75
62
 
76
63
  const Template: ComponentStory<WrappedAuthComponent> = () => {
77
- const { state } = useAuthState()
78
- const jwtToken = state?.jwtToken
79
64
  return (
80
65
  <ApiProvider
81
66
  errorHistoryMaxDepth={10}
@@ -83,7 +68,6 @@ const Template: ComponentStory<WrappedAuthComponent> = () => {
83
68
  failureHistoryMaxDepth={10}
84
69
  responseHistoryMaxDepth={10}
85
70
  apiDomain="https://beta.api.archivist.xyo.network"
86
- jwtToken={jwtToken}
87
71
  >
88
72
  <DemoArchiveFetcher />
89
73
  </ApiProvider>
@@ -14,7 +14,9 @@ const JsonDecorator: DecoratorFn = (Story) => (
14
14
 
15
15
  const StorybookEntry = {
16
16
  argTypes: {
17
- apiDomain: 'https://beta.api.archivist.xyo.network',
17
+ apiDomain: {
18
+ default: 'https://beta.api.archivist.xyo.network',
19
+ },
18
20
  },
19
21
  component: JsonRouteWrapper,
20
22
  decorators: [JsonDecorator],
@@ -12,7 +12,7 @@ import { JsonApiButton } from './JsonApiButton'
12
12
  const JsonView = lazy(() => import(/* webpackChunkName: "jsonView" */ 'react-json-view'))
13
13
 
14
14
  export interface JsonFromPromiseProps extends FlexBoxProps {
15
- callback: () => Promise<object | undefined>
15
+ callback?: () => Promise<object | undefined>
16
16
  noBackButton?: boolean
17
17
  noJsonButton?: boolean
18
18
  jsonViewProps?: ReactJsonViewProps
@@ -36,7 +36,7 @@ export const JsonRouteWrapper: React.FC<JsonFromPromiseProps> = ({
36
36
  async (mounted) => {
37
37
  if (active) {
38
38
  try {
39
- const response = await callback()
39
+ const response = await callback?.()
40
40
  if (mounted()) {
41
41
  setApiResponse(response)
42
42
  }
@@ -3,10 +3,8 @@ import { Typography } from '@mui/material'
3
3
  import { ComponentMeta, ComponentStory } from '@storybook/react'
4
4
  import { useAsyncEffect } from '@xylabs/react-shared'
5
5
  import { XyoArchive } from '@xyo-network/api'
6
- import { useAuthState } from '@xyo-network/react-auth'
7
- import { AuthServiceWrapper } from '@xyo-network/react-auth-service'
8
6
  import { authDecorator, WrappedAuthComponent } from '@xyo-network/react-storybook'
9
- import { useEffect, useState } from 'react'
7
+ import { useState } from 'react'
10
8
 
11
9
  import { ApiProvider } from './Provider'
12
10
  import { useApi } from './use'
@@ -28,38 +26,32 @@ const StorybookEntry = {
28
26
 
29
27
  const DemoArchiveFetcher = () => {
30
28
  const [myArchives, setMyArchives] = useState<XyoArchive[]>([])
31
- const { api, currentToken, responseHistory } = useApi()
32
- const { state } = useAuthState()
29
+ const { api, responseHistory } = useApi()
33
30
  const [successfulCall, setSuccessfulCall] = useState(false)
34
31
 
35
32
  useAsyncEffect(
36
33
  // eslint-disable-next-line react-hooks/exhaustive-deps
37
34
  async (mounted) => {
38
- if (state?.jwtToken && currentToken && state?.loggedInAccount) {
35
+ try {
39
36
  const archives = await api?.archives?.get()
40
37
  if (archives && mounted()) {
41
38
  setMyArchives(archives)
42
39
  setSuccessfulCall(true)
43
40
  }
41
+ } catch (e) {
42
+ setMyArchives([])
43
+ setSuccessfulCall(false)
44
44
  }
45
45
  },
46
- [api, state?.jwtToken, currentToken, state?.loggedInAccount, setSuccessfulCall],
46
+ [api],
47
47
  )
48
48
 
49
- useEffect(() => {
50
- if (!state?.loggedInAccount) {
51
- setMyArchives([])
52
- setSuccessfulCall(false)
53
- }
54
- }, [state?.loggedInAccount])
55
-
56
49
  return (
57
50
  <>
58
- <AuthServiceWrapper />
59
- <p>My Archives</p>
51
+ <p>Archives</p>
60
52
  {successfulCall && (
61
53
  <Typography color="success.main" variant="body1">
62
- Successfully made authenticated request!!
54
+ Successfully made request!!
63
55
  </Typography>
64
56
  )}
65
57
  <ul>
@@ -78,8 +70,6 @@ const DemoArchiveFetcher = () => {
78
70
  }
79
71
 
80
72
  const Template: ComponentStory<WrappedAuthComponent> = () => {
81
- const { state } = useAuthState()
82
- const jwtToken = state?.jwtToken
83
73
  return (
84
74
  <ApiProvider
85
75
  errorHistoryMaxDepth={10}
@@ -87,7 +77,6 @@ const Template: ComponentStory<WrappedAuthComponent> = () => {
87
77
  failureHistoryMaxDepth={10}
88
78
  responseHistoryMaxDepth={10}
89
79
  apiDomain="https://beta.api.archivist.xyo.network"
90
- jwtToken={jwtToken}
91
80
  >
92
81
  <DemoArchiveFetcher />
93
82
  </ApiProvider>