@hot-updater/aws 1.0.0-rc.2 → 1.0.0-rc.3
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/iac/index.cjs +5 -5
- package/dist/iac/index.mjs +5 -5
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +5 -5
- package/dist/lambda/index.cjs +19 -21
- package/package.json +6 -6
package/dist/iac/index.cjs
CHANGED
|
@@ -7839,10 +7839,10 @@ const hasValidBundleEventShape = (value) => {
|
|
|
7839
7839
|
const type = field(value, "type");
|
|
7840
7840
|
const fromBundleId = field(value, "from_bundle_id");
|
|
7841
7841
|
const updateStrategy = field(value, "update_strategy");
|
|
7842
|
-
return (type === "UPDATE_APPLIED" || type === "RECOVERED"
|
|
7842
|
+
return (type === "UPDATE_APPLIED" || type === "RECOVERED") && typeof fromBundleId === "string" && (updateStrategy === "fingerprint" || updateStrategy === "appVersion") || type === "UNCHANGED" && fromBundleId === null && updateStrategy === null;
|
|
7843
7843
|
};
|
|
7844
7844
|
const isBundleEventRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "from_release_id")) && isNullableString(field(value, "to_release_id")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "platform") === "ios" || field(value, "platform") === "android") && typeof field(value, "received_at_ms") === "number" && hasValidBundleEventShape(value);
|
|
7845
|
-
const isInsightsInstallationRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "user_id")) && isNullableString(field(value, "username")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "type") === "UPDATE_APPLIED" || field(value, "type") === "RECOVERED" || field(value, "type") === "
|
|
7845
|
+
const isInsightsInstallationRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "user_id")) && isNullableString(field(value, "username")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "type") === "UPDATE_APPLIED" || field(value, "type") === "RECOVERED" || field(value, "type") === "UNCHANGED") && (field(value, "platform") === "ios" || field(value, "platform") === "android") && typeof field(value, "app_version") === "string" && typeof field(value, "channel") === "string" && typeof field(value, "cohort") === "string" && typeof field(value, "received_at_ms") === "number";
|
|
7846
7846
|
const isApiKeyRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "hash") === "string" && typeof field(value, "name") === "string" && typeof field(value, "prefix") === "string" && field(value, "role") === "client" && typeof field(value, "created_at_ms") === "number" && (field(value, "revoked_at_ms") === null || typeof field(value, "revoked_at_ms") === "number");
|
|
7847
7847
|
const parseOfficialRowItem = (value, partition, isRow) => {
|
|
7848
7848
|
if (value.pk !== partition || typeof value.sk !== "string" || typeof value.version !== "number" || !isRow(value.row)) throw new DynamoDBStoredItemError();
|
|
@@ -7864,7 +7864,7 @@ const insightsBundlePartition = (filter) => {
|
|
|
7864
7864
|
]);
|
|
7865
7865
|
return `${DYNAMODB_INSIGHTS_BUNDLE_PREFIX}${(0, node_crypto.createHash)("sha256").update(scope, "utf8").digest("hex")}`;
|
|
7866
7866
|
};
|
|
7867
|
-
const toInsightsBundleItem = (row) =>
|
|
7867
|
+
const toInsightsBundleItem = (row) => boundedDynamoDBMetadataItem({
|
|
7868
7868
|
pk: insightsBundlePartition({
|
|
7869
7869
|
platform: row.platform,
|
|
7870
7870
|
channel: row.channel,
|
|
@@ -7950,10 +7950,10 @@ const recordDynamoDBInsightsEvent = async (store, { event: row, installation: ne
|
|
|
7950
7950
|
TableName: store.tableName,
|
|
7951
7951
|
Item: eventItem
|
|
7952
7952
|
} },
|
|
7953
|
-
|
|
7953
|
+
{ Put: {
|
|
7954
7954
|
TableName: store.tableName,
|
|
7955
7955
|
Item: bundleItem
|
|
7956
|
-
} }
|
|
7956
|
+
} }
|
|
7957
7957
|
];
|
|
7958
7958
|
if (current === null || advancesInsightsInstallation(next, current.row)) {
|
|
7959
7959
|
actions.push({ Put: {
|
package/dist/iac/index.mjs
CHANGED
|
@@ -7834,10 +7834,10 @@ const hasValidBundleEventShape = (value) => {
|
|
|
7834
7834
|
const type = field(value, "type");
|
|
7835
7835
|
const fromBundleId = field(value, "from_bundle_id");
|
|
7836
7836
|
const updateStrategy = field(value, "update_strategy");
|
|
7837
|
-
return (type === "UPDATE_APPLIED" || type === "RECOVERED"
|
|
7837
|
+
return (type === "UPDATE_APPLIED" || type === "RECOVERED") && typeof fromBundleId === "string" && (updateStrategy === "fingerprint" || updateStrategy === "appVersion") || type === "UNCHANGED" && fromBundleId === null && updateStrategy === null;
|
|
7838
7838
|
};
|
|
7839
7839
|
const isBundleEventRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "from_release_id")) && isNullableString(field(value, "to_release_id")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "platform") === "ios" || field(value, "platform") === "android") && typeof field(value, "received_at_ms") === "number" && hasValidBundleEventShape(value);
|
|
7840
|
-
const isInsightsInstallationRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "user_id")) && isNullableString(field(value, "username")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "type") === "UPDATE_APPLIED" || field(value, "type") === "RECOVERED" || field(value, "type") === "
|
|
7840
|
+
const isInsightsInstallationRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "user_id")) && isNullableString(field(value, "username")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "type") === "UPDATE_APPLIED" || field(value, "type") === "RECOVERED" || field(value, "type") === "UNCHANGED") && (field(value, "platform") === "ios" || field(value, "platform") === "android") && typeof field(value, "app_version") === "string" && typeof field(value, "channel") === "string" && typeof field(value, "cohort") === "string" && typeof field(value, "received_at_ms") === "number";
|
|
7841
7841
|
const isApiKeyRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "hash") === "string" && typeof field(value, "name") === "string" && typeof field(value, "prefix") === "string" && field(value, "role") === "client" && typeof field(value, "created_at_ms") === "number" && (field(value, "revoked_at_ms") === null || typeof field(value, "revoked_at_ms") === "number");
|
|
7842
7842
|
const parseOfficialRowItem = (value, partition, isRow) => {
|
|
7843
7843
|
if (value.pk !== partition || typeof value.sk !== "string" || typeof value.version !== "number" || !isRow(value.row)) throw new DynamoDBStoredItemError();
|
|
@@ -7859,7 +7859,7 @@ const insightsBundlePartition = (filter) => {
|
|
|
7859
7859
|
]);
|
|
7860
7860
|
return `${DYNAMODB_INSIGHTS_BUNDLE_PREFIX}${createHash("sha256").update(scope, "utf8").digest("hex")}`;
|
|
7861
7861
|
};
|
|
7862
|
-
const toInsightsBundleItem = (row) =>
|
|
7862
|
+
const toInsightsBundleItem = (row) => boundedDynamoDBMetadataItem({
|
|
7863
7863
|
pk: insightsBundlePartition({
|
|
7864
7864
|
platform: row.platform,
|
|
7865
7865
|
channel: row.channel,
|
|
@@ -7945,10 +7945,10 @@ const recordDynamoDBInsightsEvent = async (store, { event: row, installation: ne
|
|
|
7945
7945
|
TableName: store.tableName,
|
|
7946
7946
|
Item: eventItem
|
|
7947
7947
|
} },
|
|
7948
|
-
|
|
7948
|
+
{ Put: {
|
|
7949
7949
|
TableName: store.tableName,
|
|
7950
7950
|
Item: bundleItem
|
|
7951
|
-
} }
|
|
7951
|
+
} }
|
|
7952
7952
|
];
|
|
7953
7953
|
if (current === null || advancesInsightsInstallation(next, current.row)) {
|
|
7954
7954
|
actions.push({ Put: {
|
package/dist/index.cjs
CHANGED
|
@@ -1575,10 +1575,10 @@ const hasValidBundleEventShape = (value) => {
|
|
|
1575
1575
|
const type = field(value, "type");
|
|
1576
1576
|
const fromBundleId = field(value, "from_bundle_id");
|
|
1577
1577
|
const updateStrategy = field(value, "update_strategy");
|
|
1578
|
-
return (type === "UPDATE_APPLIED" || type === "RECOVERED"
|
|
1578
|
+
return (type === "UPDATE_APPLIED" || type === "RECOVERED") && typeof fromBundleId === "string" && (updateStrategy === "fingerprint" || updateStrategy === "appVersion") || type === "UNCHANGED" && fromBundleId === null && updateStrategy === null;
|
|
1579
1579
|
};
|
|
1580
1580
|
const isBundleEventRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "from_release_id")) && isNullableString(field(value, "to_release_id")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "platform") === "ios" || field(value, "platform") === "android") && typeof field(value, "received_at_ms") === "number" && hasValidBundleEventShape(value);
|
|
1581
|
-
const isInsightsInstallationRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "user_id")) && isNullableString(field(value, "username")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "type") === "UPDATE_APPLIED" || field(value, "type") === "RECOVERED" || field(value, "type") === "
|
|
1581
|
+
const isInsightsInstallationRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "user_id")) && isNullableString(field(value, "username")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "type") === "UPDATE_APPLIED" || field(value, "type") === "RECOVERED" || field(value, "type") === "UNCHANGED") && (field(value, "platform") === "ios" || field(value, "platform") === "android") && typeof field(value, "app_version") === "string" && typeof field(value, "channel") === "string" && typeof field(value, "cohort") === "string" && typeof field(value, "received_at_ms") === "number";
|
|
1582
1582
|
const isApiKeyRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "hash") === "string" && typeof field(value, "name") === "string" && typeof field(value, "prefix") === "string" && field(value, "role") === "client" && typeof field(value, "created_at_ms") === "number" && (field(value, "revoked_at_ms") === null || typeof field(value, "revoked_at_ms") === "number");
|
|
1583
1583
|
const parseOfficialRowItem = (value, partition, isRow) => {
|
|
1584
1584
|
if (value.pk !== partition || typeof value.sk !== "string" || typeof value.version !== "number" || !isRow(value.row)) throw new DynamoDBStoredItemError();
|
|
@@ -1600,7 +1600,7 @@ const insightsBundlePartition = (filter) => {
|
|
|
1600
1600
|
]);
|
|
1601
1601
|
return `${DYNAMODB_INSIGHTS_BUNDLE_PREFIX}${(0, node_crypto.createHash)("sha256").update(scope, "utf8").digest("hex")}`;
|
|
1602
1602
|
};
|
|
1603
|
-
const toInsightsBundleItem = (row) =>
|
|
1603
|
+
const toInsightsBundleItem = (row) => boundedDynamoDBMetadataItem({
|
|
1604
1604
|
pk: insightsBundlePartition({
|
|
1605
1605
|
platform: row.platform,
|
|
1606
1606
|
channel: row.channel,
|
|
@@ -1686,10 +1686,10 @@ const recordDynamoDBInsightsEvent = async (store, { event: row, installation: ne
|
|
|
1686
1686
|
TableName: store.tableName,
|
|
1687
1687
|
Item: eventItem
|
|
1688
1688
|
} },
|
|
1689
|
-
|
|
1689
|
+
{ Put: {
|
|
1690
1690
|
TableName: store.tableName,
|
|
1691
1691
|
Item: bundleItem
|
|
1692
|
-
} }
|
|
1692
|
+
} }
|
|
1693
1693
|
];
|
|
1694
1694
|
if (current === null || advancesInsightsInstallation(next, current.row)) {
|
|
1695
1695
|
actions.push({ Put: {
|
package/dist/index.mjs
CHANGED
|
@@ -1574,10 +1574,10 @@ const hasValidBundleEventShape = (value) => {
|
|
|
1574
1574
|
const type = field(value, "type");
|
|
1575
1575
|
const fromBundleId = field(value, "from_bundle_id");
|
|
1576
1576
|
const updateStrategy = field(value, "update_strategy");
|
|
1577
|
-
return (type === "UPDATE_APPLIED" || type === "RECOVERED"
|
|
1577
|
+
return (type === "UPDATE_APPLIED" || type === "RECOVERED") && typeof fromBundleId === "string" && (updateStrategy === "fingerprint" || updateStrategy === "appVersion") || type === "UNCHANGED" && fromBundleId === null && updateStrategy === null;
|
|
1578
1578
|
};
|
|
1579
1579
|
const isBundleEventRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "from_release_id")) && isNullableString(field(value, "to_release_id")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "platform") === "ios" || field(value, "platform") === "android") && typeof field(value, "received_at_ms") === "number" && hasValidBundleEventShape(value);
|
|
1580
|
-
const isInsightsInstallationRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "user_id")) && isNullableString(field(value, "username")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "type") === "UPDATE_APPLIED" || field(value, "type") === "RECOVERED" || field(value, "type") === "
|
|
1580
|
+
const isInsightsInstallationRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "user_id")) && isNullableString(field(value, "username")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "type") === "UPDATE_APPLIED" || field(value, "type") === "RECOVERED" || field(value, "type") === "UNCHANGED") && (field(value, "platform") === "ios" || field(value, "platform") === "android") && typeof field(value, "app_version") === "string" && typeof field(value, "channel") === "string" && typeof field(value, "cohort") === "string" && typeof field(value, "received_at_ms") === "number";
|
|
1581
1581
|
const isApiKeyRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "hash") === "string" && typeof field(value, "name") === "string" && typeof field(value, "prefix") === "string" && field(value, "role") === "client" && typeof field(value, "created_at_ms") === "number" && (field(value, "revoked_at_ms") === null || typeof field(value, "revoked_at_ms") === "number");
|
|
1582
1582
|
const parseOfficialRowItem = (value, partition, isRow) => {
|
|
1583
1583
|
if (value.pk !== partition || typeof value.sk !== "string" || typeof value.version !== "number" || !isRow(value.row)) throw new DynamoDBStoredItemError();
|
|
@@ -1599,7 +1599,7 @@ const insightsBundlePartition = (filter) => {
|
|
|
1599
1599
|
]);
|
|
1600
1600
|
return `${DYNAMODB_INSIGHTS_BUNDLE_PREFIX}${createHash("sha256").update(scope, "utf8").digest("hex")}`;
|
|
1601
1601
|
};
|
|
1602
|
-
const toInsightsBundleItem = (row) =>
|
|
1602
|
+
const toInsightsBundleItem = (row) => boundedDynamoDBMetadataItem({
|
|
1603
1603
|
pk: insightsBundlePartition({
|
|
1604
1604
|
platform: row.platform,
|
|
1605
1605
|
channel: row.channel,
|
|
@@ -1685,10 +1685,10 @@ const recordDynamoDBInsightsEvent = async (store, { event: row, installation: ne
|
|
|
1685
1685
|
TableName: store.tableName,
|
|
1686
1686
|
Item: eventItem
|
|
1687
1687
|
} },
|
|
1688
|
-
|
|
1688
|
+
{ Put: {
|
|
1689
1689
|
TableName: store.tableName,
|
|
1690
1690
|
Item: bundleItem
|
|
1691
|
-
} }
|
|
1691
|
+
} }
|
|
1692
1692
|
];
|
|
1693
1693
|
if (current === null || advancesInsightsInstallation(next, current.row)) {
|
|
1694
1694
|
actions.push({ Put: {
|
package/dist/lambda/index.cjs
CHANGED
|
@@ -32,7 +32,7 @@ let _aws_sdk_client_s3 = require("@aws-sdk/client-s3");
|
|
|
32
32
|
let _aws_sdk_lib_storage = require("@aws-sdk/lib-storage");
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region ../../packages/server/dist/version.mjs
|
|
35
|
-
const HOT_UPDATER_SERVER_VERSION = "1.0.0-rc.
|
|
35
|
+
const HOT_UPDATER_SERVER_VERSION = "1.0.0-rc.3";
|
|
36
36
|
//#endregion
|
|
37
37
|
//#region ../../packages/server/dist/handlerVersionRoutes.mjs
|
|
38
38
|
const createVersionRouteHandlers = () => ({ version: async () => Response.json({
|
|
@@ -835,7 +835,7 @@ const modelValidators = {
|
|
|
835
835
|
},
|
|
836
836
|
bundle_events: {
|
|
837
837
|
id: (value) => typeof value === "string",
|
|
838
|
-
type: (value) => value === "UPDATE_APPLIED" || value === "RECOVERED" || value === "
|
|
838
|
+
type: (value) => value === "UPDATE_APPLIED" || value === "RECOVERED" || value === "UNCHANGED",
|
|
839
839
|
install_id: isInsightsIdentityText,
|
|
840
840
|
user_id: isNullableInsightsIdentityText,
|
|
841
841
|
username: (value) => value === null || typeof value === "string",
|
|
@@ -858,7 +858,7 @@ const modelValidators = {
|
|
|
858
858
|
user_id: isNullableInsightsIdentityText,
|
|
859
859
|
username: (value) => value === null || typeof value === "string",
|
|
860
860
|
to_bundle_id: (value) => typeof value === "string",
|
|
861
|
-
type: (value) => value === "UPDATE_APPLIED" || value === "RECOVERED" || value === "
|
|
861
|
+
type: (value) => value === "UPDATE_APPLIED" || value === "RECOVERED" || value === "UNCHANGED",
|
|
862
862
|
platform: (value) => value === "ios" || value === "android",
|
|
863
863
|
app_version: (value) => typeof value === "string",
|
|
864
864
|
channel: (value) => typeof value === "string",
|
|
@@ -1061,7 +1061,7 @@ const hasValidReleaseInvariants = (data) => {
|
|
|
1061
1061
|
const fingerprintHash = data.fingerprint_hash;
|
|
1062
1062
|
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");
|
|
1063
1063
|
};
|
|
1064
|
-
const hasValidBundleEventInvariants = (data) => (data.type === "UPDATE_APPLIED" || data.type === "RECOVERED"
|
|
1064
|
+
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;
|
|
1065
1065
|
const validateCreateData = (model, data) => {
|
|
1066
1066
|
if (!isRecord$3(data)) throw new DatabasePluginInputError("invalid-data");
|
|
1067
1067
|
validateFields(model, Object.keys(data));
|
|
@@ -1131,7 +1131,7 @@ const isBundleFilter = (value, withKind = false) => {
|
|
|
1131
1131
|
"type",
|
|
1132
1132
|
...withKind ? ["kind"] : []
|
|
1133
1133
|
];
|
|
1134
|
-
return value.type === "RECOVERED" ? isText(value.fromBundleId) && hasOnlyKeys$1(value, [...keys, "fromBundleId"]) : (value.type === "UPDATE_APPLIED" || value.type === "
|
|
1134
|
+
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"]);
|
|
1135
1135
|
};
|
|
1136
1136
|
const isEventFilter = (value) => {
|
|
1137
1137
|
if (!isRecord$3(value)) return false;
|
|
@@ -1165,7 +1165,7 @@ const toInsightsInstallationRow = (event) => {
|
|
|
1165
1165
|
received_at_ms: event.received_at_ms
|
|
1166
1166
|
};
|
|
1167
1167
|
};
|
|
1168
|
-
/**
|
|
1168
|
+
/** Unchanged reports are not bundle movements. */
|
|
1169
1169
|
const isInsightsMovementEvent = (event) => event.type === "UPDATE_APPLIED" || event.type === "RECOVERED";
|
|
1170
1170
|
const matchesInsightsEventFilter = (event, filter) => {
|
|
1171
1171
|
if (filter.kind === "all") return true;
|
|
@@ -4219,8 +4219,7 @@ function requireEvent(payload) {
|
|
|
4219
4219
|
const type = requireStringField(payload, "type");
|
|
4220
4220
|
switch (type) {
|
|
4221
4221
|
case "UPDATE_APPLIED":
|
|
4222
|
-
case "RECOVERED":
|
|
4223
|
-
case "RELEASE_ADOPTED": {
|
|
4222
|
+
case "RECOVERED": {
|
|
4224
4223
|
const updateStrategy = requireStringField(payload, "updateStrategy");
|
|
4225
4224
|
if (updateStrategy !== "fingerprint" && updateStrategy !== "appVersion") throw new InsightsBadRequestError("Invalid event field: updateStrategy");
|
|
4226
4225
|
return {
|
|
@@ -4264,8 +4263,7 @@ function createBundleEventRow(input) {
|
|
|
4264
4263
|
};
|
|
4265
4264
|
switch (input.type) {
|
|
4266
4265
|
case "UPDATE_APPLIED":
|
|
4267
|
-
case "RECOVERED":
|
|
4268
|
-
case "RELEASE_ADOPTED": return {
|
|
4266
|
+
case "RECOVERED": return {
|
|
4269
4267
|
...base,
|
|
4270
4268
|
from_bundle_id: input.fromBundleId,
|
|
4271
4269
|
type: input.type,
|
|
@@ -4332,7 +4330,7 @@ const parseEventPageInput = (request) => {
|
|
|
4332
4330
|
let bundle;
|
|
4333
4331
|
if (bundleFields.some((key) => url.searchParams.has(key))) {
|
|
4334
4332
|
const outcome = readSingle(url, "outcome");
|
|
4335
|
-
if (outcome !== "applied" && outcome !== "recovered" && outcome !== "
|
|
4333
|
+
if (outcome !== "applied" && outcome !== "recovered" && outcome !== "unchanged") throw new InsightsBadRequestError("Invalid 'outcome' query parameter.");
|
|
4336
4334
|
bundle = {
|
|
4337
4335
|
...readScope$1(url),
|
|
4338
4336
|
bundleId: readId(url, "bundleId", 1024),
|
|
@@ -4653,9 +4651,9 @@ const bundleFilter = (input) => {
|
|
|
4653
4651
|
type: "RECOVERED",
|
|
4654
4652
|
fromBundleId: bundleId
|
|
4655
4653
|
};
|
|
4656
|
-
case "
|
|
4654
|
+
case "unchanged": return {
|
|
4657
4655
|
...scope,
|
|
4658
|
-
type: "
|
|
4656
|
+
type: "UNCHANGED",
|
|
4659
4657
|
toBundleId: bundleId
|
|
4660
4658
|
};
|
|
4661
4659
|
default: throw new InsightsBadRequestError("Invalid Insights outcome.");
|
|
@@ -4862,7 +4860,7 @@ const createInsightsProvider = (model) => Object.freeze({
|
|
|
4862
4860
|
sinceMs,
|
|
4863
4861
|
beforeReceivedAtMs
|
|
4864
4862
|
}));
|
|
4865
|
-
const [reportingInstallations, bundleInstallations, appliedReports, recoveredReports,
|
|
4863
|
+
const [reportingInstallations, bundleInstallations, appliedReports, recoveredReports, unchangedReports] = await Promise.all([
|
|
4866
4864
|
reporting,
|
|
4867
4865
|
measure(model.countInstallations({
|
|
4868
4866
|
...scope,
|
|
@@ -4871,7 +4869,7 @@ const createInsightsProvider = (model) => Object.freeze({
|
|
|
4871
4869
|
})),
|
|
4872
4870
|
countOutcome("applied"),
|
|
4873
4871
|
countOutcome("recovered"),
|
|
4874
|
-
countOutcome("
|
|
4872
|
+
countOutcome("unchanged")
|
|
4875
4873
|
]);
|
|
4876
4874
|
return {
|
|
4877
4875
|
...scope,
|
|
@@ -4884,7 +4882,7 @@ const createInsightsProvider = (model) => Object.freeze({
|
|
|
4884
4882
|
reportingInstallations: bundleInstallations,
|
|
4885
4883
|
appliedReports,
|
|
4886
4884
|
recoveredReports,
|
|
4887
|
-
|
|
4885
|
+
unchangedReports
|
|
4888
4886
|
}
|
|
4889
4887
|
};
|
|
4890
4888
|
}
|
|
@@ -9120,10 +9118,10 @@ const hasValidBundleEventShape = (value) => {
|
|
|
9120
9118
|
const type = field(value, "type");
|
|
9121
9119
|
const fromBundleId = field(value, "from_bundle_id");
|
|
9122
9120
|
const updateStrategy = field(value, "update_strategy");
|
|
9123
|
-
return (type === "UPDATE_APPLIED" || type === "RECOVERED"
|
|
9121
|
+
return (type === "UPDATE_APPLIED" || type === "RECOVERED") && typeof fromBundleId === "string" && (updateStrategy === "fingerprint" || updateStrategy === "appVersion") || type === "UNCHANGED" && fromBundleId === null && updateStrategy === null;
|
|
9124
9122
|
};
|
|
9125
9123
|
const isBundleEventRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "from_release_id")) && isNullableString(field(value, "to_release_id")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "platform") === "ios" || field(value, "platform") === "android") && typeof field(value, "received_at_ms") === "number" && hasValidBundleEventShape(value);
|
|
9126
|
-
const isInsightsInstallationRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "user_id")) && isNullableString(field(value, "username")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "type") === "UPDATE_APPLIED" || field(value, "type") === "RECOVERED" || field(value, "type") === "
|
|
9124
|
+
const isInsightsInstallationRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "install_id") === "string" && isNullableString(field(value, "user_id")) && isNullableString(field(value, "username")) && typeof field(value, "to_bundle_id") === "string" && (field(value, "type") === "UPDATE_APPLIED" || field(value, "type") === "RECOVERED" || field(value, "type") === "UNCHANGED") && (field(value, "platform") === "ios" || field(value, "platform") === "android") && typeof field(value, "app_version") === "string" && typeof field(value, "channel") === "string" && typeof field(value, "cohort") === "string" && typeof field(value, "received_at_ms") === "number";
|
|
9127
9125
|
const isApiKeyRow = (value) => typeof value === "object" && value !== null && typeof field(value, "id") === "string" && typeof field(value, "hash") === "string" && typeof field(value, "name") === "string" && typeof field(value, "prefix") === "string" && field(value, "role") === "client" && typeof field(value, "created_at_ms") === "number" && (field(value, "revoked_at_ms") === null || typeof field(value, "revoked_at_ms") === "number");
|
|
9128
9126
|
const parseOfficialRowItem = (value, partition, isRow) => {
|
|
9129
9127
|
if (value.pk !== partition || typeof value.sk !== "string" || typeof value.version !== "number" || !isRow(value.row)) throw new DynamoDBStoredItemError();
|
|
@@ -9145,7 +9143,7 @@ const insightsBundlePartition = (filter) => {
|
|
|
9145
9143
|
]);
|
|
9146
9144
|
return `${DYNAMODB_INSIGHTS_BUNDLE_PREFIX}${(0, node_crypto.createHash)("sha256").update(scope, "utf8").digest("hex")}`;
|
|
9147
9145
|
};
|
|
9148
|
-
const toInsightsBundleItem = (row) =>
|
|
9146
|
+
const toInsightsBundleItem = (row) => boundedDynamoDBMetadataItem({
|
|
9149
9147
|
pk: insightsBundlePartition({
|
|
9150
9148
|
platform: row.platform,
|
|
9151
9149
|
channel: row.channel,
|
|
@@ -9231,10 +9229,10 @@ const recordDynamoDBInsightsEvent = async (store, { event: row, installation: ne
|
|
|
9231
9229
|
TableName: store.tableName,
|
|
9232
9230
|
Item: eventItem
|
|
9233
9231
|
} },
|
|
9234
|
-
|
|
9232
|
+
{ Put: {
|
|
9235
9233
|
TableName: store.tableName,
|
|
9236
9234
|
Item: bundleItem
|
|
9237
|
-
} }
|
|
9235
|
+
} }
|
|
9238
9236
|
];
|
|
9239
9237
|
if (current === null || advancesInsightsInstallation(next, current.row)) {
|
|
9240
9238
|
actions.push({ Put: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/aws",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.3",
|
|
5
5
|
"description": "React Native OTA solution for self-hosted",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.mjs",
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
"execa": "9.5.2",
|
|
52
52
|
"mime": "^4.0.4",
|
|
53
53
|
"@hot-updater/core": "1.0.0-rc.0",
|
|
54
|
-
"@hot-updater/mock": "1.0.0-rc.
|
|
55
|
-
"@hot-updater/test-utils": "1.0.0-rc.
|
|
54
|
+
"@hot-updater/mock": "1.0.0-rc.3",
|
|
55
|
+
"@hot-updater/test-utils": "1.0.0-rc.3"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@aws-sdk/client-cloudfront": "3.1066.0",
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
"@aws-sdk/lib-dynamodb": "3.1066.0",
|
|
69
69
|
"hono": "4.12.34",
|
|
70
70
|
"aws-lambda": "1.0.7",
|
|
71
|
-
"@hot-updater/cli-tools": "1.0.0-rc.
|
|
72
|
-
"@hot-updater/server": "1.0.0-rc.
|
|
73
|
-
"@hot-updater/plugin-core": "1.0.0-rc.
|
|
71
|
+
"@hot-updater/cli-tools": "1.0.0-rc.3",
|
|
72
|
+
"@hot-updater/server": "1.0.0-rc.3",
|
|
73
|
+
"@hot-updater/plugin-core": "1.0.0-rc.3"
|
|
74
74
|
},
|
|
75
75
|
"scripts": {
|
|
76
76
|
"build": "tsdown",
|