summaryrefslogtreecommitdiff
path: root/node_modules/@jet-app/app-store/tmp/src/api/models/metrics
diff options
context:
space:
mode:
authorrxliuli <rxliuli@gmail.com>2025-11-04 05:03:50 +0800
committerrxliuli <rxliuli@gmail.com>2025-11-04 05:03:50 +0800
commitbce557cc2dc767628bed6aac87301a1be7c5431b (patch)
treeb51a051228d01fe3306cd7626d4a96768aadb944 /node_modules/@jet-app/app-store/tmp/src/api/models/metrics
init commit
Diffstat (limited to 'node_modules/@jet-app/app-store/tmp/src/api/models/metrics')
-rw-r--r--node_modules/@jet-app/app-store/tmp/src/api/models/metrics/advert-action-metrics.js21
-rw-r--r--node_modules/@jet-app/app-store/tmp/src/api/models/metrics/metrics.js101
2 files changed, 122 insertions, 0 deletions
diff --git a/node_modules/@jet-app/app-store/tmp/src/api/models/metrics/advert-action-metrics.js b/node_modules/@jet-app/app-store/tmp/src/api/models/metrics/advert-action-metrics.js
new file mode 100644
index 0000000..4560458
--- /dev/null
+++ b/node_modules/@jet-app/app-store/tmp/src/api/models/metrics/advert-action-metrics.js
@@ -0,0 +1,21 @@
+/**
+ * Models for Advert Actions
+ */
+import * as models from "../base";
+/**
+ * @public
+ * Object that provides metrics data for actions pertaining to advert's native instrumentation.
+ */
+export class AdvertActionMetrics extends models.Model {
+ constructor(instanceId, adamId, bundleId, advertType, invocation, purchaseType, reportingDestination) {
+ super();
+ this.instanceId = instanceId;
+ this.adamId = adamId;
+ this.bundleId = bundleId;
+ this.advertType = advertType;
+ this.invocation = invocation;
+ this.purchaseType = purchaseType;
+ this.reportingDestination = reportingDestination;
+ }
+}
+//# sourceMappingURL=advert-action-metrics.js.map \ No newline at end of file
diff --git a/node_modules/@jet-app/app-store/tmp/src/api/models/metrics/metrics.js b/node_modules/@jet-app/app-store/tmp/src/api/models/metrics/metrics.js
new file mode 100644
index 0000000..23e26bd
--- /dev/null
+++ b/node_modules/@jet-app/app-store/tmp/src/api/models/metrics/metrics.js
@@ -0,0 +1,101 @@
+/**
+ * Created by joel on 2/13/17.
+ */
+import * as JetMetrics from "@jet/environment/types/metrics";
+import * as models from "../base";
+// TS only allows extending **type information** in `declare module`s.
+// These members **must** be initialized.
+// TODO: The root cause for this workaround is because the Jet type `PageInvocationPoint` is not a `const enum`.
+// Consider changing the Jet type to a `const enum`, and the compiler will automatically inline these values.
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+const extendedPageInvocationPoint = JetMetrics.PageInvocationPoint;
+extendedPageInvocationPoint["search"] = "search";
+extendedPageInvocationPoint["timer"] = "timer";
+extendedPageInvocationPoint["never"] = "never";
+extendedPageInvocationPoint["pageChange"] = "pageChange";
+/** @public */
+export class AppStoreMetricsData {
+ constructor(fields, includingFields, excludingFields, topic, shouldFlush = false) {
+ this.fields = fields;
+ this.includingFields = includingFields;
+ this.excludingFields = excludingFields;
+ this.topic = topic;
+ this.shouldFlush = shouldFlush;
+ }
+}
+/** @public */
+export class LintedMetricsEvent extends models.Model {
+ constructor(fields) {
+ super();
+ this.fields = fields;
+ }
+}
+/** @public */
+export class ActionMetrics extends models.Model {
+ constructor(events) {
+ super();
+ this.data = events || [];
+ this.custom = {};
+ }
+ addMetricsData(data) {
+ this.data.push(data);
+ }
+ addManyMetricsData(dataArray) {
+ for (const data of dataArray) {
+ this.addMetricsData(data);
+ }
+ }
+ clearAll() {
+ this.data.length = 0;
+ }
+}
+/** @public */
+export class PageMetrics extends models.Model {
+ constructor() {
+ super();
+ this.instructions = [];
+ this.custom = {};
+ }
+ addInstruction(instruction) {
+ this.instructions.push(instruction);
+ }
+ addManyInstructions(instructions) {
+ for (const instruction of instructions) {
+ this.addInstruction(instruction);
+ }
+ }
+ addData(data, invocationPoints) {
+ const event = {
+ data,
+ invocationPoints,
+ };
+ this.instructions.push(event);
+ }
+ addManyData(dataArray, invocationPoints) {
+ for (const data of dataArray) {
+ this.addData(data, invocationPoints);
+ }
+ }
+}
+// TODO: This needs to be migrated to the JetEngine version of ImpressionMetrics
+// The primary challenge is ID is required in the JetEngine representation, which will require
+// some refactoring both in JS and native to get right
+/** @public */
+export class ImpressionMetrics {
+ constructor(fields, id, custom) {
+ this.fields = fields;
+ this.id = id;
+ this.custom = custom;
+ }
+}
+/** @public */
+export class FastImpressionMetrics extends ImpressionMetrics {
+ constructor(metrics, isFast) {
+ super(metrics.fields, metrics.id, metrics.custom || {});
+ if (this.custom !== undefined) {
+ this.custom["isFast"] = isFast;
+ }
+ this.isFast = isFast;
+ }
+}
+//# sourceMappingURL=metrics.js.map \ No newline at end of file