@powerhousedao/reactor-api 1.10.2 → 1.10.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/CHANGELOG.md +3 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +59 -43
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/processors/analytics-processor.ts +2 -0
- package/src/processors/index.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
## 1.10.
|
|
1
|
+
## 1.10.4 (2024-12-12)
|
|
2
2
|
|
|
3
3
|
### 🧱 Updated Dependencies
|
|
4
4
|
|
|
5
|
-
- Updated document-model-libs to 1.
|
|
6
|
-
- Updated document-drive to 1.
|
|
7
|
-
- Updated document-model to 2.12.0
|
|
5
|
+
- Updated document-model-libs to 1.122.1
|
|
6
|
+
- Updated document-drive to 1.11.1
|
|
8
7
|
|
|
9
8
|
## 1.2.0 (2024-10-29)
|
|
10
9
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import express, { Express } from 'express';
|
|
|
6
6
|
import { Pool } from 'pg';
|
|
7
7
|
import { IncomingHttpHeaders } from 'http';
|
|
8
8
|
import { IAnalyticsStore } from '@powerhousedao/analytics-engine-core';
|
|
9
|
+
export * from '@powerhousedao/analytics-engine-core';
|
|
9
10
|
import * as graphql from 'graphql';
|
|
10
11
|
import { GraphQLResolverMap } from '@apollo/subgraph/dist/schema-helper';
|
|
11
12
|
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as analytics_engine_core_star from '@powerhousedao/analytics-engine-core';
|
|
1
2
|
import { AnalyticsQueryEngine, AnalyticsPath, AnalyticsGranularity } from '@powerhousedao/analytics-engine-core';
|
|
2
3
|
import { KnexAnalyticsStore, KnexQueryExecutor } from '@powerhousedao/analytics-engine-knex';
|
|
3
4
|
import express2, { Router } from 'express';
|
|
@@ -7,13 +8,12 @@ import { ApolloServerPluginInlineTraceDisabled } from '@apollo/server/plugin/dis
|
|
|
7
8
|
import bodyParser from 'body-parser';
|
|
8
9
|
import cors from 'cors';
|
|
9
10
|
import { actions } from 'document-model-libs/document-drive';
|
|
10
|
-
import crypto
|
|
11
|
-
import fs from 'fs';
|
|
12
|
-
import https from 'https';
|
|
13
|
-
import { join } from 'path';
|
|
11
|
+
import crypto from 'node:crypto';
|
|
12
|
+
import fs from 'node:fs';
|
|
13
|
+
import https from 'node:https';
|
|
14
|
+
import { join } from 'node:path';
|
|
14
15
|
import 'graphql-request';
|
|
15
16
|
import 'nanoevents';
|
|
16
|
-
import { v4 as v4$1 } from 'uuid';
|
|
17
17
|
import { parse as parse$1 } from 'graphql';
|
|
18
18
|
import { buildSubgraphSchema } from '@apollo/subgraph';
|
|
19
19
|
import pkg from 'knex';
|
|
@@ -46,6 +46,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
46
46
|
}
|
|
47
47
|
return to;
|
|
48
48
|
};
|
|
49
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget);
|
|
49
50
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
51
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
52
|
// file that has been converted to a CommonJS file using a Babel-
|
|
@@ -9821,6 +9822,19 @@ var require_lib4 = __commonJS({
|
|
|
9821
9822
|
}
|
|
9822
9823
|
});
|
|
9823
9824
|
|
|
9825
|
+
// src/index.ts
|
|
9826
|
+
var src_exports = {};
|
|
9827
|
+
__export(src_exports, {
|
|
9828
|
+
AnalyticsProcessor: () => AnalyticsProcessor,
|
|
9829
|
+
BaseProcessor: () => BaseProcessor,
|
|
9830
|
+
Processor: () => Processor,
|
|
9831
|
+
ReactorRouterManager: () => ReactorRouterManager,
|
|
9832
|
+
createSchema: () => createSchema2,
|
|
9833
|
+
getDocumentModelTypeDefs: () => getDocumentModelTypeDefs,
|
|
9834
|
+
isProcessorClass: () => isProcessorClass,
|
|
9835
|
+
startAPI: () => startAPI
|
|
9836
|
+
});
|
|
9837
|
+
|
|
9824
9838
|
// ../../node_modules/.pnpm/@powerhousedao+analytics-engine-graphql@0.2.0/node_modules/@powerhousedao/analytics-engine-graphql/dist/AnalyticsResolvers.js
|
|
9825
9839
|
var AnalyticsResolvers = {
|
|
9826
9840
|
Query: {
|
|
@@ -16721,7 +16735,7 @@ type Sync {
|
|
|
16721
16735
|
}
|
|
16722
16736
|
`;
|
|
16723
16737
|
|
|
16724
|
-
// ../document-model/dist/node/es/internal/creators-
|
|
16738
|
+
// ../document-model/dist/node/es/internal/creators-B6tCK8Ir.js
|
|
16725
16739
|
var import_jszip = __toESM(require_lib3());
|
|
16726
16740
|
|
|
16727
16741
|
// ../../node_modules/.pnpm/zod@3.23.8/node_modules/zod/lib/index.mjs
|
|
@@ -22592,37 +22606,8 @@ ${originalIndentation}`;
|
|
|
22592
22606
|
var safeStableStringifyExports = requireSafeStableStringify();
|
|
22593
22607
|
var cjsModule = /* @__PURE__ */ getDefaultExportFromCjs(safeStableStringifyExports);
|
|
22594
22608
|
cjsModule.configure;
|
|
22595
|
-
|
|
22596
|
-
|
|
22597
|
-
function rng() {
|
|
22598
|
-
if (!getRandomValues) {
|
|
22599
|
-
getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
|
22600
|
-
if (!getRandomValues) {
|
|
22601
|
-
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
22602
|
-
}
|
|
22603
|
-
}
|
|
22604
|
-
return getRandomValues(rnds8);
|
|
22605
|
-
}
|
|
22606
|
-
var byteToHex = [];
|
|
22607
|
-
for (let i = 0; i < 256; ++i) {
|
|
22608
|
-
byteToHex.push((i + 256).toString(16).slice(1));
|
|
22609
|
-
}
|
|
22610
|
-
function unsafeStringify(arr, offset2 = 0) {
|
|
22611
|
-
return byteToHex[arr[offset2 + 0]] + byteToHex[arr[offset2 + 1]] + byteToHex[arr[offset2 + 2]] + byteToHex[arr[offset2 + 3]] + "-" + byteToHex[arr[offset2 + 4]] + byteToHex[arr[offset2 + 5]] + "-" + byteToHex[arr[offset2 + 6]] + byteToHex[arr[offset2 + 7]] + "-" + byteToHex[arr[offset2 + 8]] + byteToHex[arr[offset2 + 9]] + "-" + byteToHex[arr[offset2 + 10]] + byteToHex[arr[offset2 + 11]] + byteToHex[arr[offset2 + 12]] + byteToHex[arr[offset2 + 13]] + byteToHex[arr[offset2 + 14]] + byteToHex[arr[offset2 + 15]];
|
|
22612
|
-
}
|
|
22613
|
-
var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
22614
|
-
var native = {
|
|
22615
|
-
randomUUID
|
|
22616
|
-
};
|
|
22617
|
-
function v4(options, buf, offset2) {
|
|
22618
|
-
if (native.randomUUID && !buf && !options) {
|
|
22619
|
-
return native.randomUUID();
|
|
22620
|
-
}
|
|
22621
|
-
options = options || {};
|
|
22622
|
-
const rnds = options.random || (options.rng || rng)();
|
|
22623
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
22624
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
22625
|
-
return unsafeStringify(rnds);
|
|
22609
|
+
function generateUUID(options) {
|
|
22610
|
+
return crypto.randomUUID(options);
|
|
22626
22611
|
}
|
|
22627
22612
|
function writeFile(path, name, data) {
|
|
22628
22613
|
const filePath = join(path, name);
|
|
@@ -22664,8 +22649,16 @@ var getFile = async (file) => {
|
|
|
22664
22649
|
return readFile(file);
|
|
22665
22650
|
};
|
|
22666
22651
|
var hash = (data, algorithm = "sha1") => {
|
|
22667
|
-
return crypto
|
|
22652
|
+
return crypto.createHash(algorithm).update(data).digest("base64");
|
|
22668
22653
|
};
|
|
22654
|
+
function generateId(method) {
|
|
22655
|
+
if (method && method.toString() !== "UUIDv4") {
|
|
22656
|
+
throw new Error(
|
|
22657
|
+
`Id generation method not supported: "${method.toString()}"`
|
|
22658
|
+
);
|
|
22659
|
+
}
|
|
22660
|
+
return generateUUID();
|
|
22661
|
+
}
|
|
22669
22662
|
function getUnixTimestamp(date) {
|
|
22670
22663
|
return (new Date(date).getTime() / 1e3).toFixed(0);
|
|
22671
22664
|
}
|
|
@@ -23537,7 +23530,7 @@ function updateOperations(document, action, skip = 0, reuseLastOperationIndex =
|
|
|
23537
23530
|
operationId = action.id;
|
|
23538
23531
|
timestamp = action.timestamp;
|
|
23539
23532
|
} else {
|
|
23540
|
-
operationId = "id" in action ? action.id :
|
|
23533
|
+
operationId = "id" in action ? action.id : generateId();
|
|
23541
23534
|
}
|
|
23542
23535
|
operations.push({
|
|
23543
23536
|
...action,
|
|
@@ -24108,7 +24101,7 @@ var loadState = (state, operations) => createAction(
|
|
|
24108
24101
|
);
|
|
24109
24102
|
var noop = (scope = "global") => createAction("NOOP", {}, void 0, void 0, scope);
|
|
24110
24103
|
|
|
24111
|
-
// ../document-model/dist/node/es/internal/index-
|
|
24104
|
+
// ../document-model/dist/node/es/internal/index-CJxdcyKO.js
|
|
24112
24105
|
var index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
24113
24106
|
__proto__: null,
|
|
24114
24107
|
InvalidActionInputError,
|
|
@@ -24125,6 +24118,7 @@ var index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
|
|
|
24125
24118
|
createUnsafeReducer,
|
|
24126
24119
|
createZip,
|
|
24127
24120
|
documentHelpers,
|
|
24121
|
+
generateId,
|
|
24128
24122
|
getDocumentLastModified,
|
|
24129
24123
|
getLocalFile,
|
|
24130
24124
|
getRemoteFile,
|
|
@@ -24283,8 +24277,8 @@ var RunAsap;
|
|
|
24283
24277
|
// ../document-drive/src/utils/index.ts
|
|
24284
24278
|
RunAsap.runAsap;
|
|
24285
24279
|
RunAsap.runAsapAsync;
|
|
24286
|
-
function
|
|
24287
|
-
return
|
|
24280
|
+
function generateUUID2() {
|
|
24281
|
+
return generateId();
|
|
24288
24282
|
}
|
|
24289
24283
|
|
|
24290
24284
|
// ../document-drive/src/utils/document-helpers.ts
|
|
@@ -24342,7 +24336,7 @@ var resolvers2 = {
|
|
|
24342
24336
|
Mutation: {
|
|
24343
24337
|
registerPullResponderListener: async (_, { filter }, ctx) => {
|
|
24344
24338
|
if (!ctx.driveId) throw new Error("Drive ID is required");
|
|
24345
|
-
const uuid =
|
|
24339
|
+
const uuid = generateUUID2();
|
|
24346
24340
|
const listener = {
|
|
24347
24341
|
block: false,
|
|
24348
24342
|
callInfo: {
|
|
@@ -29200,6 +29194,21 @@ function getKnexClient(connectionString) {
|
|
|
29200
29194
|
});
|
|
29201
29195
|
}
|
|
29202
29196
|
|
|
29197
|
+
// src/processors/index.ts
|
|
29198
|
+
var processors_exports = {};
|
|
29199
|
+
__export(processors_exports, {
|
|
29200
|
+
AnalyticsProcessor: () => AnalyticsProcessor,
|
|
29201
|
+
BaseProcessor: () => BaseProcessor,
|
|
29202
|
+
Processor: () => Processor,
|
|
29203
|
+
isProcessorClass: () => isProcessorClass
|
|
29204
|
+
});
|
|
29205
|
+
|
|
29206
|
+
// src/processors/analytics-processor.ts
|
|
29207
|
+
var analytics_processor_exports = {};
|
|
29208
|
+
__export(analytics_processor_exports, {
|
|
29209
|
+
AnalyticsProcessor: () => AnalyticsProcessor
|
|
29210
|
+
});
|
|
29211
|
+
|
|
29203
29212
|
// src/processors/processor.ts
|
|
29204
29213
|
var Processor = class {
|
|
29205
29214
|
reactor;
|
|
@@ -29246,6 +29255,7 @@ function isProcessorClass(candidate) {
|
|
|
29246
29255
|
}
|
|
29247
29256
|
|
|
29248
29257
|
// src/processors/analytics-processor.ts
|
|
29258
|
+
__reExport(analytics_processor_exports, analytics_engine_core_star);
|
|
29249
29259
|
var AnalyticsProcessor = class extends Processor {
|
|
29250
29260
|
analyticsStore;
|
|
29251
29261
|
constructor(args, options) {
|
|
@@ -29258,6 +29268,9 @@ var AnalyticsProcessor = class extends Processor {
|
|
|
29258
29268
|
}
|
|
29259
29269
|
};
|
|
29260
29270
|
|
|
29271
|
+
// src/processors/index.ts
|
|
29272
|
+
__reExport(processors_exports, analytics_processor_exports);
|
|
29273
|
+
|
|
29261
29274
|
// src/processor-manager.ts
|
|
29262
29275
|
var ProcessorManager = class {
|
|
29263
29276
|
constructor(driveServer, analyticsStore) {
|
|
@@ -29337,6 +29350,9 @@ async function startAPI(reactor, options) {
|
|
|
29337
29350
|
return { app, reactorRouterManager, processorManager };
|
|
29338
29351
|
}
|
|
29339
29352
|
|
|
29353
|
+
// src/index.ts
|
|
29354
|
+
__reExport(src_exports, processors_exports);
|
|
29355
|
+
|
|
29340
29356
|
export { AnalyticsProcessor, BaseProcessor, Processor, ReactorRouterManager, createSchema2 as createSchema, getDocumentModelTypeDefs, isProcessorClass, startAPI };
|
|
29341
29357
|
//# sourceMappingURL=index.js.map
|
|
29342
29358
|
//# sourceMappingURL=index.js.map
|