@hot-updater/firebase 1.0.0-rc.3 → 1.0.0-rc.4
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 +16 -18
- package/dist/iac/index.cjs +2 -2
- package/dist/iac/index.mjs +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +6 -6
|
@@ -6,7 +6,7 @@ let firebase_admin_firestore = require("firebase-admin/firestore");
|
|
|
6
6
|
let firebase_admin_storage = require("firebase-admin/storage");
|
|
7
7
|
//#endregion
|
|
8
8
|
//#region ../../packages/server/dist/version.mjs
|
|
9
|
-
const HOT_UPDATER_SERVER_VERSION = "1.0.0-rc.
|
|
9
|
+
const HOT_UPDATER_SERVER_VERSION = "1.0.0-rc.3";
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region ../../packages/server/dist/handlerVersionRoutes.mjs
|
|
12
12
|
const createVersionRouteHandlers = () => ({ version: async () => Response.json({
|
|
@@ -809,7 +809,7 @@ const modelValidators = {
|
|
|
809
809
|
},
|
|
810
810
|
bundle_events: {
|
|
811
811
|
id: (value) => typeof value === "string",
|
|
812
|
-
type: (value) => value === "UPDATE_APPLIED" || value === "RECOVERED" || value === "
|
|
812
|
+
type: (value) => value === "UPDATE_APPLIED" || value === "RECOVERED" || value === "UNCHANGED",
|
|
813
813
|
install_id: isInsightsIdentityText,
|
|
814
814
|
user_id: isNullableInsightsIdentityText,
|
|
815
815
|
username: (value) => value === null || typeof value === "string",
|
|
@@ -832,7 +832,7 @@ const modelValidators = {
|
|
|
832
832
|
user_id: isNullableInsightsIdentityText,
|
|
833
833
|
username: (value) => value === null || typeof value === "string",
|
|
834
834
|
to_bundle_id: (value) => typeof value === "string",
|
|
835
|
-
type: (value) => value === "UPDATE_APPLIED" || value === "RECOVERED" || value === "
|
|
835
|
+
type: (value) => value === "UPDATE_APPLIED" || value === "RECOVERED" || value === "UNCHANGED",
|
|
836
836
|
platform: (value) => value === "ios" || value === "android",
|
|
837
837
|
app_version: (value) => typeof value === "string",
|
|
838
838
|
channel: (value) => typeof value === "string",
|
|
@@ -1035,7 +1035,7 @@ const hasValidReleaseInvariants = (data) => {
|
|
|
1035
1035
|
const fingerprintHash = data.fingerprint_hash;
|
|
1036
1036
|
return (kind === "BUNDLE" && typeof bundleId === "string" || kind === "EMBEDDED" && bundleId === null) && (strategy === "APP_VERSION" && typeof targetAppVersion === "string" && fingerprintHash === null || strategy === "FINGERPRINT" && targetAppVersion === null && typeof fingerprintHash === "string");
|
|
1037
1037
|
};
|
|
1038
|
-
const hasValidBundleEventInvariants = (data) => (data.type === "UPDATE_APPLIED" || data.type === "RECOVERED"
|
|
1038
|
+
const hasValidBundleEventInvariants = (data) => (data.type === "UPDATE_APPLIED" || data.type === "RECOVERED") && typeof data.from_bundle_id === "string" && (data.update_strategy === "fingerprint" || data.update_strategy === "appVersion") || data.type === "UNCHANGED" && data.from_bundle_id === null && data.update_strategy === null;
|
|
1039
1039
|
const validateCreateData = (model, data) => {
|
|
1040
1040
|
if (!isRecord$3(data)) throw new DatabasePluginInputError("invalid-data");
|
|
1041
1041
|
validateFields(model, Object.keys(data));
|
|
@@ -1105,7 +1105,7 @@ const isBundleFilter = (value, withKind = false) => {
|
|
|
1105
1105
|
"type",
|
|
1106
1106
|
...withKind ? ["kind"] : []
|
|
1107
1107
|
];
|
|
1108
|
-
return value.type === "RECOVERED" ? isText(value.fromBundleId) && hasOnlyKeys$1(value, [...keys, "fromBundleId"]) : (value.type === "UPDATE_APPLIED" || value.type === "
|
|
1108
|
+
return value.type === "RECOVERED" ? isText(value.fromBundleId) && hasOnlyKeys$1(value, [...keys, "fromBundleId"]) : (value.type === "UPDATE_APPLIED" || value.type === "UNCHANGED") && isText(value.toBundleId) && hasOnlyKeys$1(value, [...keys, "toBundleId"]);
|
|
1109
1109
|
};
|
|
1110
1110
|
const isEventFilter = (value) => {
|
|
1111
1111
|
if (!isRecord$3(value)) return false;
|
|
@@ -1139,7 +1139,7 @@ const toInsightsInstallationRow = (event) => {
|
|
|
1139
1139
|
received_at_ms: event.received_at_ms
|
|
1140
1140
|
};
|
|
1141
1141
|
};
|
|
1142
|
-
/**
|
|
1142
|
+
/** Unchanged reports are not bundle movements. */
|
|
1143
1143
|
const isInsightsMovementEvent = (event) => event.type === "UPDATE_APPLIED" || event.type === "RECOVERED";
|
|
1144
1144
|
const matchesInsightsEventFilter = (event, filter) => {
|
|
1145
1145
|
if (filter.kind === "all") return true;
|
|
@@ -4172,8 +4172,7 @@ function requireEvent(payload) {
|
|
|
4172
4172
|
const type = requireStringField(payload, "type");
|
|
4173
4173
|
switch (type) {
|
|
4174
4174
|
case "UPDATE_APPLIED":
|
|
4175
|
-
case "RECOVERED":
|
|
4176
|
-
case "RELEASE_ADOPTED": {
|
|
4175
|
+
case "RECOVERED": {
|
|
4177
4176
|
const updateStrategy = requireStringField(payload, "updateStrategy");
|
|
4178
4177
|
if (updateStrategy !== "fingerprint" && updateStrategy !== "appVersion") throw new InsightsBadRequestError("Invalid event field: updateStrategy");
|
|
4179
4178
|
return {
|
|
@@ -4217,8 +4216,7 @@ function createBundleEventRow(input) {
|
|
|
4217
4216
|
};
|
|
4218
4217
|
switch (input.type) {
|
|
4219
4218
|
case "UPDATE_APPLIED":
|
|
4220
|
-
case "RECOVERED":
|
|
4221
|
-
case "RELEASE_ADOPTED": return {
|
|
4219
|
+
case "RECOVERED": return {
|
|
4222
4220
|
...base,
|
|
4223
4221
|
from_bundle_id: input.fromBundleId,
|
|
4224
4222
|
type: input.type,
|
|
@@ -4285,7 +4283,7 @@ const parseEventPageInput = (request) => {
|
|
|
4285
4283
|
let bundle;
|
|
4286
4284
|
if (bundleFields.some((key) => url.searchParams.has(key))) {
|
|
4287
4285
|
const outcome = readSingle(url, "outcome");
|
|
4288
|
-
if (outcome !== "applied" && outcome !== "recovered" && outcome !== "
|
|
4286
|
+
if (outcome !== "applied" && outcome !== "recovered" && outcome !== "unchanged") throw new InsightsBadRequestError("Invalid 'outcome' query parameter.");
|
|
4289
4287
|
bundle = {
|
|
4290
4288
|
...readScope$1(url),
|
|
4291
4289
|
bundleId: readId(url, "bundleId", 1024),
|
|
@@ -4606,9 +4604,9 @@ const bundleFilter = (input) => {
|
|
|
4606
4604
|
type: "RECOVERED",
|
|
4607
4605
|
fromBundleId: bundleId
|
|
4608
4606
|
};
|
|
4609
|
-
case "
|
|
4607
|
+
case "unchanged": return {
|
|
4610
4608
|
...scope,
|
|
4611
|
-
type: "
|
|
4609
|
+
type: "UNCHANGED",
|
|
4612
4610
|
toBundleId: bundleId
|
|
4613
4611
|
};
|
|
4614
4612
|
default: throw new InsightsBadRequestError("Invalid Insights outcome.");
|
|
@@ -4815,7 +4813,7 @@ const createInsightsProvider = (model) => Object.freeze({
|
|
|
4815
4813
|
sinceMs,
|
|
4816
4814
|
beforeReceivedAtMs
|
|
4817
4815
|
}));
|
|
4818
|
-
const [reportingInstallations, bundleInstallations, appliedReports, recoveredReports,
|
|
4816
|
+
const [reportingInstallations, bundleInstallations, appliedReports, recoveredReports, unchangedReports] = await Promise.all([
|
|
4819
4817
|
reporting,
|
|
4820
4818
|
measure(model.countInstallations({
|
|
4821
4819
|
...scope,
|
|
@@ -4824,7 +4822,7 @@ const createInsightsProvider = (model) => Object.freeze({
|
|
|
4824
4822
|
})),
|
|
4825
4823
|
countOutcome("applied"),
|
|
4826
4824
|
countOutcome("recovered"),
|
|
4827
|
-
countOutcome("
|
|
4825
|
+
countOutcome("unchanged")
|
|
4828
4826
|
]);
|
|
4829
4827
|
return {
|
|
4830
4828
|
...scope,
|
|
@@ -4837,7 +4835,7 @@ const createInsightsProvider = (model) => Object.freeze({
|
|
|
4837
4835
|
reportingInstallations: bundleInstallations,
|
|
4838
4836
|
appliedReports,
|
|
4839
4837
|
recoveredReports,
|
|
4840
|
-
|
|
4838
|
+
unchangedReports
|
|
4841
4839
|
}
|
|
4842
4840
|
};
|
|
4843
4841
|
}
|
|
@@ -5635,7 +5633,7 @@ const parseFirebaseBundleEventRow = (value, source) => {
|
|
|
5635
5633
|
const type = string(property(input, "type"), source);
|
|
5636
5634
|
const fromBundleId = requiredNullableString(input, "from_bundle_id", source);
|
|
5637
5635
|
const updateStrategy = requiredNullableString(input, "update_strategy", source);
|
|
5638
|
-
if (!((type === "UPDATE_APPLIED" || type === "RECOVERED"
|
|
5636
|
+
if (!((type === "UPDATE_APPLIED" || type === "RECOVERED") && typeof fromBundleId === "string" && (updateStrategy === "fingerprint" || updateStrategy === "appVersion") || type === "UNCHANGED" && fromBundleId === null && updateStrategy === null)) throw new FirebaseDatabaseDataError(source);
|
|
5639
5637
|
return {
|
|
5640
5638
|
id: string(property(input, "id"), source),
|
|
5641
5639
|
type,
|
|
@@ -5659,7 +5657,7 @@ const parseFirebaseBundleEventRow = (value, source) => {
|
|
|
5659
5657
|
const parseFirebaseInsightsInstallationRow = (value, source) => {
|
|
5660
5658
|
const input = record(value, source);
|
|
5661
5659
|
const type = string(property(input, "type"), source);
|
|
5662
|
-
if (type !== "UPDATE_APPLIED" && type !== "RECOVERED" && type !== "
|
|
5660
|
+
if (type !== "UPDATE_APPLIED" && type !== "RECOVERED" && type !== "UNCHANGED") throw new FirebaseDatabaseDataError(source);
|
|
5663
5661
|
return {
|
|
5664
5662
|
id: string(property(input, "id"), source),
|
|
5665
5663
|
type,
|
package/dist/iac/index.cjs
CHANGED
|
@@ -6866,7 +6866,7 @@ const parseFirebaseBundleEventRow = (value, source) => {
|
|
|
6866
6866
|
const type = string(property(input, "type"), source);
|
|
6867
6867
|
const fromBundleId = requiredNullableString(input, "from_bundle_id", source);
|
|
6868
6868
|
const updateStrategy = requiredNullableString(input, "update_strategy", source);
|
|
6869
|
-
if (!((type === "UPDATE_APPLIED" || type === "RECOVERED"
|
|
6869
|
+
if (!((type === "UPDATE_APPLIED" || type === "RECOVERED") && typeof fromBundleId === "string" && (updateStrategy === "fingerprint" || updateStrategy === "appVersion") || type === "UNCHANGED" && fromBundleId === null && updateStrategy === null)) throw new FirebaseDatabaseDataError(source);
|
|
6870
6870
|
return {
|
|
6871
6871
|
id: string(property(input, "id"), source),
|
|
6872
6872
|
type,
|
|
@@ -6890,7 +6890,7 @@ const parseFirebaseBundleEventRow = (value, source) => {
|
|
|
6890
6890
|
const parseFirebaseInsightsInstallationRow = (value, source) => {
|
|
6891
6891
|
const input = record(value, source);
|
|
6892
6892
|
const type = string(property(input, "type"), source);
|
|
6893
|
-
if (type !== "UPDATE_APPLIED" && type !== "RECOVERED" && type !== "
|
|
6893
|
+
if (type !== "UPDATE_APPLIED" && type !== "RECOVERED" && type !== "UNCHANGED") throw new FirebaseDatabaseDataError(source);
|
|
6894
6894
|
return {
|
|
6895
6895
|
id: string(property(input, "id"), source),
|
|
6896
6896
|
type,
|
package/dist/iac/index.mjs
CHANGED
|
@@ -6859,7 +6859,7 @@ const parseFirebaseBundleEventRow = (value, source) => {
|
|
|
6859
6859
|
const type = string(property(input, "type"), source);
|
|
6860
6860
|
const fromBundleId = requiredNullableString(input, "from_bundle_id", source);
|
|
6861
6861
|
const updateStrategy = requiredNullableString(input, "update_strategy", source);
|
|
6862
|
-
if (!((type === "UPDATE_APPLIED" || type === "RECOVERED"
|
|
6862
|
+
if (!((type === "UPDATE_APPLIED" || type === "RECOVERED") && typeof fromBundleId === "string" && (updateStrategy === "fingerprint" || updateStrategy === "appVersion") || type === "UNCHANGED" && fromBundleId === null && updateStrategy === null)) throw new FirebaseDatabaseDataError(source);
|
|
6863
6863
|
return {
|
|
6864
6864
|
id: string(property(input, "id"), source),
|
|
6865
6865
|
type,
|
|
@@ -6883,7 +6883,7 @@ const parseFirebaseBundleEventRow = (value, source) => {
|
|
|
6883
6883
|
const parseFirebaseInsightsInstallationRow = (value, source) => {
|
|
6884
6884
|
const input = record(value, source);
|
|
6885
6885
|
const type = string(property(input, "type"), source);
|
|
6886
|
-
if (type !== "UPDATE_APPLIED" && type !== "RECOVERED" && type !== "
|
|
6886
|
+
if (type !== "UPDATE_APPLIED" && type !== "RECOVERED" && type !== "UNCHANGED") throw new FirebaseDatabaseDataError(source);
|
|
6887
6887
|
return {
|
|
6888
6888
|
id: string(property(input, "id"), source),
|
|
6889
6889
|
type,
|
package/dist/index.cjs
CHANGED
|
@@ -97,7 +97,7 @@ const parseFirebaseBundleEventRow = (value, source) => {
|
|
|
97
97
|
const type = string(property(input, "type"), source);
|
|
98
98
|
const fromBundleId = requiredNullableString(input, "from_bundle_id", source);
|
|
99
99
|
const updateStrategy = requiredNullableString(input, "update_strategy", source);
|
|
100
|
-
if (!((type === "UPDATE_APPLIED" || type === "RECOVERED"
|
|
100
|
+
if (!((type === "UPDATE_APPLIED" || type === "RECOVERED") && typeof fromBundleId === "string" && (updateStrategy === "fingerprint" || updateStrategy === "appVersion") || type === "UNCHANGED" && fromBundleId === null && updateStrategy === null)) throw new FirebaseDatabaseDataError(source);
|
|
101
101
|
return {
|
|
102
102
|
id: string(property(input, "id"), source),
|
|
103
103
|
type,
|
|
@@ -121,7 +121,7 @@ const parseFirebaseBundleEventRow = (value, source) => {
|
|
|
121
121
|
const parseFirebaseInsightsInstallationRow = (value, source) => {
|
|
122
122
|
const input = record(value, source);
|
|
123
123
|
const type = string(property(input, "type"), source);
|
|
124
|
-
if (type !== "UPDATE_APPLIED" && type !== "RECOVERED" && type !== "
|
|
124
|
+
if (type !== "UPDATE_APPLIED" && type !== "RECOVERED" && type !== "UNCHANGED") throw new FirebaseDatabaseDataError(source);
|
|
125
125
|
return {
|
|
126
126
|
id: string(property(input, "id"), source),
|
|
127
127
|
type,
|
package/dist/index.mjs
CHANGED
|
@@ -96,7 +96,7 @@ const parseFirebaseBundleEventRow = (value, source) => {
|
|
|
96
96
|
const type = string(property(input, "type"), source);
|
|
97
97
|
const fromBundleId = requiredNullableString(input, "from_bundle_id", source);
|
|
98
98
|
const updateStrategy = requiredNullableString(input, "update_strategy", source);
|
|
99
|
-
if (!((type === "UPDATE_APPLIED" || type === "RECOVERED"
|
|
99
|
+
if (!((type === "UPDATE_APPLIED" || type === "RECOVERED") && typeof fromBundleId === "string" && (updateStrategy === "fingerprint" || updateStrategy === "appVersion") || type === "UNCHANGED" && fromBundleId === null && updateStrategy === null)) throw new FirebaseDatabaseDataError(source);
|
|
100
100
|
return {
|
|
101
101
|
id: string(property(input, "id"), source),
|
|
102
102
|
type,
|
|
@@ -120,7 +120,7 @@ const parseFirebaseBundleEventRow = (value, source) => {
|
|
|
120
120
|
const parseFirebaseInsightsInstallationRow = (value, source) => {
|
|
121
121
|
const input = record(value, source);
|
|
122
122
|
const type = string(property(input, "type"), source);
|
|
123
|
-
if (type !== "UPDATE_APPLIED" && type !== "RECOVERED" && type !== "
|
|
123
|
+
if (type !== "UPDATE_APPLIED" && type !== "RECOVERED" && type !== "UNCHANGED") throw new FirebaseDatabaseDataError(source);
|
|
124
124
|
return {
|
|
125
125
|
id: string(property(input, "id"), source),
|
|
126
126
|
type,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/firebase",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.4",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"types": "dist/index.d.cts",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"hono": "4.12.34",
|
|
46
|
-
"@hot-updater/cli-tools": "1.0.0-rc.
|
|
46
|
+
"@hot-updater/cli-tools": "1.0.0-rc.3",
|
|
47
|
+
"@hot-updater/plugin-core": "1.0.0-rc.3",
|
|
47
48
|
"@hot-updater/core": "1.0.0-rc.0",
|
|
48
|
-
"@hot-updater/
|
|
49
|
-
"@hot-updater/server": "1.0.0-rc.2"
|
|
49
|
+
"@hot-updater/server": "1.0.0-rc.3"
|
|
50
50
|
},
|
|
51
51
|
"publishConfig": {
|
|
52
52
|
"access": "public"
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"firebase-tools": "^13.32.0",
|
|
62
62
|
"fkill": "^9.0.0",
|
|
63
63
|
"mime": "^4.0.4",
|
|
64
|
-
"@hot-updater/mock": "1.0.0-rc.
|
|
65
|
-
"@hot-updater/test-utils": "1.0.0-rc.
|
|
64
|
+
"@hot-updater/mock": "1.0.0-rc.3",
|
|
65
|
+
"@hot-updater/test-utils": "1.0.0-rc.3"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"firebase-admin": "*",
|