@scoutflo/memory 0.0.0-stage → 0.1.0-rc.2
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/core/package.json +6 -0
- package/dist/core/src/adapter.d.ts +30 -0
- package/dist/core/src/adapter.js +3 -0
- package/dist/core/src/adapter.js.map +1 -0
- package/dist/core/src/conformance/index.d.ts +43 -0
- package/dist/core/src/conformance/index.js +102 -0
- package/dist/core/src/conformance/index.js.map +1 -0
- package/dist/core/src/errors.d.ts +6 -0
- package/dist/core/src/errors.js +16 -0
- package/dist/core/src/errors.js.map +1 -0
- package/dist/core/src/helpers.d.ts +4 -0
- package/dist/core/src/helpers.js +38 -0
- package/dist/core/src/helpers.js.map +1 -0
- package/dist/core/src/index.d.ts +6 -0
- package/dist/core/src/index.js +26 -0
- package/dist/core/src/index.js.map +1 -0
- package/dist/core/src/registry.d.ts +12 -0
- package/dist/core/src/registry.js +36 -0
- package/dist/core/src/registry.js.map +1 -0
- package/dist/src/api.d.ts +2752 -0
- package/dist/src/api.js +108 -0
- package/dist/src/api.js.map +1 -0
- package/dist/src/browse.d.ts +159 -0
- package/dist/src/browse.js +40 -0
- package/dist/src/browse.js.map +1 -0
- package/dist/src/catalog.d.ts +727 -0
- package/dist/src/catalog.js +146 -0
- package/dist/src/catalog.js.map +1 -0
- package/dist/src/errors.d.ts +22 -0
- package/dist/src/errors.js +46 -0
- package/dist/src/errors.js.map +1 -0
- package/dist/src/identity.d.ts +63 -0
- package/dist/src/identity.js +73 -0
- package/dist/src/identity.js.map +1 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.js +29 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/limits.d.ts +10 -0
- package/dist/src/limits.js +13 -0
- package/dist/src/limits.js.map +1 -0
- package/dist/src/providers.d.ts +81 -0
- package/dist/src/providers.js +51 -0
- package/dist/src/providers.js.map +1 -0
- package/dist/src/read.d.ts +345 -0
- package/dist/src/read.js +37 -0
- package/dist/src/read.js.map +1 -0
- package/dist/src/sha256.d.ts +2 -0
- package/dist/src/sha256.js +60 -0
- package/dist/src/sha256.js.map +1 -0
- package/dist/test/boundary.test.d.ts +1 -0
- package/dist/test/boundary.test.js +45 -0
- package/dist/test/boundary.test.js.map +1 -0
- package/dist/test/browse-read.test.d.ts +1 -0
- package/dist/test/browse-read.test.js +52 -0
- package/dist/test/browse-read.test.js.map +1 -0
- package/dist/test/catalog-api.test.d.ts +1 -0
- package/dist/test/catalog-api.test.js +164 -0
- package/dist/test/catalog-api.test.js.map +1 -0
- package/dist/test/core-conformance.test.d.ts +1 -0
- package/dist/test/core-conformance.test.js +148 -0
- package/dist/test/core-conformance.test.js.map +1 -0
- package/dist/test/core-helpers.test.d.ts +1 -0
- package/dist/test/core-helpers.test.js +66 -0
- package/dist/test/core-helpers.test.js.map +1 -0
- package/dist/test/core-registry.test.d.ts +1 -0
- package/dist/test/core-registry.test.js +51 -0
- package/dist/test/core-registry.test.js.map +1 -0
- package/dist/test/descriptors.test.d.ts +1 -0
- package/dist/test/descriptors.test.js +57 -0
- package/dist/test/descriptors.test.js.map +1 -0
- package/dist/test/identity.test.d.ts +1 -0
- package/dist/test/identity.test.js +79 -0
- package/dist/test/identity.test.js.map +1 -0
- package/package.json +45 -4
- package/README.md +0 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { BrowsePage, BrowseRequest, ProviderDescriptor, ProviderId, SourceLocator } from '../../src';
|
|
2
|
+
/** Adapters act as `userId`. `ctx.connectionId` must equal `req.connectionId` in browse; adapters reject mismatches with `access_denied`. */
|
|
3
|
+
export interface AdapterContext {
|
|
4
|
+
accountId: string;
|
|
5
|
+
workspaceId: string;
|
|
6
|
+
userId: string;
|
|
7
|
+
connectionId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SourceIdentity {
|
|
10
|
+
provider: ProviderId;
|
|
11
|
+
objectKind: string;
|
|
12
|
+
sourceNamespace: string;
|
|
13
|
+
siteUrl: string;
|
|
14
|
+
}
|
|
15
|
+
export interface RawSource {
|
|
16
|
+
provider: ProviderId;
|
|
17
|
+
itemId: string;
|
|
18
|
+
locator: SourceLocator;
|
|
19
|
+
title: string;
|
|
20
|
+
url: string;
|
|
21
|
+
revision: string;
|
|
22
|
+
content: string;
|
|
23
|
+
contentFormat: 'confluence_storage' | 'markdown';
|
|
24
|
+
}
|
|
25
|
+
export interface SourceAdapter {
|
|
26
|
+
readonly descriptor: ProviderDescriptor;
|
|
27
|
+
authorize(ctx: AdapterContext): Promise<SourceIdentity>;
|
|
28
|
+
browse(ctx: AdapterContext, req: BrowseRequest): Promise<BrowsePage>;
|
|
29
|
+
read(ctx: AdapterContext, itemId: string): Promise<RawSource>;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../core/src/adapter.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { BrowseCoverage, BrowseRequest } from '../../../src';
|
|
2
|
+
import type { AdapterContext, RawSource, SourceAdapter } from '../adapter';
|
|
3
|
+
export interface ConformanceFixtures {
|
|
4
|
+
ctx: AdapterContext;
|
|
5
|
+
/** Valid actor, but a different connection/account the adapter must refuse. */
|
|
6
|
+
foreignCtx: AdapterContext;
|
|
7
|
+
browse: {
|
|
8
|
+
request: BrowseRequest;
|
|
9
|
+
expectedCoverage: BrowseCoverage[]; /** Fixture is known to span more than one page. */
|
|
10
|
+
expectMorePages?: boolean;
|
|
11
|
+
};
|
|
12
|
+
readable: {
|
|
13
|
+
itemId: string;
|
|
14
|
+
expectedContentFormat: RawSource['contentFormat'];
|
|
15
|
+
};
|
|
16
|
+
denied?: {
|
|
17
|
+
itemId: string;
|
|
18
|
+
};
|
|
19
|
+
missing?: {
|
|
20
|
+
itemId: string;
|
|
21
|
+
};
|
|
22
|
+
tooLarge?: {
|
|
23
|
+
itemId: string;
|
|
24
|
+
};
|
|
25
|
+
unsupported?: {
|
|
26
|
+
itemId: string;
|
|
27
|
+
};
|
|
28
|
+
/** Actor lacking provider authorization. */
|
|
29
|
+
unauthenticated?: {
|
|
30
|
+
ctx: AdapterContext;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export interface ConformanceHarness {
|
|
34
|
+
describe(name: string, fn: () => void): void;
|
|
35
|
+
it(name: string, fn: () => void | Promise<void>): void;
|
|
36
|
+
/** Real skipped test (Jest/node:test); used for omitted fixtures when present. */
|
|
37
|
+
skip?(name: string, fn?: () => void | Promise<void>): void;
|
|
38
|
+
}
|
|
39
|
+
export interface ConformanceOptions {
|
|
40
|
+
/** Omitting any optional fixture registers a failing case instead of skipping. */
|
|
41
|
+
requireAll?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare function runAdapterConformance(factory: () => SourceAdapter, f: ConformanceFixtures, h: ConformanceHarness, opts?: ConformanceOptions): void;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.runAdapterConformance = runAdapterConformance;
|
|
7
|
+
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
8
|
+
const src_1 = require("../../../src");
|
|
9
|
+
const helpers_1 = require("../helpers");
|
|
10
|
+
async function rejectsWith(p, code, what) {
|
|
11
|
+
let err;
|
|
12
|
+
try {
|
|
13
|
+
await p;
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
err = e;
|
|
17
|
+
}
|
|
18
|
+
strict_1.default.ok(err !== undefined, `${what}: expected rejection with ${code}, but it resolved`);
|
|
19
|
+
strict_1.default.ok(err instanceof src_1.MemoryContractError, `${what}: expected MemoryContractError, got ${String(err)}`);
|
|
20
|
+
strict_1.default.equal(err.code, code, `${what}: wrong error code`);
|
|
21
|
+
}
|
|
22
|
+
function runAdapterConformance(factory, f, h, opts = {}) {
|
|
23
|
+
const missing = (name, label) => {
|
|
24
|
+
if (opts.requireAll)
|
|
25
|
+
h.it(`${name} [missing fixture: ${label}]`, () => strict_1.default.fail(`missing ${label} fixture (requireAll)`));
|
|
26
|
+
else if (h.skip)
|
|
27
|
+
h.skip(`${name} [skipped: no ${label} fixture]`);
|
|
28
|
+
else
|
|
29
|
+
h.it(`${name} [skipped: no ${label} fixture]`, () => { });
|
|
30
|
+
};
|
|
31
|
+
const itemCase = (name, fixture, label, fn) => fixture ? h.it(name, () => fn(factory(), fixture.itemId)) : missing(name, label);
|
|
32
|
+
h.describe('adapter conformance', () => {
|
|
33
|
+
h.it('authorize returns identity for its provider', async () => {
|
|
34
|
+
const a = factory();
|
|
35
|
+
const id = await a.authorize(f.ctx);
|
|
36
|
+
strict_1.default.equal(id.provider, a.descriptor.id);
|
|
37
|
+
strict_1.default.ok(id.sourceNamespace.length > 0, 'sourceNamespace must be non-empty');
|
|
38
|
+
});
|
|
39
|
+
h.it('identity round-trip', async () => {
|
|
40
|
+
const a = factory();
|
|
41
|
+
const raw = await a.read(f.ctx, f.readable.itemId);
|
|
42
|
+
strict_1.default.equal(raw.itemId, f.readable.itemId);
|
|
43
|
+
strict_1.default.equal((0, src_1.encodeItemId)(raw.locator), f.readable.itemId);
|
|
44
|
+
strict_1.default.equal(raw.provider, a.descriptor.id);
|
|
45
|
+
strict_1.default.equal(raw.contentFormat, f.readable.expectedContentFormat);
|
|
46
|
+
strict_1.default.ok((0, src_1.sourceKey)(raw.locator).length > 0);
|
|
47
|
+
});
|
|
48
|
+
h.it('actor binding rejects foreign context and mismatched connection', async () => {
|
|
49
|
+
const a = factory();
|
|
50
|
+
await rejectsWith(a.authorize(f.foreignCtx), 'access_denied', 'authorize(foreignCtx)');
|
|
51
|
+
await rejectsWith(a.browse(f.foreignCtx, { ...f.browse.request, connectionId: f.foreignCtx.connectionId }), 'access_denied', 'browse(foreignCtx)');
|
|
52
|
+
await rejectsWith(a.read(f.foreignCtx, f.readable.itemId), 'access_denied', 'read(foreignCtx)');
|
|
53
|
+
});
|
|
54
|
+
h.it('actor binding: browse rejects req.connectionId differing from ctx', async () => {
|
|
55
|
+
const a = factory();
|
|
56
|
+
await rejectsWith(a.browse(f.ctx, { ...f.browse.request, connectionId: `${f.ctx.connectionId}-other` }), 'access_denied', 'browse(req.connectionId mismatch)');
|
|
57
|
+
});
|
|
58
|
+
itemCase('permission mapping: denied -> access_denied', f.denied, 'denied', (a, id) => rejectsWith(a.read(f.ctx, id), 'access_denied', 'read(denied)'));
|
|
59
|
+
itemCase('permission mapping: missing -> not_found', f.missing, 'missing', (a, id) => rejectsWith(a.read(f.ctx, id), 'not_found', 'read(missing)'));
|
|
60
|
+
if (f.unauthenticated) {
|
|
61
|
+
const ctx = f.unauthenticated.ctx;
|
|
62
|
+
h.it('permission mapping: unauthenticated -> authorization_required', () => rejectsWith(factory().read(ctx, f.readable.itemId), 'authorization_required', 'read(unauthenticated)'));
|
|
63
|
+
}
|
|
64
|
+
else
|
|
65
|
+
missing('permission mapping: unauthenticated -> authorization_required', 'unauthenticated');
|
|
66
|
+
h.it('pagination is bounded, truthful and non-overlapping', async () => {
|
|
67
|
+
const a = factory();
|
|
68
|
+
const page1 = await a.browse(f.ctx, f.browse.request);
|
|
69
|
+
strict_1.default.ok(page1.items.length <= f.browse.request.limit, 'first page exceeds limit');
|
|
70
|
+
strict_1.default.ok(f.browse.expectedCoverage.includes(page1.coverage), `unexpected coverage ${page1.coverage}`);
|
|
71
|
+
if (f.browse.expectMorePages)
|
|
72
|
+
strict_1.default.ok(page1.nextCursor !== null, 'fixture declares more pages but nextCursor is null');
|
|
73
|
+
if (page1.nextCursor !== null) {
|
|
74
|
+
const page2 = await a.browse(f.ctx, { ...f.browse.request, cursor: page1.nextCursor });
|
|
75
|
+
strict_1.default.ok(page2.items.length <= f.browse.request.limit, 'second page exceeds limit');
|
|
76
|
+
const seen = new Set(page1.items.map((i) => i.id));
|
|
77
|
+
for (const i of page2.items)
|
|
78
|
+
strict_1.default.ok(!seen.has(i.id), `item ${i.id} repeated on page 2`);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
h.it('revision and content hash are stable across reads', async () => {
|
|
82
|
+
const a = factory();
|
|
83
|
+
const r1 = await a.read(f.ctx, f.readable.itemId);
|
|
84
|
+
const r2 = await a.read(f.ctx, f.readable.itemId);
|
|
85
|
+
strict_1.default.ok(typeof r1.revision === 'string' && r1.revision.length > 0, 'revision must be a non-empty string');
|
|
86
|
+
strict_1.default.equal(r1.revision, r2.revision);
|
|
87
|
+
strict_1.default.equal((0, helpers_1.readWindow)(r1).citation.contentHash, (0, helpers_1.readWindow)(r2).citation.contentHash);
|
|
88
|
+
strict_1.default.equal((0, helpers_1.readWindow)(r1).citation.contentHash, (0, helpers_1.hashContent)(r1.content));
|
|
89
|
+
});
|
|
90
|
+
itemCase('too large -> too_large', f.tooLarge, 'tooLarge', async (a, id) => {
|
|
91
|
+
// Adapters may reject at read(), or return content that readWindow rejects.
|
|
92
|
+
await rejectsWith(a.read(f.ctx, id).then((raw) => (0, helpers_1.readWindow)(raw)), 'too_large', 'read(tooLarge)');
|
|
93
|
+
});
|
|
94
|
+
itemCase('unsupported -> unsupported_type', f.unsupported, 'unsupported', (a, id) => rejectsWith(a.read(f.ctx, id), 'unsupported_type', 'read(unsupported)'));
|
|
95
|
+
h.it('readWindow output parses with the SourceRead schema', async () => {
|
|
96
|
+
const raw = await factory().read(f.ctx, f.readable.itemId);
|
|
97
|
+
const parsed = src_1.SourceRead.safeParse((0, helpers_1.readWindow)(raw));
|
|
98
|
+
strict_1.default.ok(parsed.success, 'readWindow output is not a valid SourceRead');
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../core/src/conformance/index.ts"],"names":[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mB,CAAC,CAAC,CAAC;QAE9J,CAAC,CAAC,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;YACrE,MAAM,GAAG,GAAG,MAAM,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC3D,MAAM,MAAM,GAAG,gBAAU,CAAC,SAAS,CAAC,IAAA,oBAAU,EAAC,GAAG,CAAC,CAAC,CAAC;YACrD,gBAAM,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,6CAA6C,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MemoryContractError, MemoryErrorBody, MemoryErrorCode } from '../../src';
|
|
2
|
+
export declare class MemoryProviderError extends MemoryContractError {
|
|
3
|
+
readonly retryAfter?: number | undefined;
|
|
4
|
+
constructor(code: MemoryErrorCode, message: string, retryAfter?: number | undefined);
|
|
5
|
+
toBody(): MemoryErrorBody;
|
|
6
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemoryProviderError = void 0;
|
|
4
|
+
const src_1 = require("../../src");
|
|
5
|
+
class MemoryProviderError extends src_1.MemoryContractError {
|
|
6
|
+
constructor(code, message, retryAfter) {
|
|
7
|
+
super(code, message);
|
|
8
|
+
this.retryAfter = retryAfter;
|
|
9
|
+
this.name = 'MemoryProviderError';
|
|
10
|
+
}
|
|
11
|
+
toBody() {
|
|
12
|
+
return { code: this.code, message: this.message, ...(this.retryAfter ? { retryAfter: this.retryAfter } : {}) };
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.MemoryProviderError = MemoryProviderError;
|
|
16
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../core/src/errors.ts"],"names":[],"mappings":";;;AAAA,mCAAkF;AAElF,MAAa,mBAAoB,SAAQ,yBAAmB;IAC1D,YAAY,IAAqB,EAAE,OAAe,EAAW,UAAmB;QAC9E,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QADsC,eAAU,GAAV,UAAU,CAAS;QAE9E,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;IAED,MAAM;QACJ,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACjH,CAAC;CACF;AATD,kDASC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hashContent = hashContent;
|
|
4
|
+
exports.readWindow = readWindow;
|
|
5
|
+
const node_crypto_1 = require("node:crypto");
|
|
6
|
+
const src_1 = require("../../src");
|
|
7
|
+
const errors_1 = require("./errors");
|
|
8
|
+
function hashContent(text) {
|
|
9
|
+
return (0, node_crypto_1.createHash)('sha256').update(text, 'utf8').digest('hex');
|
|
10
|
+
}
|
|
11
|
+
function readWindow(raw, offset = 0, now = () => new Date()) {
|
|
12
|
+
const total = raw.content.length;
|
|
13
|
+
if (total > src_1.MAX_SOURCE_CHARACTERS)
|
|
14
|
+
throw new errors_1.MemoryProviderError('too_large', 'Source is too large to read');
|
|
15
|
+
if (!Number.isInteger(offset) || offset < 0 || offset > total)
|
|
16
|
+
throw new errors_1.MemoryProviderError('invalid_request', 'Invalid read offset');
|
|
17
|
+
// Offsets and totalCharacters are UTF-16 code units; a window may split a surrogate pair.
|
|
18
|
+
const end = Math.min(offset + src_1.READ_WINDOW, total);
|
|
19
|
+
const confluence = raw.contentFormat === 'confluence_storage';
|
|
20
|
+
const warnings = [];
|
|
21
|
+
if (/<img\b|<ac:image\b/i.test(raw.content) || (!confluence && raw.content.includes('![')))
|
|
22
|
+
warnings.push('images_not_read');
|
|
23
|
+
if (confluence && /<(?:ri:attachment|ac:structured-macro)/.test(raw.content))
|
|
24
|
+
warnings.push('attachments_or_macros_not_expanded');
|
|
25
|
+
return {
|
|
26
|
+
outcome: 'read',
|
|
27
|
+
title: raw.title,
|
|
28
|
+
content: raw.content.slice(offset, end),
|
|
29
|
+
contentFormat: raw.contentFormat,
|
|
30
|
+
citation: {
|
|
31
|
+
provider: raw.provider, locator: raw.locator, itemId: raw.itemId, title: raw.title, href: raw.url,
|
|
32
|
+
sourceRevision: raw.revision, contentHash: hashContent(raw.content), readAt: now().toISOString(),
|
|
33
|
+
},
|
|
34
|
+
coverage: { offset, end, totalCharacters: total, complete: end >= total, nextOffset: end < total ? end : null },
|
|
35
|
+
warnings,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../core/src/helpers.ts"],"names":[],"mappings":";;AAKA,kCAEC;AAED,gCAsBC;AA/BD,6CAAyC;AACzC,mCAAwF;AAExF,qCAA+C;AAE/C,SAAgB,WAAW,CAAC,IAAY;IACtC,OAAO,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC;AAED,SAAgB,UAAU,CAAC,GAAc,EAAE,MAAM,GAAG,CAAC,EAAE,MAAkB,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;IACvF,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;IACjC,IAAI,KAAK,G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CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE;SACjG;QACD,QAAQ,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,KAAK,EAAE,UAAU,EAAE,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE;QAC/G,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.MemoryErrorCode = exports.MemoryContractError = void 0;
|
|
18
|
+
var src_1 = require("../../src");
|
|
19
|
+
Object.defineProperty(exports, "MemoryContractError", { enumerable: true, get: function () { return src_1.MemoryContractError; } });
|
|
20
|
+
Object.defineProperty(exports, "MemoryErrorCode", { enumerable: true, get: function () { return src_1.MemoryErrorCode; } });
|
|
21
|
+
__exportStar(require("./errors"), exports);
|
|
22
|
+
__exportStar(require("./adapter"), exports);
|
|
23
|
+
__exportStar(require("./registry"), exports);
|
|
24
|
+
__exportStar(require("./helpers"), exports);
|
|
25
|
+
__exportStar(require("./conformance"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../core/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iCAAiE;AAAxD,0GAAA,mBAAmB,OAAA;AAAE,sGAAA,eAAe,OAAA;AAC7C,2CAAyB;AACzB,4CAA0B;AAC1B,6CAA2B;AAC3B,4CAA0B;AAC1B,gDAA8B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProviderDescriptor, ProviderId } from '../../src';
|
|
2
|
+
import type { SourceAdapter } from './adapter';
|
|
3
|
+
export interface ProviderRegistry {
|
|
4
|
+
forProvider(id: ProviderId): SourceAdapter;
|
|
5
|
+
forConnection(connectionId: string): Promise<SourceAdapter>;
|
|
6
|
+
enabledProviders(): ProviderDescriptor[];
|
|
7
|
+
}
|
|
8
|
+
export declare function createProviderRegistry(adapters: SourceAdapter[], options: {
|
|
9
|
+
enabled: ProviderId[];
|
|
10
|
+
providerOf: (connectionId: string) => Promise<ProviderId>;
|
|
11
|
+
}): ProviderRegistry;
|
|
12
|
+
export declare function parseEnabledProviders(envValue: string | undefined, fallback: ProviderId[]): ProviderId[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createProviderRegistry = createProviderRegistry;
|
|
4
|
+
exports.parseEnabledProviders = parseEnabledProviders;
|
|
5
|
+
const src_1 = require("../../src");
|
|
6
|
+
const errors_1 = require("./errors");
|
|
7
|
+
function createProviderRegistry(adapters, options) {
|
|
8
|
+
const byId = new Map();
|
|
9
|
+
for (const a of adapters) {
|
|
10
|
+
if (byId.has(a.descriptor.id))
|
|
11
|
+
throw new Error(`Duplicate adapter for provider ${a.descriptor.id}`);
|
|
12
|
+
byId.set(a.descriptor.id, a);
|
|
13
|
+
}
|
|
14
|
+
const forProvider = (id) => {
|
|
15
|
+
const adapter = options.enabled.includes(id) ? byId.get(id) : undefined;
|
|
16
|
+
if (!adapter)
|
|
17
|
+
throw new errors_1.MemoryProviderError('provider_unavailable', `Provider ${id} is unavailable`);
|
|
18
|
+
return adapter;
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
forProvider,
|
|
22
|
+
forConnection: async (connectionId) => forProvider(await options.providerOf(connectionId)),
|
|
23
|
+
enabledProviders: () => options.enabled.filter((id) => byId.has(id)).map((id) => byId.get(id).descriptor),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function parseEnabledProviders(envValue, fallback) {
|
|
27
|
+
const ids = (envValue ?? '').split(',').map((s) => s.trim()).filter(Boolean);
|
|
28
|
+
if (!ids.length)
|
|
29
|
+
return fallback;
|
|
30
|
+
for (const id of ids) {
|
|
31
|
+
if (!Object.prototype.hasOwnProperty.call(src_1.PROVIDERS, id))
|
|
32
|
+
throw new src_1.MemoryContractError('invalid_request', `Unknown provider: ${id}`);
|
|
33
|
+
}
|
|
34
|
+
return ids;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../core/src/registry.ts"],"names":[],"mappings":";;AAUA,wDAmBC;AAED,sDAOC;AAtCD,mCAA2F;AAE3F,qCAA+C;AAQ/C,SAAgB,sBAAsB,CACpC,QAAyB,EACzB,OAA6F;IAE7F,MAAM,IAAI,GAAG,IAAI,GAAG,EAA6B,CAAC;IAClD,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC,UAAU,CAA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