@sudobility/sudojo_lib 0.0.206 → 0.0.208

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,8 +1,9 @@
1
1
  /**
2
2
  * Exact technique bitmasks for game pages.
3
3
  *
4
- * Bit N = technique id N (1-60). A mask with any id >= 54 set exceeds 2^53, so
5
- * the numeric `techniques` field from the API is lossy. The API also sends an
4
+ * Bit N = technique id N (currently 1-60; the wire mask supports 128 bits).
5
+ * A mask with any id >= 54 set exceeds 2^53, so the numeric `techniques`
6
+ * field from the API is lossy. The API also sends an
6
7
  * exact base-10 `techniques_bitmask` string: read it into a `bigint`, and send
7
8
  * it back as a string. Built on sudojo_types' techniqueBitmaskOf /
8
9
  * parseTechniqueBitmask / formatTechniqueBitmask.
@@ -1 +1 @@
1
- {"version":3,"file":"techniqueBitmask.d.ts","sourceRoot":"","sources":["../../src/utils/techniqueBitmask.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,0BAA0B,CAAC;AAElC;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,sBAAsB,GAAG,IAAI,GAAG,SAAS,GAChD,MAAM,CAWR;AAED,sEAAsE;AACtE,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAAG,IAAI,GAAG,SAAS,GAChD,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,sBAAsB,GAAG,IAAI,GAAG,SAAS,GAChD;IACD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,CAWA"}
1
+ {"version":3,"file":"techniqueBitmask.d.ts","sourceRoot":"","sources":["../../src/utils/techniqueBitmask.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,0BAA0B,CAAC;AAElC;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,sBAAsB,GAAG,IAAI,GAAG,SAAS,GAChD,MAAM,CAWR;AAED,sEAAsE;AACtE,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,sBAAsB,GAAG,IAAI,GAAG,SAAS,GAChD,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,sBAAsB,GAAG,IAAI,GAAG,SAAS,GAChD;IACD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,CAWA"}
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  * Exact technique bitmasks for game pages.
3
3
  *
4
- * Bit N = technique id N (1-60). A mask with any id >= 54 set exceeds 2^53, so
5
- * the numeric `techniques` field from the API is lossy. The API also sends an
4
+ * Bit N = technique id N (currently 1-60; the wire mask supports 128 bits).
5
+ * A mask with any id >= 54 set exceeds 2^53, so the numeric `techniques`
6
+ * field from the API is lossy. The API also sends an
6
7
  * exact base-10 `techniques_bitmask` string: read it into a `bigint`, and send
7
8
  * it back as a string. Built on sudojo_types' techniqueBitmaskOf /
8
9
  * parseTechniqueBitmask / formatTechniqueBitmask.
@@ -1 +1 @@
1
- {"version":3,"file":"techniqueBitmask.js","sourceRoot":"","sources":["../../src/utils/techniqueBitmask.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,GAEnB,MAAM,0BAA0B,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAAiD;IAEjD,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,IAAI,CAAC;QACH,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,OAAO,qBAAqB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAClD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;AACH,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,sBAAsB,CACpC,MAAiD;IAEjD,OAAO,sBAAsB,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAiD;IAKjD,IACE,CAAC,MAAM;QACP,CAAC,MAAM,CAAC,UAAU,IAAI,IAAI,IAAI,MAAM,CAAC,kBAAkB,IAAI,IAAI,CAAC,EAChE,CAAC;QACD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;IACxD,CAAC;IACD,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,IAAI;QACrC,kBAAkB,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACnD,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Exact technique bitmasks for game pages.\n *\n * Bit N = technique id N (1-60). A mask with any id >= 54 set exceeds 2^53, so\n * the numeric `techniques` field from the API is lossy. The API also sends an\n * exact base-10 `techniques_bitmask` string: read it into a `bigint`, and send\n * it back as a string. Built on sudojo_types' techniqueBitmaskOf /\n * parseTechniqueBitmask / formatTechniqueBitmask.\n */\n\nimport {\n formatTechniqueBitmask,\n parseTechniqueBitmask,\n techniqueBitmaskOf,\n type TechniqueBitmaskSource,\n} from '@sudobility/sudojo_types';\n\n/**\n * The exact bitmask of a board, daily, validate result or game meta.\n *\n * Unlike `techniqueBitmaskOf`, this never throws, because it runs inside page\n * effects: a malformed `techniques_bitmask` falls back to the numeric field,\n * and an invalid number falls back to `0n`.\n */\nexport function exactTechniqueBitmask(\n source: TechniqueBitmaskSource | null | undefined\n): bigint {\n if (!source) return 0n;\n try {\n return techniqueBitmaskOf(source);\n } catch {\n try {\n return parseTechniqueBitmask(source.techniques);\n } catch {\n return 0n;\n }\n }\n}\n\n/** The exact bitmask as the base-10 string that API requests take. */\nexport function techniqueBitmaskString(\n source: TechniqueBitmaskSource | null | undefined\n): string {\n return formatTechniqueBitmask(exactTechniqueBitmask(source));\n}\n\n/**\n * The `techniques` / `techniques_bitmask` pair to copy onto game meta\n * (CurrentGameMeta) or a resumed Board/Daily. Keeps the (lossy) number and adds\n * the exact string, upgrading legacy meta that only has the number. Both are\n * null when the source carries no bitmask.\n */\nexport function techniqueFieldsOf(\n source: TechniqueBitmaskSource | null | undefined\n): {\n techniques: number | null;\n techniques_bitmask: string | null;\n} {\n if (\n !source ||\n (source.techniques == null && source.techniques_bitmask == null)\n ) {\n return { techniques: null, techniques_bitmask: null };\n }\n return {\n techniques: source.techniques ?? null,\n techniques_bitmask: techniqueBitmaskString(source),\n };\n}\n"]}
1
+ {"version":3,"file":"techniqueBitmask.js","sourceRoot":"","sources":["../../src/utils/techniqueBitmask.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,GAEnB,MAAM,0BAA0B,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAAiD;IAEjD,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,IAAI,CAAC;QACH,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,OAAO,qBAAqB,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAClD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;AACH,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,sBAAsB,CACpC,MAAiD;IAEjD,OAAO,sBAAsB,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAiD;IAKjD,IACE,CAAC,MAAM;QACP,CAAC,MAAM,CAAC,UAAU,IAAI,IAAI,IAAI,MAAM,CAAC,kBAAkB,IAAI,IAAI,CAAC,EAChE,CAAC;QACD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;IACxD,CAAC;IACD,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,IAAI;QACrC,kBAAkB,EAAE,sBAAsB,CAAC,MAAM,CAAC;KACnD,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Exact technique bitmasks for game pages.\n *\n * Bit N = technique id N (currently 1-60; the wire mask supports 128 bits).\n * A mask with any id >= 54 set exceeds 2^53, so the numeric `techniques`\n * field from the API is lossy. The API also sends an\n * exact base-10 `techniques_bitmask` string: read it into a `bigint`, and send\n * it back as a string. Built on sudojo_types' techniqueBitmaskOf /\n * parseTechniqueBitmask / formatTechniqueBitmask.\n */\n\nimport {\n formatTechniqueBitmask,\n parseTechniqueBitmask,\n techniqueBitmaskOf,\n type TechniqueBitmaskSource,\n} from '@sudobility/sudojo_types';\n\n/**\n * The exact bitmask of a board, daily, validate result or game meta.\n *\n * Unlike `techniqueBitmaskOf`, this never throws, because it runs inside page\n * effects: a malformed `techniques_bitmask` falls back to the numeric field,\n * and an invalid number falls back to `0n`.\n */\nexport function exactTechniqueBitmask(\n source: TechniqueBitmaskSource | null | undefined\n): bigint {\n if (!source) return 0n;\n try {\n return techniqueBitmaskOf(source);\n } catch {\n try {\n return parseTechniqueBitmask(source.techniques);\n } catch {\n return 0n;\n }\n }\n}\n\n/** The exact bitmask as the base-10 string that API requests take. */\nexport function techniqueBitmaskString(\n source: TechniqueBitmaskSource | null | undefined\n): string {\n return formatTechniqueBitmask(exactTechniqueBitmask(source));\n}\n\n/**\n * The `techniques` / `techniques_bitmask` pair to copy onto game meta\n * (CurrentGameMeta) or a resumed Board/Daily. Keeps the (lossy) number and adds\n * the exact string, upgrading legacy meta that only has the number. Both are\n * null when the source carries no bitmask.\n */\nexport function techniqueFieldsOf(\n source: TechniqueBitmaskSource | null | undefined\n): {\n techniques: number | null;\n techniques_bitmask: string | null;\n} {\n if (\n !source ||\n (source.techniques == null && source.techniques_bitmask == null)\n ) {\n return { techniques: null, techniques_bitmask: null };\n }\n return {\n techniques: source.techniques ?? null,\n techniques_bitmask: techniqueBitmaskString(source),\n };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudobility/sudojo_lib",
3
- "version": "0.0.206",
3
+ "version": "0.0.208",
4
4
  "description": "Business logic library for Sudojo app",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -46,10 +46,10 @@
46
46
  "author": "Sudobility team",
47
47
  "license": "BUSL-1.1",
48
48
  "devDependencies": {
49
- "@sudobility/di": "^1.5.69",
50
- "@sudobility/sudojo_client": "^0.0.163",
51
- "@sudobility/sudojo_types": "^1.2.72",
52
- "@sudobility/types": "^1.9.68",
49
+ "@sudobility/di": "^1.5.70",
50
+ "@sudobility/sudojo_client": "^0.0.164",
51
+ "@sudobility/sudojo_types": "^1.2.73",
52
+ "@sudobility/types": "^1.9.71",
53
53
  "@tanstack/react-query": "^5.90.11",
54
54
  "@testing-library/dom": "^10.4.1",
55
55
  "@testing-library/react": "^16.3.0",
@@ -72,10 +72,10 @@
72
72
  "zustand": "^5.0.9"
73
73
  },
74
74
  "peerDependencies": {
75
- "@sudobility/di": "^1.5.69",
76
- "@sudobility/sudojo_client": "^0.0.163",
77
- "@sudobility/sudojo_types": "^1.2.72",
78
- "@sudobility/types": "^1.9.68",
75
+ "@sudobility/di": "^1.5.70",
76
+ "@sudobility/sudojo_client": "^0.0.164",
77
+ "@sudobility/sudojo_types": "^1.2.73",
78
+ "@sudobility/types": "^1.9.71",
79
79
  "@tanstack/react-query": ">=5.0.0",
80
80
  "react": ">=18.0.0",
81
81
  "zustand": ">=5.0.0"
@@ -84,7 +84,7 @@
84
84
  "node": ">=18.0.0"
85
85
  },
86
86
  "publishConfig": {
87
- "access": "restricted"
87
+ "access": "public"
88
88
  },
89
89
  "repository": {
90
90
  "type": "git",