@refinedev/core 4.28.0 → 4.28.2
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 +12 -0
- package/dist/contexts/refine/IRefineContext.d.ts +5 -0
- package/dist/contexts/refine/IRefineContext.d.ts.map +1 -1
- package/dist/definitions/helpers/handleRefineOptions/index.d.ts.map +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/hooks/useTelemetryData/index.d.ts +1 -1
- package/dist/hooks/useTelemetryData/index.d.ts.map +1 -1
- package/dist/iife/index.js +6 -6
- package/dist/iife/index.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/interfaces/{telementry.d.ts → telemetry.d.ts} +2 -1
- package/dist/interfaces/telemetry.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/telemetry/index.tsx +1 -1
- package/src/contexts/refine/IRefineContext.ts +5 -0
- package/src/definitions/helpers/handleRefineOptions/index.ts +1 -0
- package/src/hooks/useTelemetryData/index.ts +6 -3
- package/src/interfaces/{telementry.ts → telemetry.ts} +1 -0
- package/dist/interfaces/telementry.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/interfaces/telemetry.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc,GAAG;IACzB,SAAS,EAAE;QACP,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,aAAa,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refinedev/core",
|
|
3
|
-
"version": "4.28.
|
|
3
|
+
"version": "4.28.2",
|
|
4
4
|
"description": "refine is a React-based framework for building internal tools, rapidly. It ships with Ant Design System, an enterprise-level UI toolkit.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -2,7 +2,7 @@ import { useEffect } from "react";
|
|
|
2
2
|
|
|
3
3
|
import { useTelemetryData } from "@hooks/useTelemetryData";
|
|
4
4
|
|
|
5
|
-
import { ITelemetryData } from "../../interfaces/
|
|
5
|
+
import { ITelemetryData } from "../../interfaces/telemetry";
|
|
6
6
|
|
|
7
7
|
const encode = (payload: ITelemetryData): string => {
|
|
8
8
|
const stringifyedPayload = JSON.stringify(payload || {});
|
|
@@ -38,6 +38,10 @@ export interface IRefineOptions {
|
|
|
38
38
|
* @see {@link https://refine.dev/docs/advanced-tutorials/forms/server-side-form-validation/}
|
|
39
39
|
*/
|
|
40
40
|
disableServerSideValidation?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The project id of your refine project. Will be set automatically. Don't modify.
|
|
43
|
+
*/
|
|
44
|
+
projectId?: string;
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
export interface IRefineContextOptions {
|
|
@@ -55,6 +59,7 @@ export interface IRefineContextOptions {
|
|
|
55
59
|
overtime: UseLoadingOvertimeRefineContext;
|
|
56
60
|
textTransformers: Required<TextTransformers>;
|
|
57
61
|
disableServerSideValidation: boolean;
|
|
62
|
+
projectId?: string;
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
export interface IRefineContext {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
2
|
|
|
3
|
-
import { useAuthBindingsContext, useLegacyAuthContext } from "@contexts/auth";
|
|
4
3
|
import { AuditLogContext } from "@contexts/auditLog";
|
|
5
4
|
import { LiveContext } from "@contexts/live";
|
|
6
5
|
import { RouterContext } from "@contexts/legacy-router";
|
|
@@ -10,8 +9,8 @@ import { NotificationContext } from "@contexts/notification";
|
|
|
10
9
|
import { AccessControlContext } from "@contexts/accessControl";
|
|
11
10
|
import { useResource } from "@hooks/resource";
|
|
12
11
|
|
|
13
|
-
import { ITelemetryData } from "../../interfaces/
|
|
14
|
-
import { useIsExistAuthentication } from "..";
|
|
12
|
+
import { ITelemetryData } from "../../interfaces/telemetry";
|
|
13
|
+
import { useIsExistAuthentication, useRefineContext } from "..";
|
|
15
14
|
|
|
16
15
|
// It reads and updates from package.json during build. ref: tsup.config.ts
|
|
17
16
|
const REFINE_VERSION = "1.0.0";
|
|
@@ -26,6 +25,7 @@ export const useTelemetryData = (): ITelemetryData => {
|
|
|
26
25
|
const notificationContext = useContext(NotificationContext);
|
|
27
26
|
const accessControlContext = useContext(AccessControlContext);
|
|
28
27
|
const { resources } = useResource();
|
|
28
|
+
const refineOptions = useRefineContext();
|
|
29
29
|
|
|
30
30
|
const auditLog =
|
|
31
31
|
!!auditLogContext.create ||
|
|
@@ -56,6 +56,8 @@ export const useTelemetryData = (): ITelemetryData => {
|
|
|
56
56
|
|
|
57
57
|
const accessControl = !!accessControlContext.can;
|
|
58
58
|
|
|
59
|
+
const projectId = refineOptions?.options?.projectId;
|
|
60
|
+
|
|
59
61
|
return {
|
|
60
62
|
providers: {
|
|
61
63
|
auth,
|
|
@@ -69,5 +71,6 @@ export const useTelemetryData = (): ITelemetryData => {
|
|
|
69
71
|
},
|
|
70
72
|
version: REFINE_VERSION,
|
|
71
73
|
resourceCount: resources.length,
|
|
74
|
+
projectId,
|
|
72
75
|
};
|
|
73
76
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"telementry.d.ts","sourceRoot":"","sources":["../../src/interfaces/telementry.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc,GAAG;IACzB,SAAS,EAAE;QACP,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,aAAa,CAAC,EAAE,OAAO,CAAC;KAC3B,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACzB,CAAC"}
|