@schematichq/schematic-react 1.3.0 → 1.3.1
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/LICENSE +1 -1
- package/dist/schematic-react.cjs.js +25 -6
- package/dist/schematic-react.d.ts +3 -0
- package/dist/schematic-react.esm.js +25 -6
- package/package.json +9 -9
package/LICENSE
CHANGED
|
@@ -33,6 +33,7 @@ __export(index_exports, {
|
|
|
33
33
|
RuleType: () => RuleType,
|
|
34
34
|
Schematic: () => Schematic,
|
|
35
35
|
SchematicProvider: () => SchematicProvider,
|
|
36
|
+
TrialStatus: () => TrialStatus,
|
|
36
37
|
UsagePeriod: () => UsagePeriod,
|
|
37
38
|
useSchematic: () => useSchematic,
|
|
38
39
|
useSchematicContext: () => useSchematicContext,
|
|
@@ -719,6 +720,17 @@ function CheckFlagResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
719
720
|
params: json["params"]
|
|
720
721
|
};
|
|
721
722
|
}
|
|
723
|
+
var TrialStatus = {
|
|
724
|
+
Active: "active",
|
|
725
|
+
Converted: "converted",
|
|
726
|
+
Expired: "expired"
|
|
727
|
+
};
|
|
728
|
+
function TrialStatusFromJSON(json) {
|
|
729
|
+
return TrialStatusFromJSONTyped(json, false);
|
|
730
|
+
}
|
|
731
|
+
function TrialStatusFromJSONTyped(json, ignoreDiscriminator) {
|
|
732
|
+
return json;
|
|
733
|
+
}
|
|
722
734
|
function DatastreamCompanyPlanFromJSON(json) {
|
|
723
735
|
return DatastreamCompanyPlanFromJSONTyped(json, false);
|
|
724
736
|
}
|
|
@@ -729,7 +741,8 @@ function DatastreamCompanyPlanFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
729
741
|
return {
|
|
730
742
|
id: json["id"],
|
|
731
743
|
name: json["name"],
|
|
732
|
-
trialEndDate: json["trial_end_date"] == null ? void 0 : new Date(json["trial_end_date"])
|
|
744
|
+
trialEndDate: json["trial_end_date"] == null ? void 0 : new Date(json["trial_end_date"]),
|
|
745
|
+
trialStatus: json["trial_status"] == null ? void 0 : TrialStatusFromJSON(json["trial_status"])
|
|
733
746
|
};
|
|
734
747
|
}
|
|
735
748
|
function CheckFlagsResponseDataFromJSON(json) {
|
|
@@ -832,11 +845,12 @@ var CheckFlagReturnFromJSON = (json) => {
|
|
|
832
845
|
};
|
|
833
846
|
};
|
|
834
847
|
var CheckPlanReturnFromJSON = (json) => {
|
|
835
|
-
const { id, name, trialEndDate } = DatastreamCompanyPlanFromJSON(json);
|
|
848
|
+
const { id, name, trialEndDate, trialStatus } = DatastreamCompanyPlanFromJSON(json);
|
|
836
849
|
return {
|
|
837
850
|
id,
|
|
838
851
|
name,
|
|
839
|
-
trialEndDate: trialEndDate == null ? void 0 : trialEndDate
|
|
852
|
+
trialEndDate: trialEndDate == null ? void 0 : trialEndDate,
|
|
853
|
+
trialStatus: trialStatus == null ? void 0 : trialStatus
|
|
840
854
|
};
|
|
841
855
|
};
|
|
842
856
|
function contextString(context) {
|
|
@@ -853,7 +867,7 @@ function contextString(context) {
|
|
|
853
867
|
}, {});
|
|
854
868
|
return JSON.stringify(sortedContext);
|
|
855
869
|
}
|
|
856
|
-
var version = "1.3.
|
|
870
|
+
var version = "1.3.1";
|
|
857
871
|
var anonymousIdKey = "schematicId";
|
|
858
872
|
var Schematic = class {
|
|
859
873
|
additionalHeaders = {};
|
|
@@ -2290,7 +2304,7 @@ var notifyPlanListener = (listener, value) => {
|
|
|
2290
2304
|
var import_react = __toESM(require("react"));
|
|
2291
2305
|
|
|
2292
2306
|
// src/version.ts
|
|
2293
|
-
var version2 = "1.3.
|
|
2307
|
+
var version2 = "1.3.1";
|
|
2294
2308
|
|
|
2295
2309
|
// src/context/schematic.tsx
|
|
2296
2310
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -2416,7 +2430,12 @@ var useSchematicPlan = (opts) => {
|
|
|
2416
2430
|
const fallback = opts?.fallback;
|
|
2417
2431
|
const fallbackPlan = (0, import_react2.useMemo)(
|
|
2418
2432
|
() => fallback,
|
|
2419
|
-
[
|
|
2433
|
+
[
|
|
2434
|
+
fallback?.id,
|
|
2435
|
+
fallback?.name,
|
|
2436
|
+
fallback?.trialEndDate?.getTime(),
|
|
2437
|
+
fallback?.trialStatus
|
|
2438
|
+
]
|
|
2420
2439
|
);
|
|
2421
2440
|
const subscribe = (0, import_react2.useCallback)(
|
|
2422
2441
|
(callback) => client.addPlanListener(callback),
|
|
@@ -14,6 +14,7 @@ import * as SchematicJS from '@schematichq/schematic-js';
|
|
|
14
14
|
import { SchematicOptions } from '@schematichq/schematic-js';
|
|
15
15
|
import { StoragePersister } from '@schematichq/schematic-js';
|
|
16
16
|
import { Traits } from '@schematichq/schematic-js';
|
|
17
|
+
import { TrialStatus } from '@schematichq/schematic-js';
|
|
17
18
|
import { UsagePeriod } from '@schematichq/schematic-js';
|
|
18
19
|
|
|
19
20
|
declare type BaseSchematicProviderProps = Omit<SchematicJS.SchematicOptions, "client" | "publishableKey" | "useWebSocket"> & {
|
|
@@ -70,6 +71,8 @@ export { StoragePersister }
|
|
|
70
71
|
|
|
71
72
|
export { Traits }
|
|
72
73
|
|
|
74
|
+
export { TrialStatus }
|
|
75
|
+
|
|
73
76
|
export { UsagePeriod }
|
|
74
77
|
|
|
75
78
|
export declare const useSchematic: () => SchematicContextProps;
|
|
@@ -673,6 +673,17 @@ function CheckFlagResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
673
673
|
params: json["params"]
|
|
674
674
|
};
|
|
675
675
|
}
|
|
676
|
+
var TrialStatus = {
|
|
677
|
+
Active: "active",
|
|
678
|
+
Converted: "converted",
|
|
679
|
+
Expired: "expired"
|
|
680
|
+
};
|
|
681
|
+
function TrialStatusFromJSON(json) {
|
|
682
|
+
return TrialStatusFromJSONTyped(json, false);
|
|
683
|
+
}
|
|
684
|
+
function TrialStatusFromJSONTyped(json, ignoreDiscriminator) {
|
|
685
|
+
return json;
|
|
686
|
+
}
|
|
676
687
|
function DatastreamCompanyPlanFromJSON(json) {
|
|
677
688
|
return DatastreamCompanyPlanFromJSONTyped(json, false);
|
|
678
689
|
}
|
|
@@ -683,7 +694,8 @@ function DatastreamCompanyPlanFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
683
694
|
return {
|
|
684
695
|
id: json["id"],
|
|
685
696
|
name: json["name"],
|
|
686
|
-
trialEndDate: json["trial_end_date"] == null ? void 0 : new Date(json["trial_end_date"])
|
|
697
|
+
trialEndDate: json["trial_end_date"] == null ? void 0 : new Date(json["trial_end_date"]),
|
|
698
|
+
trialStatus: json["trial_status"] == null ? void 0 : TrialStatusFromJSON(json["trial_status"])
|
|
687
699
|
};
|
|
688
700
|
}
|
|
689
701
|
function CheckFlagsResponseDataFromJSON(json) {
|
|
@@ -786,11 +798,12 @@ var CheckFlagReturnFromJSON = (json) => {
|
|
|
786
798
|
};
|
|
787
799
|
};
|
|
788
800
|
var CheckPlanReturnFromJSON = (json) => {
|
|
789
|
-
const { id, name, trialEndDate } = DatastreamCompanyPlanFromJSON(json);
|
|
801
|
+
const { id, name, trialEndDate, trialStatus } = DatastreamCompanyPlanFromJSON(json);
|
|
790
802
|
return {
|
|
791
803
|
id,
|
|
792
804
|
name,
|
|
793
|
-
trialEndDate: trialEndDate == null ? void 0 : trialEndDate
|
|
805
|
+
trialEndDate: trialEndDate == null ? void 0 : trialEndDate,
|
|
806
|
+
trialStatus: trialStatus == null ? void 0 : trialStatus
|
|
794
807
|
};
|
|
795
808
|
};
|
|
796
809
|
function contextString(context) {
|
|
@@ -807,7 +820,7 @@ function contextString(context) {
|
|
|
807
820
|
}, {});
|
|
808
821
|
return JSON.stringify(sortedContext);
|
|
809
822
|
}
|
|
810
|
-
var version = "1.3.
|
|
823
|
+
var version = "1.3.1";
|
|
811
824
|
var anonymousIdKey = "schematicId";
|
|
812
825
|
var Schematic = class {
|
|
813
826
|
additionalHeaders = {};
|
|
@@ -2244,7 +2257,7 @@ var notifyPlanListener = (listener, value) => {
|
|
|
2244
2257
|
import React, { createContext, useEffect, useMemo, useRef } from "react";
|
|
2245
2258
|
|
|
2246
2259
|
// src/version.ts
|
|
2247
|
-
var version2 = "1.3.
|
|
2260
|
+
var version2 = "1.3.1";
|
|
2248
2261
|
|
|
2249
2262
|
// src/context/schematic.tsx
|
|
2250
2263
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -2370,7 +2383,12 @@ var useSchematicPlan = (opts) => {
|
|
|
2370
2383
|
const fallback = opts?.fallback;
|
|
2371
2384
|
const fallbackPlan = useMemo2(
|
|
2372
2385
|
() => fallback,
|
|
2373
|
-
[
|
|
2386
|
+
[
|
|
2387
|
+
fallback?.id,
|
|
2388
|
+
fallback?.name,
|
|
2389
|
+
fallback?.trialEndDate?.getTime(),
|
|
2390
|
+
fallback?.trialStatus
|
|
2391
|
+
]
|
|
2374
2392
|
);
|
|
2375
2393
|
const subscribe = useCallback(
|
|
2376
2394
|
(callback) => client.addPlanListener(callback),
|
|
@@ -2395,6 +2413,7 @@ export {
|
|
|
2395
2413
|
RuleType,
|
|
2396
2414
|
Schematic,
|
|
2397
2415
|
SchematicProvider,
|
|
2416
|
+
TrialStatus,
|
|
2398
2417
|
UsagePeriod,
|
|
2399
2418
|
useSchematic,
|
|
2400
2419
|
useSchematicContext,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schematichq/schematic-react",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"main": "dist/schematic-react.cjs.js",
|
|
5
5
|
"module": "dist/schematic-react.esm.js",
|
|
6
6
|
"types": "dist/schematic-react.d.ts",
|
|
@@ -31,30 +31,30 @@
|
|
|
31
31
|
"prepare": "husky"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@schematichq/schematic-js": "^1.3.
|
|
34
|
+
"@schematichq/schematic-js": "^1.3.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@eslint/js": "^10.0.1",
|
|
38
|
-
"@microsoft/api-extractor": "^7.
|
|
38
|
+
"@microsoft/api-extractor": "^7.58.1",
|
|
39
39
|
"@testing-library/dom": "^10.4.1",
|
|
40
40
|
"@testing-library/jest-dom": "^6.9.1",
|
|
41
41
|
"@testing-library/react": "^16.3.2",
|
|
42
42
|
"@types/react": "^19.2.14",
|
|
43
43
|
"@vitest/browser": "^4.0.18",
|
|
44
|
-
"esbuild": "^0.
|
|
45
|
-
"eslint": "^10.0
|
|
44
|
+
"esbuild": "^0.28.0",
|
|
45
|
+
"eslint": "^10.2.0",
|
|
46
46
|
"eslint-plugin-import": "^2.32.0",
|
|
47
47
|
"eslint-plugin-react": "^7.37.5",
|
|
48
48
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
49
49
|
"globals": "^17.4.0",
|
|
50
|
-
"happy-dom": "^20.8.
|
|
50
|
+
"happy-dom": "^20.8.9",
|
|
51
51
|
"husky": "^9.1.7",
|
|
52
|
-
"jsdom": "^29.0.
|
|
52
|
+
"jsdom": "^29.0.1",
|
|
53
53
|
"prettier": "^3.8.1",
|
|
54
54
|
"react": "^19.2.4",
|
|
55
55
|
"react-dom": "^19.2.4",
|
|
56
|
-
"typescript": "^
|
|
57
|
-
"typescript-eslint": "^8.
|
|
56
|
+
"typescript": "^6.0.2",
|
|
57
|
+
"typescript-eslint": "^8.58.0",
|
|
58
58
|
"vitest": "^4.0.18"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|