@symbo.ls/sdk 2.33.41 → 2.34.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/dist/cjs/services/PlanService.js +7 -1
- package/dist/esm/index.js +1100 -180
- package/dist/esm/services/CollabService.js +961 -52
- package/dist/esm/services/PlanService.js +7 -1
- package/dist/esm/services/TrackingService.js +71 -66
- package/dist/esm/services/index.js +1097 -177
- package/dist/esm/utils/CollabClient.js +948 -39
- package/dist/esm/utils/jsonDiff.js +886 -13
- package/dist/node/services/PlanService.js +7 -1
- package/package.json +6 -6
- package/src/services/PlanService.js +7 -1
- package/src/services/tests/PlanService/createPlanWithValidation.test.js +137 -10
- package/src/services/tests/PlanService/getActivePlans.test.js +125 -0
- package/src/services/tests/PlanService/updatePlanWithValidation.test.js +393 -62
|
@@ -292,6 +292,9 @@ class PlanService extends import_BaseService.BaseService {
|
|
|
292
292
|
}
|
|
293
293
|
});
|
|
294
294
|
}
|
|
295
|
+
if (Object.hasOwn(planData, "key") && planData.key == null) {
|
|
296
|
+
throw new Error("Plan key must be a valid string");
|
|
297
|
+
}
|
|
295
298
|
if (planData.key && !/^[a-z0-9-]+$/u.test(planData.key)) {
|
|
296
299
|
throw new Error(
|
|
297
300
|
"Plan key must contain only lowercase letters, numbers, and hyphens"
|
|
@@ -346,7 +349,7 @@ class PlanService extends import_BaseService.BaseService {
|
|
|
346
349
|
`Pricing option '${key}' must have a non-negative numeric 'amount'`
|
|
347
350
|
);
|
|
348
351
|
}
|
|
349
|
-
if (interval
|
|
352
|
+
if (interval !== null && !allowedIntervals.has(interval)) {
|
|
350
353
|
throw new Error(
|
|
351
354
|
`Pricing option '${key}' has invalid interval '${interval}'. Allowed: month, year, week, day or null`
|
|
352
355
|
);
|
|
@@ -358,6 +361,9 @@ class PlanService extends import_BaseService.BaseService {
|
|
|
358
361
|
}
|
|
359
362
|
});
|
|
360
363
|
}
|
|
364
|
+
if (Object.hasOwn(planData, "key") && planData.key == null) {
|
|
365
|
+
throw new Error("Plan key must be a valid string");
|
|
366
|
+
}
|
|
361
367
|
if (planData.key && !/^[a-z0-9-]+$/u.test(planData.key)) {
|
|
362
368
|
throw new Error(
|
|
363
369
|
"Plan key must contain only lowercase letters, numbers, and hyphens"
|