@orakl/shared 0.4.1 → 0.5.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.
@@ -1 +1 @@
1
- export { type Difficulty, DifficultySchema, type ImageChoiceQuestion, type ImageMatchingQuestion, isHttpsUrl, type Media, MediaSchema, type MediaType, MediaTypeSchema, PostAnswerNoteSchema, type Question, QuestionSchema, type QuestionSource, QuestionSourceSchema, type QuestionType, QuestionTypeSchema, type Source, SourceSchema, type TextChoiceQuestion, type TrueFalseQuestion, } from "@orakl/protocol";
1
+ export { ATTRIBUTION_LICENCES, CREDIT_LICENCE_LABEL, CREDIT_LICENCES, type CreditLicence, CreditLicenceSchema, DISTRIBUTABLE_LICENCES, type Difficulty, DifficultySchema, type ImageChoiceQuestion, type ImageMatchingQuestion, isHttpsUrl, type Media, type MediaCredit, MediaCreditSchema, MediaSchema, type MediaType, MediaTypeSchema, PostAnswerNoteSchema, type Question, QuestionSchema, type QuestionSource, QuestionSourceSchema, type QuestionType, QuestionTypeSchema, type Source, SourceSchema, type TextChoiceQuestion, type TrueFalseQuestion, } from "@orakl/protocol";
@@ -1 +1 @@
1
- export { DifficultySchema, isHttpsUrl, MediaSchema, MediaTypeSchema, PostAnswerNoteSchema, QuestionSchema, QuestionSourceSchema, QuestionTypeSchema, SourceSchema, } from "@orakl/protocol";
1
+ export { ATTRIBUTION_LICENCES, CREDIT_LICENCE_LABEL, CREDIT_LICENCES, CreditLicenceSchema, DISTRIBUTABLE_LICENCES, DifficultySchema, isHttpsUrl, MediaCreditSchema, MediaSchema, MediaTypeSchema, PostAnswerNoteSchema, QuestionSchema, QuestionSourceSchema, QuestionTypeSchema, SourceSchema, } from "@orakl/protocol";
@@ -16,6 +16,8 @@ export type SoloEntitlements = GuestEntitlements | AuthEntitlements;
16
16
  export declare function getEntitlements(isGuest: boolean): SoloEntitlements;
17
17
  export interface SoloStartConfig {
18
18
  categoryIds: string[];
19
+ /** Seasons drawn from; each counts as one pick against `maxCategories`. */
20
+ seasonIds?: string[];
19
21
  questionCount: number;
20
22
  mode: "normal" | "endless";
21
23
  difficulty: "all" | "easy" | "medium" | "hard";
@@ -26,10 +26,11 @@ export function checkEntitlements(config, entitlements) {
26
26
  };
27
27
  }
28
28
  if (entitlements.maxCategories !== null &&
29
- config.categoryIds.length > entitlements.maxCategories) {
29
+ config.categoryIds.length + (config.seasonIds?.length ?? 0) >
30
+ entitlements.maxCategories) {
30
31
  return {
31
32
  code: "entitlement_exceeded",
32
- message: `Guests may select up to ${entitlements.maxCategories} categories.`,
33
+ message: `Guests may select up to ${entitlements.maxCategories} categories or seasons.`,
33
34
  upgradeHint: "Sign in to unlock all categories.",
34
35
  };
35
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orakl/shared",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "Orakl runtime helpers shared by the web client and the engine.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -18,7 +18,7 @@
18
18
  "types": "./dist/index.d.ts",
19
19
  "dependencies": {
20
20
  "date-fns": "^4.4.0",
21
- "@orakl/protocol": "0.4.0"
21
+ "@orakl/protocol": "0.8.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/node": "^26.4.1",