@powerhousedao/reactor-api 1.11.3 → 1.12.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/CHANGELOG.md CHANGED
@@ -1,8 +1,8 @@
1
- ## 1.11.3 (2024-12-16)
1
+ ## 1.12.1 (2024-12-18)
2
2
 
3
3
  ### 🩹 Fixes
4
4
 
5
- - **reactor-api:** added onSetup calls to default subgrahs ([f0693ea5](https://github.com/powerhouse-inc/powerhouse/commit/f0693ea5))
5
+ - **reactor-api:** update graphql dependency ([ed063402](https://github.com/powerhouse-inc/powerhouse/commit/ed063402))
6
6
 
7
7
  ### ❤️ Thank You
8
8
 
package/dist/index.js CHANGED
@@ -14671,7 +14671,7 @@ __export(analytics_exports, {
14671
14671
  AnalyticsSubgraph: () => AnalyticsSubgraph
14672
14672
  });
14673
14673
 
14674
- // ../../node_modules/.pnpm/@powerhousedao+analytics-engine-graphql@0.2.0/node_modules/@powerhousedao/analytics-engine-graphql/dist/AnalyticsResolvers.js
14674
+ // ../../node_modules/.pnpm/@powerhousedao+analytics-engine-graphql@0.2.1/node_modules/@powerhousedao/analytics-engine-graphql/dist/AnalyticsResolvers.js
14675
14675
  var AnalyticsResolvers = {
14676
14676
  Query: {
14677
14677
  analytics: (_, __, { dataSources }) => {
@@ -21162,19 +21162,22 @@ function friendlyDateTime(dateTimeish) {
21162
21162
  }
21163
21163
  }
21164
21164
 
21165
- // ../../node_modules/.pnpm/@powerhousedao+analytics-engine-graphql@0.2.0/node_modules/@powerhousedao/analytics-engine-graphql/dist/AnalyticsModel.js
21165
+ // ../../node_modules/.pnpm/@powerhousedao+analytics-engine-graphql@0.2.1/node_modules/@powerhousedao/analytics-engine-graphql/dist/AnalyticsModel.js
21166
21166
  var AnalyticsModel = class {
21167
21167
  engine;
21168
- constructor(engine) {
21168
+ queryLogger;
21169
+ constructor(engine, queryLogger) {
21169
21170
  this.engine = engine;
21171
+ this.queryLogger = queryLogger || (() => {
21172
+ });
21170
21173
  }
21171
21174
  async query(filter) {
21172
21175
  if (!filter) {
21173
21176
  return [];
21174
21177
  }
21175
21178
  const query = {
21176
- start: filter.start ? DateTime.fromJSDate(filter.start) : null,
21177
- end: filter.end ? DateTime.fromJSDate(filter.end) : null,
21179
+ start: filter.start ? DateTime.fromISO(filter.start) : null,
21180
+ end: filter.end ? DateTime.fromISO(filter.end) : null,
21178
21181
  granularity: getGranularity(filter.granularity),
21179
21182
  metrics: filter.metrics,
21180
21183
  currency: getCurrency(filter.currency),
@@ -21197,6 +21200,7 @@ var AnalyticsModel = class {
21197
21200
  query.lod[dimension.name] = Number(dimension.lod);
21198
21201
  });
21199
21202
  }
21203
+ this.queryLogger(query);
21200
21204
  const results = await this.engine.execute(query);
21201
21205
  return results;
21202
21206
  }
@@ -21205,8 +21209,8 @@ var AnalyticsModel = class {
21205
21209
  return [];
21206
21210
  }
21207
21211
  const query = {
21208
- start: filter.start ? DateTime.fromJSDate(filter.start) : null,
21209
- end: filter.end ? DateTime.fromJSDate(filter.end) : null,
21212
+ start: filter.start ? DateTime.fromISO(filter.start) : null,
21213
+ end: filter.end ? DateTime.fromISO(filter.end) : null,
21210
21214
  granularity: getGranularity(filter.granularity),
21211
21215
  metrics: filter.metrics,
21212
21216
  currency: getCurrency(filter.currency),
@@ -21229,6 +21233,7 @@ var AnalyticsModel = class {
21229
21233
  query.lod[dimension.name] = Number(dimension.lod);
21230
21234
  });
21231
21235
  }
21236
+ this.queryLogger(query);
21232
21237
  return this.engine.executeMultiCurrency(query, {
21233
21238
  targetCurrency: query.currency,
21234
21239
  conversions: filter.conversions.map((c) => {
@@ -21281,7 +21286,7 @@ var getCurrency = (currency) => {
21281
21286
  return currency ? AnalyticsPath.fromString(currency) : AnalyticsPath.fromString("");
21282
21287
  };
21283
21288
 
21284
- // ../../node_modules/.pnpm/@powerhousedao+analytics-engine-graphql@0.2.0/node_modules/@powerhousedao/analytics-engine-graphql/dist/schema.js
21289
+ // ../../node_modules/.pnpm/@powerhousedao+analytics-engine-graphql@0.2.1/node_modules/@powerhousedao/analytics-engine-graphql/dist/schema.js
21285
21290
  var typedefs = `
21286
21291
  type AnalyticsQuery {
21287
21292
  series(filter: AnalyticsFilter): [AnalyticsPeriod]