@superbuilders/primer-tives 3.6.0 → 3.7.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/errors.js CHANGED
@@ -1,3 +1,41 @@
1
+ var __dispose = Symbol.dispose || /* @__PURE__ */ Symbol.for("Symbol.dispose");
2
+ var __asyncDispose = Symbol.asyncDispose || /* @__PURE__ */ Symbol.for("Symbol.asyncDispose");
3
+ var __using = (stack, value, async) => {
4
+ if (value != null) {
5
+ if (typeof value !== "object" && typeof value !== "function")
6
+ throw TypeError('Object expected to be assigned to "using" declaration');
7
+ var dispose;
8
+ if (async)
9
+ dispose = value[__asyncDispose];
10
+ if (dispose === undefined)
11
+ dispose = value[__dispose];
12
+ if (typeof dispose !== "function")
13
+ throw TypeError("Object not disposable");
14
+ stack.push([async, dispose, value]);
15
+ } else if (async) {
16
+ stack.push([async]);
17
+ }
18
+ return value;
19
+ };
20
+ var __callDispose = (stack, error, hasError) => {
21
+ var E = typeof SuppressedError === "function" ? SuppressedError : function(e, s, m, _) {
22
+ return _ = Error(m), _.name = "SuppressedError", _.error = e, _.suppressed = s, _;
23
+ }, fail = (e) => error = hasError ? new E(e, error, "An error was suppressed during disposal") : (hasError = true, e), next = (it) => {
24
+ while (it = stack.pop()) {
25
+ try {
26
+ var result = it[1] && it[1].call(it[2]);
27
+ if (it[0])
28
+ return Promise.resolve(result).then(next, (e) => (fail(e), next()));
29
+ } catch (e) {
30
+ fail(e);
31
+ }
32
+ }
33
+ if (hasError)
34
+ throw error;
35
+ };
36
+ return next();
37
+ };
38
+
1
39
  // src/errors.ts
2
40
  import * as errors from "@superbuilders/errors";
3
41
  var ErrNetwork = errors.new("network");
@@ -49,4 +87,4 @@ export {
49
87
  ErrAuthCallbackInvalid
50
88
  };
51
89
 
52
- //# debugId=9476780C10F3E50264756E2164756E21
90
+ //# debugId=F4603776582E44E364756E2164756E21
@@ -4,7 +4,7 @@
4
4
  "sourcesContent": [
5
5
  "import * as errors from \"@superbuilders/errors\"\n\nconst ErrNetwork = errors.new(\"network\")\nconst ErrJsonParse = errors.new(\"json parse\")\nconst ErrUnsupportedPci = errors.new(\"unsupported pci\")\nconst ErrInvalidAccessToken = errors.new(\"invalid access token\")\nconst ErrMalformedAccessToken = errors.new(\"malformed access token\")\nconst ErrTokenExpired = errors.new(\"access token expired\")\nconst ErrBadRequest = errors.new(\"bad request\")\nconst ErrServerError = errors.new(\"server error\")\nconst ErrTimeout = errors.new(\"timeout\")\nconst ErrForbidden = errors.new(\"forbidden\")\nconst ErrNotFound = errors.new(\"not found\")\nconst ErrConflict = errors.new(\"conflict\")\nconst ErrRateLimited = errors.new(\"rate limited\")\nconst ErrServiceUnavailable = errors.new(\"service unavailable\")\nconst ErrNotSerializable = errors.new(\n\t\"PrimerState is live in-memory state and must not be serialized or stored\"\n)\nconst ErrInvalidSubmission = errors.new(\"invalid submission\")\nconst ErrAuthUnavailable = errors.new(\"auth unavailable\")\nconst ErrAuthConfigInvalid = errors.new(\"auth config invalid\")\nconst ErrAuthCallbackInvalid = errors.new(\"auth callback invalid\")\nconst ErrAuthStateMismatch = errors.new(\"auth state mismatch\")\nconst ErrAuthPopupBlocked = errors.new(\"auth popup blocked\")\nconst ErrAuthCancelled = errors.new(\"auth cancelled\")\n\nconst ErrSdkUpgradeRequired = errors.new(\"sdk upgrade required\")\n\nexport {\n\tErrAuthCallbackInvalid,\n\tErrAuthCancelled,\n\tErrAuthConfigInvalid,\n\tErrAuthPopupBlocked,\n\tErrAuthStateMismatch,\n\tErrAuthUnavailable,\n\tErrBadRequest,\n\tErrConflict,\n\tErrForbidden,\n\tErrInvalidAccessToken,\n\tErrInvalidSubmission,\n\tErrJsonParse,\n\tErrMalformedAccessToken,\n\tErrNetwork,\n\tErrNotFound,\n\tErrNotSerializable,\n\tErrRateLimited,\n\tErrSdkUpgradeRequired,\n\tErrServerError,\n\tErrServiceUnavailable,\n\tErrTimeout,\n\tErrTokenExpired,\n\tErrUnsupported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AAM,eAAsB,WAAI,WAAW;AAC3C,IAAM,cAAqB,WAAI,WAAW;AAC1C,IAAM,cAAqB,WAAI,UAAU;AACzC,IAAM,iBAAwB,WAAI,cAAc;AAChD,IAAM,wBAA+B,WAAI,qBAAqB;AAC9D,IAAM,qBAA4B,WACjC,0EACD;AACA,IAAM,uBAA8B,WAAI,oBAAoB;AAC5D,IAAM,qBAA4B,WAAI,kBAAkB;AACxD,IAAM,uBAA8B,WAAI,qBAAqB;AAC7D,IAAM,yBAAgC,WAAI,uBAAuB;AACjE,IAAM,uBAA8B,WAAI,qBAAqB;AAC7D,IAAM,sBAA6B,WAAI,oBAAoB;AAC3D,IAAM,mBAA0B,WAAI,gBAAgB;AAEpD,IAAM,wBAA+B,WAAI,sBAAsB;",
8
+ "debugId": "F4603776582E44E364756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,7 +1,45 @@
1
+ var __dispose = Symbol.dispose || /* @__PURE__ */ Symbol.for("Symbol.dispose");
2
+ var __asyncDispose = Symbol.asyncDispose || /* @__PURE__ */ Symbol.for("Symbol.asyncDispose");
3
+ var __using = (stack, value, async) => {
4
+ if (value != null) {
5
+ if (typeof value !== "object" && typeof value !== "function")
6
+ throw TypeError('Object expected to be assigned to "using" declaration');
7
+ var dispose;
8
+ if (async)
9
+ dispose = value[__asyncDispose];
10
+ if (dispose === undefined)
11
+ dispose = value[__dispose];
12
+ if (typeof dispose !== "function")
13
+ throw TypeError("Object not disposable");
14
+ stack.push([async, dispose, value]);
15
+ } else if (async) {
16
+ stack.push([async]);
17
+ }
18
+ return value;
19
+ };
20
+ var __callDispose = (stack, error, hasError) => {
21
+ var E = typeof SuppressedError === "function" ? SuppressedError : function(e, s, m, _) {
22
+ return _ = Error(m), _.name = "SuppressedError", _.error = e, _.suppressed = s, _;
23
+ }, fail = (e) => error = hasError ? new E(e, error, "An error was suppressed during disposal") : (hasError = true, e), next = (it) => {
24
+ while (it = stack.pop()) {
25
+ try {
26
+ var result = it[1] && it[1].call(it[2]);
27
+ if (it[0])
28
+ return Promise.resolve(result).then(next, (e) => (fail(e), next()));
29
+ } catch (e) {
30
+ fail(e);
31
+ }
32
+ }
33
+ if (hasError)
34
+ throw error;
35
+ };
36
+ return next();
37
+ };
38
+
1
39
  // src/grade-level.ts
2
40
  var GRADE_LEVELS = ["K", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
3
41
  export {
4
42
  GRADE_LEVELS
5
43
  };
6
44
 
7
- //# debugId=7541947FD2521C6164756E2164756E21
45
+ //# debugId=A27B8B54C39BAA9864756E2164756E21
@@ -4,7 +4,7 @@
4
4
  "sourcesContent": [
5
5
  "const GRADE_LEVELS = [\"K\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\", \"11\", \"12\"] as const\n\ntype GradeLevel = (typeof GRADE_LEVELS)[number]\n\nexport { GRADE_LEVELS }\nexport type { GradeLevel }\n"
6
6
  ],
7
- "mappings": ";AAAA,IAAM,eAAe,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,MAAM,MAAM,IAAI;",
8
- "debugId": "7541947FD2521C6164756E2164756E21",
7
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,eAAe,CAAC,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,MAAM,MAAM,IAAI;",
8
+ "debugId": "A27B8B54C39BAA9864756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,3 +1,41 @@
1
+ var __dispose = Symbol.dispose || /* @__PURE__ */ Symbol.for("Symbol.dispose");
2
+ var __asyncDispose = Symbol.asyncDispose || /* @__PURE__ */ Symbol.for("Symbol.asyncDispose");
3
+ var __using = (stack, value, async) => {
4
+ if (value != null) {
5
+ if (typeof value !== "object" && typeof value !== "function")
6
+ throw TypeError('Object expected to be assigned to "using" declaration');
7
+ var dispose;
8
+ if (async)
9
+ dispose = value[__asyncDispose];
10
+ if (dispose === undefined)
11
+ dispose = value[__dispose];
12
+ if (typeof dispose !== "function")
13
+ throw TypeError("Object not disposable");
14
+ stack.push([async, dispose, value]);
15
+ } else if (async) {
16
+ stack.push([async]);
17
+ }
18
+ return value;
19
+ };
20
+ var __callDispose = (stack, error, hasError) => {
21
+ var E = typeof SuppressedError === "function" ? SuppressedError : function(e, s, m, _) {
22
+ return _ = Error(m), _.name = "SuppressedError", _.error = e, _.suppressed = s, _;
23
+ }, fail = (e) => error = hasError ? new E(e, error, "An error was suppressed during disposal") : (hasError = true, e), next = (it) => {
24
+ while (it = stack.pop()) {
25
+ try {
26
+ var result = it[1] && it[1].call(it[2]);
27
+ if (it[0])
28
+ return Promise.resolve(result).then(next, (e) => (fail(e), next()));
29
+ } catch (e) {
30
+ fail(e);
31
+ }
32
+ }
33
+ if (hasError)
34
+ throw error;
35
+ };
36
+ return next();
37
+ };
38
+
1
39
  // src/subject.ts
2
40
  var SUBJECTS = ["math", "vocabulary", "science"];
3
41
  // src/subject-pcis.ts
@@ -36,4 +74,4 @@ export {
36
74
  REQUIRED_PCIS_BY_SUBJECT
37
75
  };
38
76
 
39
- //# debugId=1F65043574FED0F364756E2164756E21
77
+ //# debugId=6DD969AA90D542F064756E2164756E21
@@ -5,7 +5,7 @@
5
5
  "const SUBJECTS = [\"math\", \"vocabulary\", \"science\"] as const\n\ntype Subject = (typeof SUBJECTS)[number]\n\nexport { SUBJECTS }\nexport type { Subject }\n",
6
6
  "import type { PciId } from \"@superbuilders/primer-tives/contracts/pci\"\nimport { SUBJECTS, type Subject } from \"@superbuilders/primer-tives/subject\"\n\nconst REQUIRED_PCIS_BY_SUBJECT = {\n\tmath: [\"urn:primer:pci:fraction-input\"],\n\tvocabulary: [],\n\tscience: []\n} as const satisfies Record<Subject, readonly PciId[]>\n\ntype RequiredPciForKnownSubject<S extends Subject> = (typeof REQUIRED_PCIS_BY_SUBJECT)[S][number]\ntype RequiredPciForAllSubjects = (typeof REQUIRED_PCIS_BY_SUBJECT)[Subject][number]\ntype RequiredPciForSubject<S extends Subject | undefined> = S extends undefined\n\t? RequiredPciForAllSubjects\n\t: S extends Subject\n\t\t? RequiredPciForKnownSubject<S>\n\t\t: never\ntype MissingRequiredPcis<Required extends PciId, Supported extends readonly PciId[]> = Exclude<\n\tRequired,\n\tSupported[number]\n>\ntype HasRequiredPcis<Required extends PciId, Supported extends readonly PciId[]> = [\n\tMissingRequiredPcis<Required, Supported>\n] extends [never]\n\t? true\n\t: false\n\nfunction requiredPcisForSubject(subject: Subject | undefined): readonly PciId[] {\n\tif (subject === undefined) {\n\t\tconst all: PciId[] = []\n\t\tfor (const s of SUBJECTS) {\n\t\t\tfor (const pci of REQUIRED_PCIS_BY_SUBJECT[s]) {\n\t\t\t\tif (!all.includes(pci)) {\n\t\t\t\t\tall.push(pci)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn all\n\t}\n\treturn REQUIRED_PCIS_BY_SUBJECT[subject]\n}\n\nfunction missingPcisForSubject(\n\tsubject: Subject | undefined,\n\tprovided: readonly string[] | undefined\n): PciId[] {\n\tconst required = requiredPcisForSubject(subject)\n\tconst missing: PciId[] = []\n\tfor (const pci of required) {\n\t\tif (provided === undefined || !provided.includes(pci)) {\n\t\t\tmissing.push(pci)\n\t\t}\n\t}\n\treturn missing\n}\n\nexport { REQUIRED_PCIS_BY_SUBJECT, missingPcisForSubject, requiredPcisForSubject }\nexport type { HasRequiredPcis, MissingRequiredPcis, RequiredPciForSubject }\n"
7
7
  ],
8
- "mappings": ";AAAA,IAAM,WAAW,CAAC,QAAQ,cAAc,SAAS;;ACGjD,IAAM,2BAA2B;AAAA,EAChC,MAAM,CAAC,+BAA+B;AAAA,EACtC,YAAY,CAAC;AAAA,EACb,SAAS,CAAC;AACX;AAmBA,SAAS,sBAAsB,CAAC,SAAgD;AAAA,EAC/E,IAAI,YAAY,WAAW;AAAA,IAC1B,MAAM,MAAe,CAAC;AAAA,IACtB,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,IAC3B,IAAI,aAAa,aAAa,CAAC,SAAS,SAAS,GAAG,GAAG;AAAA,MACtD,QAAQ,KAAK,GAAG;AAAA,IACjB;AAAA,EACD;AAAA,EACA,OAAO;AAAA;",
9
+ "debugId": "6DD969AA90D542F064756E2164756E21",
10
10
  "names": []
11
11
  }
package/dist/subject.js CHANGED
@@ -1,7 +1,45 @@
1
+ var __dispose = Symbol.dispose || /* @__PURE__ */ Symbol.for("Symbol.dispose");
2
+ var __asyncDispose = Symbol.asyncDispose || /* @__PURE__ */ Symbol.for("Symbol.asyncDispose");
3
+ var __using = (stack, value, async) => {
4
+ if (value != null) {
5
+ if (typeof value !== "object" && typeof value !== "function")
6
+ throw TypeError('Object expected to be assigned to "using" declaration');
7
+ var dispose;
8
+ if (async)
9
+ dispose = value[__asyncDispose];
10
+ if (dispose === undefined)
11
+ dispose = value[__dispose];
12
+ if (typeof dispose !== "function")
13
+ throw TypeError("Object not disposable");
14
+ stack.push([async, dispose, value]);
15
+ } else if (async) {
16
+ stack.push([async]);
17
+ }
18
+ return value;
19
+ };
20
+ var __callDispose = (stack, error, hasError) => {
21
+ var E = typeof SuppressedError === "function" ? SuppressedError : function(e, s, m, _) {
22
+ return _ = Error(m), _.name = "SuppressedError", _.error = e, _.suppressed = s, _;
23
+ }, fail = (e) => error = hasError ? new E(e, error, "An error was suppressed during disposal") : (hasError = true, e), next = (it) => {
24
+ while (it = stack.pop()) {
25
+ try {
26
+ var result = it[1] && it[1].call(it[2]);
27
+ if (it[0])
28
+ return Promise.resolve(result).then(next, (e) => (fail(e), next()));
29
+ } catch (e) {
30
+ fail(e);
31
+ }
32
+ }
33
+ if (hasError)
34
+ throw error;
35
+ };
36
+ return next();
37
+ };
38
+
1
39
  // src/subject.ts
2
40
  var SUBJECTS = ["math", "vocabulary", "science"];
3
41
  export {
4
42
  SUBJECTS
5
43
  };
6
44
 
7
- //# debugId=60AAA236541906F764756E2164756E21
45
+ //# debugId=D538CEA7760C3A1464756E2164756E21
@@ -4,7 +4,7 @@
4
4
  "sourcesContent": [
5
5
  "const SUBJECTS = [\"math\", \"vocabulary\", \"science\"] as const\n\ntype Subject = (typeof SUBJECTS)[number]\n\nexport { SUBJECTS }\nexport type { Subject }\n"
6
6
  ],
7
- "mappings": ";AAAA,IAAM,WAAW,CAAC,QAAQ,cAAc,SAAS;",
8
- "debugId": "60AAA236541906F764756E2164756E21",
7
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,WAAW,CAAC,QAAQ,cAAc,SAAS;",
8
+ "debugId": "D538CEA7760C3A1464756E2164756E21",
9
9
  "names": []
10
10
  }
package/dist/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- declare const SDK_VERSION = "3.6.0";
1
+ declare const SDK_VERSION = "3.7.0";
2
2
  declare const NPM_PACKAGE_URL = "https://www.npmjs.com/package/@superbuilders/primer-tives";
3
3
  export { NPM_PACKAGE_URL, SDK_VERSION };
4
4
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superbuilders/primer-tives",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  "./client": {