@hot-updater/firebase 0.25.9 → 0.25.11
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/firebase/functions/index.cjs +101 -80
- package/package.json +6 -6
|
@@ -24,10 +24,31 @@ var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(
|
|
|
24
24
|
}) : target, mod));
|
|
25
25
|
|
|
26
26
|
//#endregion
|
|
27
|
+
let path = require("path");
|
|
28
|
+
path = __toESM$1(path);
|
|
27
29
|
let firebase_admin = require("firebase-admin");
|
|
28
30
|
firebase_admin = __toESM$1(firebase_admin);
|
|
29
31
|
|
|
30
32
|
//#region ../../packages/core/dist/index.js
|
|
33
|
+
const HOT_UPDATE_DIR_NAME = ".hot-updater";
|
|
34
|
+
const HOT_UPDATE_OUTPUT_DIR_NAME = "output";
|
|
35
|
+
const HOT_UPDATE_LOG_DIR_NAME = "log";
|
|
36
|
+
const HotUpdateDirUtil = {
|
|
37
|
+
dirName: HOT_UPDATE_DIR_NAME,
|
|
38
|
+
outputDirName: HOT_UPDATE_OUTPUT_DIR_NAME,
|
|
39
|
+
logDirName: HOT_UPDATE_LOG_DIR_NAME,
|
|
40
|
+
outputGitignorePath: `${HOT_UPDATE_DIR_NAME}/${HOT_UPDATE_OUTPUT_DIR_NAME}`,
|
|
41
|
+
logGitignorePath: `${HOT_UPDATE_DIR_NAME}/${HOT_UPDATE_LOG_DIR_NAME}`,
|
|
42
|
+
getDirPath: ({ cwd }) => {
|
|
43
|
+
return path.default.join(cwd, HOT_UPDATE_DIR_NAME);
|
|
44
|
+
},
|
|
45
|
+
getDefaultOutputPath: ({ cwd }) => {
|
|
46
|
+
return path.default.join(cwd, HOT_UPDATE_DIR_NAME, HOT_UPDATE_OUTPUT_DIR_NAME);
|
|
47
|
+
},
|
|
48
|
+
getLogDirPath: ({ cwd }) => {
|
|
49
|
+
return path.default.join(cwd, HOT_UPDATE_DIR_NAME, HOT_UPDATE_LOG_DIR_NAME);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
31
52
|
const NIL_UUID = "00000000-0000-0000-0000-000000000000";
|
|
32
53
|
|
|
33
54
|
//#endregion
|
|
@@ -79,25 +100,25 @@ var handleParsingNestedValues = (form, key, value) => {
|
|
|
79
100
|
|
|
80
101
|
//#endregion
|
|
81
102
|
//#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/url.js
|
|
82
|
-
var splitPath = (path$
|
|
83
|
-
const paths = path$
|
|
103
|
+
var splitPath = (path$3) => {
|
|
104
|
+
const paths = path$3.split("/");
|
|
84
105
|
if (paths[0] === "") paths.shift();
|
|
85
106
|
return paths;
|
|
86
107
|
};
|
|
87
108
|
var splitRoutingPath = (routePath) => {
|
|
88
|
-
const { groups, path: path$
|
|
89
|
-
return replaceGroupMarks(splitPath(path$
|
|
109
|
+
const { groups, path: path$3 } = extractGroupsFromPath(routePath);
|
|
110
|
+
return replaceGroupMarks(splitPath(path$3), groups);
|
|
90
111
|
};
|
|
91
|
-
var extractGroupsFromPath = (path$
|
|
112
|
+
var extractGroupsFromPath = (path$3) => {
|
|
92
113
|
const groups = [];
|
|
93
|
-
path$
|
|
114
|
+
path$3 = path$3.replace(/\{[^}]+\}/g, (match, index) => {
|
|
94
115
|
const mark = `@${index}`;
|
|
95
116
|
groups.push([mark, match]);
|
|
96
117
|
return mark;
|
|
97
118
|
});
|
|
98
119
|
return {
|
|
99
120
|
groups,
|
|
100
|
-
path: path$
|
|
121
|
+
path: path$3
|
|
101
122
|
};
|
|
102
123
|
};
|
|
103
124
|
var replaceGroupMarks = (paths, groups) => {
|
|
@@ -150,8 +171,8 @@ var getPath = (request) => {
|
|
|
150
171
|
const charCode = url.charCodeAt(i);
|
|
151
172
|
if (charCode === 37) {
|
|
152
173
|
const queryIndex = url.indexOf("?", i);
|
|
153
|
-
const path$
|
|
154
|
-
return tryDecodeURI(path$
|
|
174
|
+
const path$3 = url.slice(start, queryIndex === -1 ? void 0 : queryIndex);
|
|
175
|
+
return tryDecodeURI(path$3.includes("%25") ? path$3.replace(/%25/g, "%2525") : path$3);
|
|
155
176
|
} else if (charCode === 63) break;
|
|
156
177
|
}
|
|
157
178
|
return url.slice(start, i);
|
|
@@ -163,21 +184,21 @@ var getPathNoStrict = (request) => {
|
|
|
163
184
|
var mergePath = (...paths) => {
|
|
164
185
|
let p = "";
|
|
165
186
|
let endsWithSlash = false;
|
|
166
|
-
for (let path$
|
|
187
|
+
for (let path$3 of paths) {
|
|
167
188
|
if (p[p.length - 1] === "/") {
|
|
168
189
|
p = p.slice(0, -1);
|
|
169
190
|
endsWithSlash = true;
|
|
170
191
|
}
|
|
171
|
-
if (path$
|
|
172
|
-
if (path$
|
|
173
|
-
else if (path$
|
|
174
|
-
if (path$
|
|
192
|
+
if (path$3[0] !== "/") path$3 = `/${path$3}`;
|
|
193
|
+
if (path$3 === "/" && endsWithSlash) p = `${p}/`;
|
|
194
|
+
else if (path$3 !== "/") p = `${p}${path$3}`;
|
|
195
|
+
if (path$3 === "/" && p === "") p = "/";
|
|
175
196
|
}
|
|
176
197
|
return p;
|
|
177
198
|
};
|
|
178
|
-
var checkOptionalParameter = (path$
|
|
179
|
-
if (!path$
|
|
180
|
-
const segments = path$
|
|
199
|
+
var checkOptionalParameter = (path$3) => {
|
|
200
|
+
if (!path$3.match(/\:.+\?$/)) return null;
|
|
201
|
+
const segments = path$3.split("/");
|
|
181
202
|
const results = [];
|
|
182
203
|
let basePath = "";
|
|
183
204
|
segments.forEach((segment) => {
|
|
@@ -253,9 +274,9 @@ var HonoRequest = class {
|
|
|
253
274
|
routeIndex = 0;
|
|
254
275
|
path;
|
|
255
276
|
bodyCache = {};
|
|
256
|
-
constructor(request, path$
|
|
277
|
+
constructor(request, path$3 = "/", matchResult = [[]]) {
|
|
257
278
|
this.raw = request;
|
|
258
|
-
this.path = path$
|
|
279
|
+
this.path = path$3;
|
|
259
280
|
this.#matchResult = matchResult;
|
|
260
281
|
this.#validatedData = {};
|
|
261
282
|
}
|
|
@@ -652,8 +673,8 @@ var Hono$1 = class {
|
|
|
652
673
|
return this;
|
|
653
674
|
};
|
|
654
675
|
});
|
|
655
|
-
this.on = (method, path$
|
|
656
|
-
for (const p of [path$
|
|
676
|
+
this.on = (method, path$3, ...handlers) => {
|
|
677
|
+
for (const p of [path$3].flat()) {
|
|
657
678
|
this.#path = p;
|
|
658
679
|
for (const m of [method].flat()) handlers.map((handler) => {
|
|
659
680
|
this.addRoute(m.toUpperCase(), this.#path, handler);
|
|
@@ -687,8 +708,8 @@ var Hono$1 = class {
|
|
|
687
708
|
}
|
|
688
709
|
notFoundHandler = notFoundHandler;
|
|
689
710
|
errorHandler = errorHandler;
|
|
690
|
-
route(path$
|
|
691
|
-
const subApp = this.basePath(path$
|
|
711
|
+
route(path$3, app$1) {
|
|
712
|
+
const subApp = this.basePath(path$3);
|
|
692
713
|
app$1.routes.map((r) => {
|
|
693
714
|
let handler;
|
|
694
715
|
if (app$1.errorHandler === errorHandler) handler = r.handler;
|
|
@@ -700,9 +721,9 @@ var Hono$1 = class {
|
|
|
700
721
|
});
|
|
701
722
|
return this;
|
|
702
723
|
}
|
|
703
|
-
basePath(path$
|
|
724
|
+
basePath(path$3) {
|
|
704
725
|
const subApp = this.clone();
|
|
705
|
-
subApp._basePath = mergePath(this._basePath, path$
|
|
726
|
+
subApp._basePath = mergePath(this._basePath, path$3);
|
|
706
727
|
return subApp;
|
|
707
728
|
}
|
|
708
729
|
onError = (handler) => {
|
|
@@ -713,7 +734,7 @@ var Hono$1 = class {
|
|
|
713
734
|
this.notFoundHandler = handler;
|
|
714
735
|
return this;
|
|
715
736
|
};
|
|
716
|
-
mount(path$
|
|
737
|
+
mount(path$3, applicationHandler, options$1) {
|
|
717
738
|
let replaceRequest;
|
|
718
739
|
let optionHandler;
|
|
719
740
|
if (options$1) if (typeof options$1 === "function") optionHandler = options$1;
|
|
@@ -732,7 +753,7 @@ var Hono$1 = class {
|
|
|
732
753
|
return [c.env, executionContext];
|
|
733
754
|
};
|
|
734
755
|
replaceRequest ||= (() => {
|
|
735
|
-
const mergedPath = mergePath(this._basePath, path$
|
|
756
|
+
const mergedPath = mergePath(this._basePath, path$3);
|
|
736
757
|
const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
|
|
737
758
|
return (request) => {
|
|
738
759
|
const url = new URL(request.url);
|
|
@@ -745,22 +766,22 @@ var Hono$1 = class {
|
|
|
745
766
|
if (res) return res;
|
|
746
767
|
await next();
|
|
747
768
|
};
|
|
748
|
-
this.addRoute(METHOD_NAME_ALL, mergePath(path$
|
|
769
|
+
this.addRoute(METHOD_NAME_ALL, mergePath(path$3, "*"), handler);
|
|
749
770
|
return this;
|
|
750
771
|
}
|
|
751
|
-
addRoute(method, path$
|
|
772
|
+
addRoute(method, path$3, handler) {
|
|
752
773
|
method = method.toUpperCase();
|
|
753
|
-
path$
|
|
774
|
+
path$3 = mergePath(this._basePath, path$3);
|
|
754
775
|
const r = {
|
|
755
|
-
path: path$
|
|
776
|
+
path: path$3,
|
|
756
777
|
method,
|
|
757
778
|
handler
|
|
758
779
|
};
|
|
759
|
-
this.router.add(method, path$
|
|
780
|
+
this.router.add(method, path$3, [handler, r]);
|
|
760
781
|
this.routes.push(r);
|
|
761
782
|
}
|
|
762
|
-
matchRoute(method, path$
|
|
763
|
-
return this.router.match(method, path$
|
|
783
|
+
matchRoute(method, path$3) {
|
|
784
|
+
return this.router.match(method, path$3);
|
|
764
785
|
}
|
|
765
786
|
handleError(err, c) {
|
|
766
787
|
if (err instanceof Error) return this.errorHandler(err, c);
|
|
@@ -768,10 +789,10 @@ var Hono$1 = class {
|
|
|
768
789
|
}
|
|
769
790
|
dispatch(request, executionCtx, env, method) {
|
|
770
791
|
if (method === "HEAD") return (async () => new Response(null, await this.dispatch(request, executionCtx, env, "GET")))();
|
|
771
|
-
const path$
|
|
772
|
-
const matchResult = this.matchRoute(method, path$
|
|
792
|
+
const path$3 = this.getPath(request, { env });
|
|
793
|
+
const matchResult = this.matchRoute(method, path$3);
|
|
773
794
|
const c = new Context(request, {
|
|
774
|
-
path: path$
|
|
795
|
+
path: path$3,
|
|
775
796
|
matchResult,
|
|
776
797
|
env,
|
|
777
798
|
executionCtx,
|
|
@@ -808,8 +829,8 @@ var Hono$1 = class {
|
|
|
808
829
|
return this.fetch(input, Env, executionCtx);
|
|
809
830
|
}
|
|
810
831
|
input = input.toString();
|
|
811
|
-
const path$
|
|
812
|
-
const req = new Request(path$
|
|
832
|
+
const path$3 = /^https?:\/\//.test(input) ? input : `http://localhost${mergePath("/", input)}`;
|
|
833
|
+
const req = new Request(path$3, requestInit);
|
|
813
834
|
return this.fetch(req, Env, executionCtx);
|
|
814
835
|
};
|
|
815
836
|
fire = () => {
|
|
@@ -903,12 +924,12 @@ var Node$1 = class {
|
|
|
903
924
|
var Trie = class {
|
|
904
925
|
context = { varIndex: 0 };
|
|
905
926
|
root = new Node$1();
|
|
906
|
-
insert(path$
|
|
927
|
+
insert(path$3, index, pathErrorCheckOnly) {
|
|
907
928
|
const paramAssoc = [];
|
|
908
929
|
const groups = [];
|
|
909
930
|
for (let i = 0;;) {
|
|
910
931
|
let replaced = false;
|
|
911
|
-
path$
|
|
932
|
+
path$3 = path$3.replace(/\{[^}]+\}/g, (m) => {
|
|
912
933
|
const mark = `@\\${i}`;
|
|
913
934
|
groups[i] = [mark, m];
|
|
914
935
|
i++;
|
|
@@ -917,7 +938,7 @@ var Trie = class {
|
|
|
917
938
|
});
|
|
918
939
|
if (!replaced) break;
|
|
919
940
|
}
|
|
920
|
-
const tokens = path$
|
|
941
|
+
const tokens = path$3.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
|
|
921
942
|
for (let i = groups.length - 1; i >= 0; i--) {
|
|
922
943
|
const [mark] = groups[i];
|
|
923
944
|
for (let j = tokens.length - 1; j >= 0; j--) if (tokens[j].indexOf(mark) !== -1) {
|
|
@@ -966,8 +987,8 @@ var nullMatcher = [
|
|
|
966
987
|
/* @__PURE__ */ Object.create(null)
|
|
967
988
|
];
|
|
968
989
|
var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
969
|
-
function buildWildcardRegExp(path$
|
|
970
|
-
return wildcardRegExpCache[path$
|
|
990
|
+
function buildWildcardRegExp(path$3) {
|
|
991
|
+
return wildcardRegExpCache[path$3] ??= /* @__PURE__ */ new RegExp(path$3 === "*" ? "" : `^${path$3.replace(/\/\*$|([.\\+*[^\]$()])/g, (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)")}$`);
|
|
971
992
|
}
|
|
972
993
|
function clearWildcardRegExpCache() {
|
|
973
994
|
wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
@@ -979,14 +1000,14 @@ function buildMatcherFromPreprocessedRoutes(routes) {
|
|
|
979
1000
|
const routesWithStaticPathFlag = routes.map((route) => [!/\*|\/:/.test(route[0]), ...route]).sort(([isStaticA, pathA], [isStaticB, pathB]) => isStaticA ? 1 : isStaticB ? -1 : pathA.length - pathB.length);
|
|
980
1001
|
const staticMap = /* @__PURE__ */ Object.create(null);
|
|
981
1002
|
for (let i = 0, j = -1, len = routesWithStaticPathFlag.length; i < len; i++) {
|
|
982
|
-
const [pathErrorCheckOnly, path$
|
|
983
|
-
if (pathErrorCheckOnly) staticMap[path$
|
|
1003
|
+
const [pathErrorCheckOnly, path$3, handlers] = routesWithStaticPathFlag[i];
|
|
1004
|
+
if (pathErrorCheckOnly) staticMap[path$3] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam];
|
|
984
1005
|
else j++;
|
|
985
1006
|
let paramAssoc;
|
|
986
1007
|
try {
|
|
987
|
-
paramAssoc = trie.insert(path$
|
|
1008
|
+
paramAssoc = trie.insert(path$3, j, pathErrorCheckOnly);
|
|
988
1009
|
} catch (e) {
|
|
989
|
-
throw e === PATH_ERROR ? new UnsupportedPathError(path$
|
|
1010
|
+
throw e === PATH_ERROR ? new UnsupportedPathError(path$3) : e;
|
|
990
1011
|
}
|
|
991
1012
|
if (pathErrorCheckOnly) continue;
|
|
992
1013
|
handlerData[j] = handlers.map(([h, paramCount]) => {
|
|
@@ -1014,9 +1035,9 @@ function buildMatcherFromPreprocessedRoutes(routes) {
|
|
|
1014
1035
|
staticMap
|
|
1015
1036
|
];
|
|
1016
1037
|
}
|
|
1017
|
-
function findMiddleware(middleware, path$
|
|
1038
|
+
function findMiddleware(middleware, path$3) {
|
|
1018
1039
|
if (!middleware) return;
|
|
1019
|
-
for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) if (buildWildcardRegExp(k).test(path$
|
|
1040
|
+
for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) if (buildWildcardRegExp(k).test(path$3)) return [...middleware[k]];
|
|
1020
1041
|
}
|
|
1021
1042
|
var RegExpRouter = class {
|
|
1022
1043
|
name = "RegExpRouter";
|
|
@@ -1026,7 +1047,7 @@ var RegExpRouter = class {
|
|
|
1026
1047
|
this.middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
|
|
1027
1048
|
this.routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
|
|
1028
1049
|
}
|
|
1029
|
-
add(method, path$
|
|
1050
|
+
add(method, path$3, handler) {
|
|
1030
1051
|
const { middleware, routes } = this;
|
|
1031
1052
|
if (!middleware || !routes) throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
|
|
1032
1053
|
if (!middleware[method]) [middleware, routes].forEach((handlerMap) => {
|
|
@@ -1035,14 +1056,14 @@ var RegExpRouter = class {
|
|
|
1035
1056
|
handlerMap[method][p] = [...handlerMap[METHOD_NAME_ALL][p]];
|
|
1036
1057
|
});
|
|
1037
1058
|
});
|
|
1038
|
-
if (path$
|
|
1039
|
-
const paramCount = (path$
|
|
1040
|
-
if (/\*$/.test(path$
|
|
1041
|
-
const re = buildWildcardRegExp(path$
|
|
1059
|
+
if (path$3 === "/*") path$3 = "*";
|
|
1060
|
+
const paramCount = (path$3.match(/\/:/g) || []).length;
|
|
1061
|
+
if (/\*$/.test(path$3)) {
|
|
1062
|
+
const re = buildWildcardRegExp(path$3);
|
|
1042
1063
|
if (method === METHOD_NAME_ALL) Object.keys(middleware).forEach((m) => {
|
|
1043
|
-
middleware[m][path$
|
|
1064
|
+
middleware[m][path$3] ||= findMiddleware(middleware[m], path$3) || findMiddleware(middleware[METHOD_NAME_ALL], path$3) || [];
|
|
1044
1065
|
});
|
|
1045
|
-
else middleware[method][path$
|
|
1066
|
+
else middleware[method][path$3] ||= findMiddleware(middleware[method], path$3) || findMiddleware(middleware[METHOD_NAME_ALL], path$3) || [];
|
|
1046
1067
|
Object.keys(middleware).forEach((m) => {
|
|
1047
1068
|
if (method === METHOD_NAME_ALL || method === m) Object.keys(middleware[m]).forEach((p) => {
|
|
1048
1069
|
re.test(p) && middleware[m][p].push([handler, paramCount]);
|
|
@@ -1053,7 +1074,7 @@ var RegExpRouter = class {
|
|
|
1053
1074
|
});
|
|
1054
1075
|
return;
|
|
1055
1076
|
}
|
|
1056
|
-
const paths = checkOptionalParameter(path$
|
|
1077
|
+
const paths = checkOptionalParameter(path$3) || [path$3];
|
|
1057
1078
|
for (let i = 0, len = paths.length; i < len; i++) {
|
|
1058
1079
|
const path2 = paths[i];
|
|
1059
1080
|
Object.keys(routes).forEach((m) => {
|
|
@@ -1064,7 +1085,7 @@ var RegExpRouter = class {
|
|
|
1064
1085
|
});
|
|
1065
1086
|
}
|
|
1066
1087
|
}
|
|
1067
|
-
match(method, path$
|
|
1088
|
+
match(method, path$3) {
|
|
1068
1089
|
clearWildcardRegExpCache();
|
|
1069
1090
|
const matchers = this.buildAllMatchers();
|
|
1070
1091
|
this.match = (method2, path2) => {
|
|
@@ -1076,7 +1097,7 @@ var RegExpRouter = class {
|
|
|
1076
1097
|
const index = match.indexOf("", 1);
|
|
1077
1098
|
return [matcher[1][index], match];
|
|
1078
1099
|
};
|
|
1079
|
-
return this.match(method, path$
|
|
1100
|
+
return this.match(method, path$3);
|
|
1080
1101
|
}
|
|
1081
1102
|
buildAllMatchers() {
|
|
1082
1103
|
const matchers = /* @__PURE__ */ Object.create(null);
|
|
@@ -1090,11 +1111,11 @@ var RegExpRouter = class {
|
|
|
1090
1111
|
const routes = [];
|
|
1091
1112
|
let hasOwnRoute = method === METHOD_NAME_ALL;
|
|
1092
1113
|
[this.middleware, this.routes].forEach((r) => {
|
|
1093
|
-
const ownRoute = r[method] ? Object.keys(r[method]).map((path$
|
|
1114
|
+
const ownRoute = r[method] ? Object.keys(r[method]).map((path$3) => [path$3, r[method][path$3]]) : [];
|
|
1094
1115
|
if (ownRoute.length !== 0) {
|
|
1095
1116
|
hasOwnRoute ||= true;
|
|
1096
1117
|
routes.push(...ownRoute);
|
|
1097
|
-
} else if (method !== METHOD_NAME_ALL) routes.push(...Object.keys(r[METHOD_NAME_ALL]).map((path$
|
|
1118
|
+
} else if (method !== METHOD_NAME_ALL) routes.push(...Object.keys(r[METHOD_NAME_ALL]).map((path$3) => [path$3, r[METHOD_NAME_ALL][path$3]]));
|
|
1098
1119
|
});
|
|
1099
1120
|
if (!hasOwnRoute) return null;
|
|
1100
1121
|
else return buildMatcherFromPreprocessedRoutes(routes);
|
|
@@ -1110,15 +1131,15 @@ var SmartRouter = class {
|
|
|
1110
1131
|
constructor(init) {
|
|
1111
1132
|
Object.assign(this, init);
|
|
1112
1133
|
}
|
|
1113
|
-
add(method, path$
|
|
1134
|
+
add(method, path$3, handler) {
|
|
1114
1135
|
if (!this.routes) throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
|
|
1115
1136
|
this.routes.push([
|
|
1116
1137
|
method,
|
|
1117
|
-
path$
|
|
1138
|
+
path$3,
|
|
1118
1139
|
handler
|
|
1119
1140
|
]);
|
|
1120
1141
|
}
|
|
1121
|
-
match(method, path$
|
|
1142
|
+
match(method, path$3) {
|
|
1122
1143
|
if (!this.routes) throw new Error("Fatal error");
|
|
1123
1144
|
const { routers, routes } = this;
|
|
1124
1145
|
const len = routers.length;
|
|
@@ -1130,7 +1151,7 @@ var SmartRouter = class {
|
|
|
1130
1151
|
routes.forEach((args) => {
|
|
1131
1152
|
router.add(...args);
|
|
1132
1153
|
});
|
|
1133
|
-
res = router.match(method, path$
|
|
1154
|
+
res = router.match(method, path$3);
|
|
1134
1155
|
} catch (e) {
|
|
1135
1156
|
if (e instanceof UnsupportedPathError) continue;
|
|
1136
1157
|
throw e;
|
|
@@ -1175,11 +1196,11 @@ var Node = class {
|
|
|
1175
1196
|
}
|
|
1176
1197
|
this.patterns = [];
|
|
1177
1198
|
}
|
|
1178
|
-
insert(method, path$
|
|
1179
|
-
this.name = `${method} ${path$
|
|
1199
|
+
insert(method, path$3, handler) {
|
|
1200
|
+
this.name = `${method} ${path$3}`;
|
|
1180
1201
|
this.order = ++this.order;
|
|
1181
1202
|
let curNode = this;
|
|
1182
|
-
const parts = splitRoutingPath(path$
|
|
1203
|
+
const parts = splitRoutingPath(path$3);
|
|
1183
1204
|
const possibleKeys = [];
|
|
1184
1205
|
for (let i = 0, len = parts.length; i < len; i++) {
|
|
1185
1206
|
const p = parts[i];
|
|
@@ -1226,11 +1247,11 @@ var Node = class {
|
|
|
1226
1247
|
}
|
|
1227
1248
|
return handlerSets;
|
|
1228
1249
|
}
|
|
1229
|
-
search(method, path$
|
|
1250
|
+
search(method, path$3) {
|
|
1230
1251
|
const handlerSets = [];
|
|
1231
1252
|
this.params = /* @__PURE__ */ Object.create(null);
|
|
1232
1253
|
let curNodes = [this];
|
|
1233
|
-
const parts = splitPath(path$
|
|
1254
|
+
const parts = splitPath(path$3);
|
|
1234
1255
|
for (let i = 0, len = parts.length; i < len; i++) {
|
|
1235
1256
|
const part = parts[i];
|
|
1236
1257
|
const isLast = i === len - 1;
|
|
@@ -1295,16 +1316,16 @@ var TrieRouter = class {
|
|
|
1295
1316
|
constructor() {
|
|
1296
1317
|
this.node = new Node();
|
|
1297
1318
|
}
|
|
1298
|
-
add(method, path$
|
|
1299
|
-
const results = checkOptionalParameter(path$
|
|
1319
|
+
add(method, path$3, handler) {
|
|
1320
|
+
const results = checkOptionalParameter(path$3);
|
|
1300
1321
|
if (results) {
|
|
1301
1322
|
for (const p of results) this.node.insert(method, p, handler);
|
|
1302
1323
|
return;
|
|
1303
1324
|
}
|
|
1304
|
-
this.node.insert(method, path$
|
|
1325
|
+
this.node.insert(method, path$3, handler);
|
|
1305
1326
|
}
|
|
1306
|
-
match(method, path$
|
|
1307
|
-
return this.node.search(method, path$
|
|
1327
|
+
match(method, path$3) {
|
|
1328
|
+
return this.node.search(method, path$3);
|
|
1308
1329
|
}
|
|
1309
1330
|
};
|
|
1310
1331
|
|
|
@@ -2413,7 +2434,7 @@ var require_debug$1 = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/f
|
|
|
2413
2434
|
var require_config = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/firebase-functions@6.3.2_firebase-admin@13.6.0_encoding@0.1.13_/node_modules/firebase-functions/lib/common/config.js": ((exports) => {
|
|
2414
2435
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2415
2436
|
const fs_1 = require("fs");
|
|
2416
|
-
const path = require("path");
|
|
2437
|
+
const path$1 = require("path");
|
|
2417
2438
|
const logger$4 = require_logger();
|
|
2418
2439
|
let cache$1 = null;
|
|
2419
2440
|
/**
|
|
@@ -2432,7 +2453,7 @@ var require_config = /* @__PURE__ */ __commonJS$1({ "../../node_modules/.pnpm/fi
|
|
|
2432
2453
|
if (cache$1) return cache$1;
|
|
2433
2454
|
let env = process.env.FIREBASE_CONFIG;
|
|
2434
2455
|
if (env) {
|
|
2435
|
-
if (!env.startsWith("{")) env = (0, fs_1.readFileSync)(path.join(process.env.PWD, env)).toString("utf8");
|
|
2456
|
+
if (!env.startsWith("{")) env = (0, fs_1.readFileSync)(path$1.join(process.env.PWD, env)).toString("utf8");
|
|
2436
2457
|
cache$1 = JSON.parse(env);
|
|
2437
2458
|
return cache$1;
|
|
2438
2459
|
}
|
|
@@ -3442,8 +3463,8 @@ function createFirebaseApp({ region }) {
|
|
|
3442
3463
|
return (app$1) => {
|
|
3443
3464
|
return (0, import_https.onRequest)({ region }, async (req, res) => {
|
|
3444
3465
|
const host = req.hostname;
|
|
3445
|
-
const path$
|
|
3446
|
-
const fullUrl = new URL(path$
|
|
3466
|
+
const path$3 = req.originalUrl || req.url;
|
|
3467
|
+
const fullUrl = new URL(path$3, `https://${host}`).toString();
|
|
3447
3468
|
const request = new Request(fullUrl, {
|
|
3448
3469
|
method: req.method,
|
|
3449
3470
|
headers: req.headers,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/firebase",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.25.
|
|
4
|
+
"version": "0.25.11",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"firebase": "^11.3.1",
|
|
38
|
-
"@hot-updater/cli-tools": "0.25.
|
|
39
|
-
"@hot-updater/core": "0.25.
|
|
40
|
-
"@hot-updater/plugin-core": "0.25.
|
|
38
|
+
"@hot-updater/cli-tools": "0.25.11",
|
|
39
|
+
"@hot-updater/core": "0.25.11",
|
|
40
|
+
"@hot-updater/plugin-core": "0.25.11"
|
|
41
41
|
},
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"fkill": "^9.0.0",
|
|
54
54
|
"hono": "^4.6.3",
|
|
55
55
|
"mime": "^4.0.4",
|
|
56
|
-
"@hot-updater/js": "0.25.
|
|
57
|
-
"@hot-updater/test-utils": "0.25.
|
|
56
|
+
"@hot-updater/js": "0.25.11",
|
|
57
|
+
"@hot-updater/test-utils": "0.25.11"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"firebase-admin": "*"
|