@webiny/app-tenancy 5.23.0 → 5.24.0-beta.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/Tenancy.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
- export declare const TenancyExtension: () => JSX.Element;
3
- export declare const Tenancy: React.MemoExoticComponent<() => JSX.Element>;
2
+ export declare const TenancyExtension: React.FC;
3
+ export declare const Tenancy: React.NamedExoticComponent<{}>;
@@ -9,4 +9,4 @@ export declare type TenancyContextValue = {
9
9
  setTenant(tenant: string): void;
10
10
  isMultiTenant: boolean;
11
11
  };
12
- export declare const TenancyProvider: (props: any) => JSX.Element;
12
+ export declare const TenancyProvider: React.FC;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-tenancy",
3
- "version": "5.23.0",
3
+ "version": "5.24.0-beta.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -17,10 +17,11 @@
17
17
  "@babel/runtime": "7.16.7",
18
18
  "@emotion/styled": "10.3.0",
19
19
  "@types/react": "16.14.2",
20
- "@webiny/app": "5.23.0",
21
- "@webiny/app-admin": "5.23.0",
22
- "@webiny/plugins": "5.23.0",
23
- "@webiny/ui": "5.23.0",
20
+ "@webiny/app": "5.24.0-beta.0",
21
+ "@webiny/app-admin": "5.24.0-beta.0",
22
+ "@webiny/plugins": "5.24.0-beta.0",
23
+ "@webiny/ui": "5.24.0-beta.0",
24
+ "apollo-client": "2.6.10",
24
25
  "graphql-tag": "2.12.6",
25
26
  "react": "16.14.0",
26
27
  "react-dom": "16.14.0",
@@ -33,8 +34,8 @@
33
34
  "@babel/preset-env": "^7.16.4",
34
35
  "@babel/preset-react": "^7.16.0",
35
36
  "@babel/preset-typescript": "^7.16.0",
36
- "@webiny/cli": "^5.23.0",
37
- "@webiny/project-utils": "^5.23.0",
37
+ "@webiny/cli": "^5.24.0-beta.0",
38
+ "@webiny/project-utils": "^5.24.0-beta.0",
38
39
  "babel-plugin-emotion": "^9.2.8",
39
40
  "babel-plugin-lodash": "^3.3.4",
40
41
  "rimraf": "^3.0.2",
@@ -49,5 +50,5 @@
49
50
  "build": "yarn webiny run build",
50
51
  "watch": "yarn webiny run watch"
51
52
  },
52
- "gitHead": "eaa0003e39194d687ab5397c08eeccdb3557fb28"
53
+ "gitHead": "05b90b92bbaf2ef3adf275d008c4641580cf5f42"
53
54
  }
package/withTenant.d.ts CHANGED
@@ -1,6 +1,11 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
+ import ApolloClient from "apollo-client";
2
3
  export declare const GET_DEFAULT_TENANT: import("graphql").DocumentNode;
3
- export declare const withTenant: (Component: any) => ({ getIdentityData, children }: {
4
- getIdentityData: any;
5
- children: any;
6
- }) => JSX.Element;
4
+ interface GetIdentityWithTenantParams {
5
+ client: ApolloClient<any>;
6
+ }
7
+ interface WithTenantProps {
8
+ getIdentityData: (params: GetIdentityWithTenantParams) => Promise<Record<string, string>>;
9
+ }
10
+ export declare const withTenant: (Component: React.FC<WithTenantProps>) => React.FC<WithTenantProps>;
11
+ export {};
package/withTenant.js CHANGED
@@ -9,7 +9,7 @@ import { gql } from "graphql-tag";
9
9
  import { useTenancy } from "./hooks/useTenancy";
10
10
  export var GET_DEFAULT_TENANT = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query GetDefaultTenant {\n tenancy {\n getDefaultTenant {\n data {\n id\n name\n description\n }\n error {\n code\n message\n }\n }\n }\n }\n"])));
11
11
  export var withTenant = function withTenant(Component) {
12
- var WithTenant = function WithTenant(_ref) {
12
+ return function WithTenant(_ref) {
13
13
  var getIdentityData = _ref.getIdentityData,
14
14
  children = _ref.children;
15
15
 
@@ -66,6 +66,4 @@ export var withTenant = function withTenant(Component) {
66
66
  getIdentityData: getIdentityWithTenant
67
67
  }, children);
68
68
  };
69
-
70
- return WithTenant;
71
69
  };