@hot-updater/console 0.20.0-rc.0 → 0.20.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/dist/index.cjs CHANGED
@@ -325,7 +325,7 @@ var getPattern = (label) => {
325
325
  if (!patternCache[label]) if (match[2]) patternCache[label] = [
326
326
  label,
327
327
  match[1],
328
- new RegExp("^" + match[2] + "$")
328
+ /* @__PURE__ */ new RegExp("^" + match[2] + "$")
329
329
  ];
330
330
  else patternCache[label] = [
331
331
  label,
@@ -1033,7 +1033,7 @@ var LABEL_REG_EXP_STR = "[^/]+";
1033
1033
  var ONLY_WILDCARD_REG_EXP_STR = ".*";
1034
1034
  var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
1035
1035
  var PATH_ERROR = Symbol();
1036
- var regExpMetaChars = new Set(".\\+*[^]$()");
1036
+ var regExpMetaChars = /* @__PURE__ */ new Set(".\\+*[^]$()");
1037
1037
  function compareKey(a, b) {
1038
1038
  if (a.length === 1) return b.length === 1 ? a < b ? -1 : 1 : -1;
1039
1039
  if (b.length === 1) return 1;
@@ -1159,7 +1159,7 @@ var Trie = class {
1159
1159
  return "";
1160
1160
  });
1161
1161
  return [
1162
- new RegExp(`^${regexp}`),
1162
+ /* @__PURE__ */ new RegExp(`^${regexp}`),
1163
1163
  indexReplacementMap,
1164
1164
  paramReplacementMap
1165
1165
  ];
@@ -1176,7 +1176,7 @@ var nullMatcher = [
1176
1176
  ];
1177
1177
  var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
1178
1178
  function buildWildcardRegExp(path$2) {
1179
- return wildcardRegExpCache[path$2] ??= new RegExp(path$2 === "*" ? "" : `^${path$2.replace(/\/\*$|([.\\+*[^\]$()])/g, (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)")}$`);
1179
+ return wildcardRegExpCache[path$2] ??= /* @__PURE__ */ new RegExp(path$2 === "*" ? "" : `^${path$2.replace(/\/\*$|([.\\+*[^\]$()])/g, (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)")}$`);
1180
1180
  }
1181
1181
  function clearWildcardRegExpCache() {
1182
1182
  wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
@@ -1532,7 +1532,7 @@ var Hono = class extends Hono$1 {
1532
1532
 
1533
1533
  //#endregion
1534
1534
  //#region ../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_validateReport.js
1535
- var require__validateReport = __commonJS({ "../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_validateReport.js"(exports) {
1535
+ var require__validateReport = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_validateReport.js": ((exports) => {
1536
1536
  Object.defineProperty(exports, "__esModule", { value: true });
1537
1537
  exports._validateReport = void 0;
1538
1538
  const _validateReport = (array) => {
@@ -1547,7 +1547,7 @@ var require__validateReport = __commonJS({ "../../node_modules/.pnpm/typia@8.0.3
1547
1547
  };
1548
1548
  };
1549
1549
  exports._validateReport = _validateReport;
1550
- } });
1550
+ }) });
1551
1551
 
1552
1552
  //#endregion
1553
1553
  //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/cookie.js
@@ -1680,6 +1680,7 @@ var validator = (target, validationFunc) => {
1680
1680
 
1681
1681
  //#endregion
1682
1682
  //#region ../../node_modules/.pnpm/@hono+typia-validator@0.1.2_hono@4.6.3_typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3_/node_modules/@hono/typia-validator/dist/esm/index.js
1683
+ var import__validateReport = /* @__PURE__ */ __toESM(require__validateReport(), 1);
1683
1684
  const typiaValidator = (target, validate, hook) => validator(target, async (value, c) => {
1684
1685
  const result = validate(value);
1685
1686
  if (hook) {
@@ -1701,7 +1702,6 @@ const typiaValidator = (target, validate, hook) => validator(target, async (valu
1701
1702
 
1702
1703
  //#endregion
1703
1704
  //#region src-server/rpc.ts
1704
- var import__validateReport = __toESM(require__validateReport());
1705
1705
  const DEFAULT_PAGE_LIMIT = 20;
1706
1706
  const DEFAULT_PAGE_OFFSET = 0;
1707
1707
  const queryBundlesSchema = (() => {
@@ -1905,6 +1905,112 @@ const updateBundleSchema = (() => {
1905
1905
  };
1906
1906
  };
1907
1907
  })();
1908
+ const createBundleSchema = (() => {
1909
+ const _io0 = (input) => "string" === typeof input.id && ("ios" === input.platform || "android" === input.platform) && "boolean" === typeof input.shouldForceUpdate && "boolean" === typeof input.enabled && "string" === typeof input.fileHash && "string" === typeof input.storageUri && (null === input.gitCommitHash || "string" === typeof input.gitCommitHash) && (null === input.message || "string" === typeof input.message) && "string" === typeof input.channel && (null === input.targetAppVersion || "string" === typeof input.targetAppVersion) && (null === input.fingerprintHash || "string" === typeof input.fingerprintHash) && (void 0 === input.metadata || "object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) && _io1(input.metadata));
1910
+ const _io1 = (input) => void 0 === input.app_version || "string" === typeof input.app_version;
1911
+ const _vo0 = (input, _path, _exceptionable = true) => [
1912
+ "string" === typeof input.id || _report(_exceptionable, {
1913
+ path: _path + ".id",
1914
+ expected: "string",
1915
+ value: input.id
1916
+ }),
1917
+ "ios" === input.platform || "android" === input.platform || _report(_exceptionable, {
1918
+ path: _path + ".platform",
1919
+ expected: "(\"android\" | \"ios\")",
1920
+ value: input.platform
1921
+ }),
1922
+ "boolean" === typeof input.shouldForceUpdate || _report(_exceptionable, {
1923
+ path: _path + ".shouldForceUpdate",
1924
+ expected: "boolean",
1925
+ value: input.shouldForceUpdate
1926
+ }),
1927
+ "boolean" === typeof input.enabled || _report(_exceptionable, {
1928
+ path: _path + ".enabled",
1929
+ expected: "boolean",
1930
+ value: input.enabled
1931
+ }),
1932
+ "string" === typeof input.fileHash || _report(_exceptionable, {
1933
+ path: _path + ".fileHash",
1934
+ expected: "string",
1935
+ value: input.fileHash
1936
+ }),
1937
+ "string" === typeof input.storageUri || _report(_exceptionable, {
1938
+ path: _path + ".storageUri",
1939
+ expected: "string",
1940
+ value: input.storageUri
1941
+ }),
1942
+ null === input.gitCommitHash || "string" === typeof input.gitCommitHash || _report(_exceptionable, {
1943
+ path: _path + ".gitCommitHash",
1944
+ expected: "(null | string)",
1945
+ value: input.gitCommitHash
1946
+ }),
1947
+ null === input.message || "string" === typeof input.message || _report(_exceptionable, {
1948
+ path: _path + ".message",
1949
+ expected: "(null | string)",
1950
+ value: input.message
1951
+ }),
1952
+ "string" === typeof input.channel || _report(_exceptionable, {
1953
+ path: _path + ".channel",
1954
+ expected: "string",
1955
+ value: input.channel
1956
+ }),
1957
+ null === input.targetAppVersion || "string" === typeof input.targetAppVersion || _report(_exceptionable, {
1958
+ path: _path + ".targetAppVersion",
1959
+ expected: "(null | string)",
1960
+ value: input.targetAppVersion
1961
+ }),
1962
+ null === input.fingerprintHash || "string" === typeof input.fingerprintHash || _report(_exceptionable, {
1963
+ path: _path + ".fingerprintHash",
1964
+ expected: "(null | string)",
1965
+ value: input.fingerprintHash
1966
+ }),
1967
+ void 0 === input.metadata || ("object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) || _report(_exceptionable, {
1968
+ path: _path + ".metadata",
1969
+ expected: "(BundleMetadata | undefined)",
1970
+ value: input.metadata
1971
+ })) && _vo1(input.metadata, _path + ".metadata", _exceptionable) || _report(_exceptionable, {
1972
+ path: _path + ".metadata",
1973
+ expected: "(BundleMetadata | undefined)",
1974
+ value: input.metadata
1975
+ })
1976
+ ].every((flag) => flag);
1977
+ const _vo1 = (input, _path, _exceptionable = true) => [void 0 === input.app_version || "string" === typeof input.app_version || _report(_exceptionable, {
1978
+ path: _path + ".app_version",
1979
+ expected: "(string | undefined)",
1980
+ value: input.app_version
1981
+ })].every((flag) => flag);
1982
+ const __is = (input) => "object" === typeof input && null !== input && _io0(input);
1983
+ let errors;
1984
+ let _report;
1985
+ return (input) => {
1986
+ if (false === __is(input)) {
1987
+ errors = [];
1988
+ _report = import__validateReport._validateReport(errors);
1989
+ ((input$1, _path, _exceptionable = true) => ("object" === typeof input$1 && null !== input$1 || _report(true, {
1990
+ path: _path + "",
1991
+ expected: "Bundle",
1992
+ value: input$1
1993
+ })) && _vo0(input$1, _path + "", true) || _report(true, {
1994
+ path: _path + "",
1995
+ expected: "Bundle",
1996
+ value: input$1
1997
+ }))(input, "$input", true);
1998
+ const success = 0 === errors.length;
1999
+ return success ? {
2000
+ success,
2001
+ data: input
2002
+ } : {
2003
+ success,
2004
+ errors,
2005
+ data: input
2006
+ };
2007
+ }
2008
+ return {
2009
+ success: true,
2010
+ data: input
2011
+ };
2012
+ };
2013
+ })();
1908
2014
  let configPromise = null;
1909
2015
  const prepareConfig = async () => {
1910
2016
  if (!configPromise) configPromise = (async () => {
@@ -1997,6 +2103,21 @@ const rpc = new Hono().get("/config", async (c) => {
1997
2103
  if (error && typeof error === "object" && "message" in error) return c.json({ error: error.message }, 500);
1998
2104
  return c.json({ error: "Unknown error" }, 500);
1999
2105
  }
2106
+ }).post("/bundles", typiaValidator("json", createBundleSchema), async (c) => {
2107
+ try {
2108
+ const bundle = c.req.valid("json");
2109
+ const { databasePlugin } = await prepareConfig();
2110
+ await databasePlugin.appendBundle(bundle);
2111
+ await databasePlugin.commitBundle();
2112
+ return c.json({
2113
+ success: true,
2114
+ bundleId: bundle.id
2115
+ });
2116
+ } catch (error) {
2117
+ console.error("Error during bundle creation:", error);
2118
+ if (error && typeof error === "object" && "message" in error) return c.json({ error: error.message }, 500);
2119
+ return c.json({ error: "Unknown error" }, 500);
2120
+ }
2000
2121
  }).delete("/bundles/:bundleId", typiaValidator("param", paramBundleIdSchema), async (c) => {
2001
2122
  try {
2002
2123
  const { bundleId } = c.req.valid("param");
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as hono_utils_http_status0 from "hono/utils/http-status";
2
- import * as _hot_updater_core4 from "@hot-updater/core";
2
+ import * as _hot_updater_core0 from "@hot-updater/core";
3
3
  import { Hono } from "hono";
4
4
 
5
5
  //#region src-server/index.d.ts
@@ -52,7 +52,7 @@ declare const app: Hono<{}, {
52
52
  output: {
53
53
  data: {
54
54
  id: string;
55
- platform: _hot_updater_core4.Platform;
55
+ platform: _hot_updater_core0.Platform;
56
56
  shouldForceUpdate: boolean;
57
57
  enabled: boolean;
58
58
  fileHash: string;
@@ -77,6 +77,26 @@ declare const app: Hono<{}, {
77
77
  outputFormat: "json";
78
78
  status: hono_utils_http_status0.StatusCode;
79
79
  };
80
+ $post: {
81
+ input: {
82
+ json: _hot_updater_core0.Bundle;
83
+ };
84
+ output: {
85
+ success: boolean;
86
+ bundleId: string;
87
+ };
88
+ outputFormat: "json";
89
+ status: hono_utils_http_status0.StatusCode;
90
+ } | {
91
+ input: {
92
+ json: _hot_updater_core0.Bundle;
93
+ };
94
+ output: {
95
+ error: string;
96
+ };
97
+ outputFormat: "json";
98
+ status: 500;
99
+ };
80
100
  } | {
81
101
  $get: {
82
102
  input: {
@@ -86,7 +106,7 @@ declare const app: Hono<{}, {
86
106
  };
87
107
  output: {
88
108
  id: string;
89
- platform: _hot_updater_core4.Platform;
109
+ platform: _hot_updater_core0.Platform;
90
110
  shouldForceUpdate: boolean;
91
111
  enabled: boolean;
92
112
  fileHash: string;
@@ -105,7 +125,7 @@ declare const app: Hono<{}, {
105
125
  };
106
126
  $patch: {
107
127
  input: {
108
- json: Partial<_hot_updater_core4.Bundle>;
128
+ json: Partial<_hot_updater_core0.Bundle>;
109
129
  } & {
110
130
  param: {
111
131
  bundleId: string;
@@ -118,7 +138,7 @@ declare const app: Hono<{}, {
118
138
  status: 400;
119
139
  } | {
120
140
  input: {
121
- json: Partial<_hot_updater_core4.Bundle>;
141
+ json: Partial<_hot_updater_core0.Bundle>;
122
142
  } & {
123
143
  param: {
124
144
  bundleId: string;
@@ -131,7 +151,7 @@ declare const app: Hono<{}, {
131
151
  status: hono_utils_http_status0.StatusCode;
132
152
  } | {
133
153
  input: {
134
- json: Partial<_hot_updater_core4.Bundle>;
154
+ json: Partial<_hot_updater_core0.Bundle>;
135
155
  } & {
136
156
  param: {
137
157
  bundleId: string;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as hono_utils_http_status0 from "hono/utils/http-status";
2
- import * as _hot_updater_core4 from "@hot-updater/core";
2
+ import * as _hot_updater_core0 from "@hot-updater/core";
3
3
  import { Hono } from "hono";
4
4
 
5
5
  //#region src-server/index.d.ts
@@ -52,7 +52,7 @@ declare const app: Hono<{}, {
52
52
  output: {
53
53
  data: {
54
54
  id: string;
55
- platform: _hot_updater_core4.Platform;
55
+ platform: _hot_updater_core0.Platform;
56
56
  shouldForceUpdate: boolean;
57
57
  enabled: boolean;
58
58
  fileHash: string;
@@ -77,6 +77,26 @@ declare const app: Hono<{}, {
77
77
  outputFormat: "json";
78
78
  status: hono_utils_http_status0.StatusCode;
79
79
  };
80
+ $post: {
81
+ input: {
82
+ json: _hot_updater_core0.Bundle;
83
+ };
84
+ output: {
85
+ success: boolean;
86
+ bundleId: string;
87
+ };
88
+ outputFormat: "json";
89
+ status: hono_utils_http_status0.StatusCode;
90
+ } | {
91
+ input: {
92
+ json: _hot_updater_core0.Bundle;
93
+ };
94
+ output: {
95
+ error: string;
96
+ };
97
+ outputFormat: "json";
98
+ status: 500;
99
+ };
80
100
  } | {
81
101
  $get: {
82
102
  input: {
@@ -86,7 +106,7 @@ declare const app: Hono<{}, {
86
106
  };
87
107
  output: {
88
108
  id: string;
89
- platform: _hot_updater_core4.Platform;
109
+ platform: _hot_updater_core0.Platform;
90
110
  shouldForceUpdate: boolean;
91
111
  enabled: boolean;
92
112
  fileHash: string;
@@ -105,7 +125,7 @@ declare const app: Hono<{}, {
105
125
  };
106
126
  $patch: {
107
127
  input: {
108
- json: Partial<_hot_updater_core4.Bundle>;
128
+ json: Partial<_hot_updater_core0.Bundle>;
109
129
  } & {
110
130
  param: {
111
131
  bundleId: string;
@@ -118,7 +138,7 @@ declare const app: Hono<{}, {
118
138
  status: 400;
119
139
  } | {
120
140
  input: {
121
- json: Partial<_hot_updater_core4.Bundle>;
141
+ json: Partial<_hot_updater_core0.Bundle>;
122
142
  } & {
123
143
  param: {
124
144
  bundleId: string;
@@ -131,7 +151,7 @@ declare const app: Hono<{}, {
131
151
  status: hono_utils_http_status0.StatusCode;
132
152
  } | {
133
153
  input: {
134
- json: Partial<_hot_updater_core4.Bundle>;
154
+ json: Partial<_hot_updater_core0.Bundle>;
135
155
  } & {
136
156
  param: {
137
157
  bundleId: string;
package/dist/index.html CHANGED
@@ -5,8 +5,8 @@
5
5
  <link rel="icon" type="image/x-icon" href="/assets/favicon-BkwcEHsj.ico" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Hot Updater Console</title>
8
- <script type="module" crossorigin src="/assets/index-B7wIrWdR.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-9iY4CVPq.css">
8
+ <script type="module" crossorigin src="/assets/index-nGJHe5si.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-DUlKsori.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
package/dist/index.js CHANGED
@@ -325,7 +325,7 @@ var getPattern = (label) => {
325
325
  if (!patternCache[label]) if (match[2]) patternCache[label] = [
326
326
  label,
327
327
  match[1],
328
- new RegExp("^" + match[2] + "$")
328
+ /* @__PURE__ */ new RegExp("^" + match[2] + "$")
329
329
  ];
330
330
  else patternCache[label] = [
331
331
  label,
@@ -1033,7 +1033,7 @@ var LABEL_REG_EXP_STR = "[^/]+";
1033
1033
  var ONLY_WILDCARD_REG_EXP_STR = ".*";
1034
1034
  var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
1035
1035
  var PATH_ERROR = Symbol();
1036
- var regExpMetaChars = new Set(".\\+*[^]$()");
1036
+ var regExpMetaChars = /* @__PURE__ */ new Set(".\\+*[^]$()");
1037
1037
  function compareKey(a, b) {
1038
1038
  if (a.length === 1) return b.length === 1 ? a < b ? -1 : 1 : -1;
1039
1039
  if (b.length === 1) return 1;
@@ -1159,7 +1159,7 @@ var Trie = class {
1159
1159
  return "";
1160
1160
  });
1161
1161
  return [
1162
- new RegExp(`^${regexp}`),
1162
+ /* @__PURE__ */ new RegExp(`^${regexp}`),
1163
1163
  indexReplacementMap,
1164
1164
  paramReplacementMap
1165
1165
  ];
@@ -1176,7 +1176,7 @@ var nullMatcher = [
1176
1176
  ];
1177
1177
  var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
1178
1178
  function buildWildcardRegExp(path$1) {
1179
- return wildcardRegExpCache[path$1] ??= new RegExp(path$1 === "*" ? "" : `^${path$1.replace(/\/\*$|([.\\+*[^\]$()])/g, (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)")}$`);
1179
+ return wildcardRegExpCache[path$1] ??= /* @__PURE__ */ new RegExp(path$1 === "*" ? "" : `^${path$1.replace(/\/\*$|([.\\+*[^\]$()])/g, (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)")}$`);
1180
1180
  }
1181
1181
  function clearWildcardRegExpCache() {
1182
1182
  wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
@@ -1532,7 +1532,7 @@ var Hono = class extends Hono$1 {
1532
1532
 
1533
1533
  //#endregion
1534
1534
  //#region ../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_validateReport.js
1535
- var require__validateReport = __commonJS({ "../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_validateReport.js"(exports) {
1535
+ var require__validateReport = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_validateReport.js": ((exports) => {
1536
1536
  Object.defineProperty(exports, "__esModule", { value: true });
1537
1537
  exports._validateReport = void 0;
1538
1538
  const _validateReport = (array) => {
@@ -1547,7 +1547,7 @@ var require__validateReport = __commonJS({ "../../node_modules/.pnpm/typia@8.0.3
1547
1547
  };
1548
1548
  };
1549
1549
  exports._validateReport = _validateReport;
1550
- } });
1550
+ }) });
1551
1551
 
1552
1552
  //#endregion
1553
1553
  //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/cookie.js
@@ -1680,6 +1680,7 @@ var validator = (target, validationFunc) => {
1680
1680
 
1681
1681
  //#endregion
1682
1682
  //#region ../../node_modules/.pnpm/@hono+typia-validator@0.1.2_hono@4.6.3_typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3_/node_modules/@hono/typia-validator/dist/esm/index.js
1683
+ var import__validateReport = /* @__PURE__ */ __toESM(require__validateReport(), 1);
1683
1684
  const typiaValidator = (target, validate, hook) => validator(target, async (value, c) => {
1684
1685
  const result = validate(value);
1685
1686
  if (hook) {
@@ -1701,7 +1702,6 @@ const typiaValidator = (target, validate, hook) => validator(target, async (valu
1701
1702
 
1702
1703
  //#endregion
1703
1704
  //#region src-server/rpc.ts
1704
- var import__validateReport = __toESM(require__validateReport());
1705
1705
  const DEFAULT_PAGE_LIMIT = 20;
1706
1706
  const DEFAULT_PAGE_OFFSET = 0;
1707
1707
  const queryBundlesSchema = (() => {
@@ -1905,6 +1905,112 @@ const updateBundleSchema = (() => {
1905
1905
  };
1906
1906
  };
1907
1907
  })();
1908
+ const createBundleSchema = (() => {
1909
+ const _io0 = (input) => "string" === typeof input.id && ("ios" === input.platform || "android" === input.platform) && "boolean" === typeof input.shouldForceUpdate && "boolean" === typeof input.enabled && "string" === typeof input.fileHash && "string" === typeof input.storageUri && (null === input.gitCommitHash || "string" === typeof input.gitCommitHash) && (null === input.message || "string" === typeof input.message) && "string" === typeof input.channel && (null === input.targetAppVersion || "string" === typeof input.targetAppVersion) && (null === input.fingerprintHash || "string" === typeof input.fingerprintHash) && (void 0 === input.metadata || "object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) && _io1(input.metadata));
1910
+ const _io1 = (input) => void 0 === input.app_version || "string" === typeof input.app_version;
1911
+ const _vo0 = (input, _path, _exceptionable = true) => [
1912
+ "string" === typeof input.id || _report(_exceptionable, {
1913
+ path: _path + ".id",
1914
+ expected: "string",
1915
+ value: input.id
1916
+ }),
1917
+ "ios" === input.platform || "android" === input.platform || _report(_exceptionable, {
1918
+ path: _path + ".platform",
1919
+ expected: "(\"android\" | \"ios\")",
1920
+ value: input.platform
1921
+ }),
1922
+ "boolean" === typeof input.shouldForceUpdate || _report(_exceptionable, {
1923
+ path: _path + ".shouldForceUpdate",
1924
+ expected: "boolean",
1925
+ value: input.shouldForceUpdate
1926
+ }),
1927
+ "boolean" === typeof input.enabled || _report(_exceptionable, {
1928
+ path: _path + ".enabled",
1929
+ expected: "boolean",
1930
+ value: input.enabled
1931
+ }),
1932
+ "string" === typeof input.fileHash || _report(_exceptionable, {
1933
+ path: _path + ".fileHash",
1934
+ expected: "string",
1935
+ value: input.fileHash
1936
+ }),
1937
+ "string" === typeof input.storageUri || _report(_exceptionable, {
1938
+ path: _path + ".storageUri",
1939
+ expected: "string",
1940
+ value: input.storageUri
1941
+ }),
1942
+ null === input.gitCommitHash || "string" === typeof input.gitCommitHash || _report(_exceptionable, {
1943
+ path: _path + ".gitCommitHash",
1944
+ expected: "(null | string)",
1945
+ value: input.gitCommitHash
1946
+ }),
1947
+ null === input.message || "string" === typeof input.message || _report(_exceptionable, {
1948
+ path: _path + ".message",
1949
+ expected: "(null | string)",
1950
+ value: input.message
1951
+ }),
1952
+ "string" === typeof input.channel || _report(_exceptionable, {
1953
+ path: _path + ".channel",
1954
+ expected: "string",
1955
+ value: input.channel
1956
+ }),
1957
+ null === input.targetAppVersion || "string" === typeof input.targetAppVersion || _report(_exceptionable, {
1958
+ path: _path + ".targetAppVersion",
1959
+ expected: "(null | string)",
1960
+ value: input.targetAppVersion
1961
+ }),
1962
+ null === input.fingerprintHash || "string" === typeof input.fingerprintHash || _report(_exceptionable, {
1963
+ path: _path + ".fingerprintHash",
1964
+ expected: "(null | string)",
1965
+ value: input.fingerprintHash
1966
+ }),
1967
+ void 0 === input.metadata || ("object" === typeof input.metadata && null !== input.metadata && false === Array.isArray(input.metadata) || _report(_exceptionable, {
1968
+ path: _path + ".metadata",
1969
+ expected: "(BundleMetadata | undefined)",
1970
+ value: input.metadata
1971
+ })) && _vo1(input.metadata, _path + ".metadata", _exceptionable) || _report(_exceptionable, {
1972
+ path: _path + ".metadata",
1973
+ expected: "(BundleMetadata | undefined)",
1974
+ value: input.metadata
1975
+ })
1976
+ ].every((flag) => flag);
1977
+ const _vo1 = (input, _path, _exceptionable = true) => [void 0 === input.app_version || "string" === typeof input.app_version || _report(_exceptionable, {
1978
+ path: _path + ".app_version",
1979
+ expected: "(string | undefined)",
1980
+ value: input.app_version
1981
+ })].every((flag) => flag);
1982
+ const __is = (input) => "object" === typeof input && null !== input && _io0(input);
1983
+ let errors;
1984
+ let _report;
1985
+ return (input) => {
1986
+ if (false === __is(input)) {
1987
+ errors = [];
1988
+ _report = import__validateReport._validateReport(errors);
1989
+ ((input$1, _path, _exceptionable = true) => ("object" === typeof input$1 && null !== input$1 || _report(true, {
1990
+ path: _path + "",
1991
+ expected: "Bundle",
1992
+ value: input$1
1993
+ })) && _vo0(input$1, _path + "", true) || _report(true, {
1994
+ path: _path + "",
1995
+ expected: "Bundle",
1996
+ value: input$1
1997
+ }))(input, "$input", true);
1998
+ const success = 0 === errors.length;
1999
+ return success ? {
2000
+ success,
2001
+ data: input
2002
+ } : {
2003
+ success,
2004
+ errors,
2005
+ data: input
2006
+ };
2007
+ }
2008
+ return {
2009
+ success: true,
2010
+ data: input
2011
+ };
2012
+ };
2013
+ })();
1908
2014
  let configPromise = null;
1909
2015
  const prepareConfig = async () => {
1910
2016
  if (!configPromise) configPromise = (async () => {
@@ -1997,6 +2103,21 @@ const rpc = new Hono().get("/config", async (c) => {
1997
2103
  if (error && typeof error === "object" && "message" in error) return c.json({ error: error.message }, 500);
1998
2104
  return c.json({ error: "Unknown error" }, 500);
1999
2105
  }
2106
+ }).post("/bundles", typiaValidator("json", createBundleSchema), async (c) => {
2107
+ try {
2108
+ const bundle = c.req.valid("json");
2109
+ const { databasePlugin } = await prepareConfig();
2110
+ await databasePlugin.appendBundle(bundle);
2111
+ await databasePlugin.commitBundle();
2112
+ return c.json({
2113
+ success: true,
2114
+ bundleId: bundle.id
2115
+ });
2116
+ } catch (error) {
2117
+ console.error("Error during bundle creation:", error);
2118
+ if (error && typeof error === "object" && "message" in error) return c.json({ error: error.message }, 500);
2119
+ return c.json({ error: "Unknown error" }, 500);
2120
+ }
2000
2121
  }).delete("/bundles/:bundleId", typiaValidator("param", paramBundleIdSchema), async (c) => {
2001
2122
  try {
2002
2123
  const { bundleId } = c.req.valid("param");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/console",
3
3
  "type": "module",
4
- "version": "0.20.0-rc.0",
4
+ "version": "0.20.1",
5
5
  "files": [
6
6
  "dist",
7
7
  "package.json"
@@ -48,12 +48,12 @@
48
48
  "vite": "^6.1.0",
49
49
  "vite-plugin-solid": "^2.11.1",
50
50
  "vite-tsconfig-paths": "^5.1.4",
51
- "@hot-updater/mock": "0.20.0-rc.0"
51
+ "@hot-updater/mock": "0.20.1"
52
52
  },
53
53
  "dependencies": {
54
54
  "solid-icons": "^1.1.0",
55
- "@hot-updater/core": "0.20.0-rc.0",
56
- "@hot-updater/plugin-core": "0.20.0-rc.0"
55
+ "@hot-updater/plugin-core": "0.20.1",
56
+ "@hot-updater/core": "0.20.1"
57
57
  },
58
58
  "scripts": {
59
59
  "build": "vite build --mode client && tsdown",