@coopenomics/extension-sdk 2026.11.25 → 2026.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/dist/index.js CHANGED
@@ -12,15 +12,18 @@
12
12
  * - cross-extension references на core entity (Cooperator, Cooperative,
13
13
  * Account) — через `SharedCooperator/SharedCooperative/SharedAccount`
14
14
  * stub'ы (`@key + @external`).
15
- * - JWT валидируется тем же секретом что и core; gateway forward'ит
16
- * Authorization-header в subgraph.
15
+ * - пайщика по токену опознаёт ядро (`ExtensionAccessGuard`, порт
16
+ * `accessToken`); секрет ядра приложению не передаётся. Gateway
17
+ * forward'ит Authorization-header в subgraph.
18
+ * - порты ядра (`@coopenomics/innercoop`) приложение получает по сети через
19
+ * `ExtensionPortsModule`; набор портов заявлен в манифесте пакета.
17
20
  * - healthcheck `GET /_health` обязателен — orchestrator опрашивает.
18
21
  *
19
22
  * См. подробнее: docs/epics/E10-federation-runtime.md в репо apps-catalog
20
23
  * и Architecture v3 в blago.
21
24
  */
22
25
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.ExtensionConfigError = exports.loadExtensionConfig = exports.HealthController = exports.SharedAccount = exports.SharedCooperative = exports.SharedCooperator = exports.ExtensionJwtAuthGuard = exports.ExtensionJwtStrategy = exports.ExtensionAuthModule = exports.ExtensionFederationModule = void 0;
26
+ exports.PostgresCursorStore = exports.ExtensionEventsService = exports.ExtensionEventsModule = exports.parseBusEntry = exports.BUS_GAP_EVENT = exports.MemoryCursorStore = exports.BusReader = exports.AppMigrationError = exports.migrationChecksum = exports.readAppMigrations = exports.applyAppMigrations = exports.runAppMigrations = exports.remotePort = exports.REMOTE_PORT_TOKENS = exports.REMOTE_PORT_METHODS = exports.LIVE_FEED_PORT = exports.ExtensionPortsModule = exports.CorePortError = exports.CorePortsClient = exports.ExtensionAccessGuard = exports.ExtensionConfigError = exports.loadExtensionConfig = exports.HealthController = exports.SharedAccount = exports.SharedCooperative = exports.SharedCooperator = exports.ExtensionJwtAuthGuard = exports.ExtensionJwtStrategy = exports.ExtensionAuthModule = exports.ExtensionFederationModule = void 0;
24
27
  var federation_module_1 = require("./federation/federation.module");
25
28
  Object.defineProperty(exports, "ExtensionFederationModule", { enumerable: true, get: function () { return federation_module_1.ExtensionFederationModule; } });
26
29
  var extension_auth_module_1 = require("./auth/extension-auth.module");
@@ -40,3 +43,29 @@ Object.defineProperty(exports, "HealthController", { enumerable: true, get: func
40
43
  var extension_config_1 = require("./config/extension-config");
41
44
  Object.defineProperty(exports, "loadExtensionConfig", { enumerable: true, get: function () { return extension_config_1.loadExtensionConfig; } });
42
45
  Object.defineProperty(exports, "ExtensionConfigError", { enumerable: true, get: function () { return extension_config_1.ExtensionConfigError; } });
46
+ var extension_access_guard_1 = require("./auth/extension-access.guard");
47
+ Object.defineProperty(exports, "ExtensionAccessGuard", { enumerable: true, get: function () { return extension_access_guard_1.ExtensionAccessGuard; } });
48
+ var core_ports_client_1 = require("./ports/core-ports.client");
49
+ Object.defineProperty(exports, "CorePortsClient", { enumerable: true, get: function () { return core_ports_client_1.CorePortsClient; } });
50
+ Object.defineProperty(exports, "CorePortError", { enumerable: true, get: function () { return core_ports_client_1.CorePortError; } });
51
+ var extension_ports_module_1 = require("./ports/extension-ports.module");
52
+ Object.defineProperty(exports, "ExtensionPortsModule", { enumerable: true, get: function () { return extension_ports_module_1.ExtensionPortsModule; } });
53
+ Object.defineProperty(exports, "LIVE_FEED_PORT", { enumerable: true, get: function () { return extension_ports_module_1.LIVE_FEED_PORT; } });
54
+ Object.defineProperty(exports, "REMOTE_PORT_METHODS", { enumerable: true, get: function () { return extension_ports_module_1.REMOTE_PORT_METHODS; } });
55
+ Object.defineProperty(exports, "REMOTE_PORT_TOKENS", { enumerable: true, get: function () { return extension_ports_module_1.REMOTE_PORT_TOKENS; } });
56
+ Object.defineProperty(exports, "remotePort", { enumerable: true, get: function () { return extension_ports_module_1.remotePort; } });
57
+ var app_migrations_1 = require("./database/app-migrations");
58
+ Object.defineProperty(exports, "runAppMigrations", { enumerable: true, get: function () { return app_migrations_1.runAppMigrations; } });
59
+ Object.defineProperty(exports, "applyAppMigrations", { enumerable: true, get: function () { return app_migrations_1.applyAppMigrations; } });
60
+ Object.defineProperty(exports, "readAppMigrations", { enumerable: true, get: function () { return app_migrations_1.readAppMigrations; } });
61
+ Object.defineProperty(exports, "migrationChecksum", { enumerable: true, get: function () { return app_migrations_1.migrationChecksum; } });
62
+ Object.defineProperty(exports, "AppMigrationError", { enumerable: true, get: function () { return app_migrations_1.AppMigrationError; } });
63
+ var bus_reader_1 = require("./events/bus-reader");
64
+ Object.defineProperty(exports, "BusReader", { enumerable: true, get: function () { return bus_reader_1.BusReader; } });
65
+ Object.defineProperty(exports, "MemoryCursorStore", { enumerable: true, get: function () { return bus_reader_1.MemoryCursorStore; } });
66
+ Object.defineProperty(exports, "BUS_GAP_EVENT", { enumerable: true, get: function () { return bus_reader_1.BUS_GAP_EVENT; } });
67
+ Object.defineProperty(exports, "parseBusEntry", { enumerable: true, get: function () { return bus_reader_1.parseBusEntry; } });
68
+ var extension_events_module_1 = require("./events/extension-events.module");
69
+ Object.defineProperty(exports, "ExtensionEventsModule", { enumerable: true, get: function () { return extension_events_module_1.ExtensionEventsModule; } });
70
+ Object.defineProperty(exports, "ExtensionEventsService", { enumerable: true, get: function () { return extension_events_module_1.ExtensionEventsService; } });
71
+ Object.defineProperty(exports, "PostgresCursorStore", { enumerable: true, get: function () { return extension_events_module_1.PostgresCursorStore; } });
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Клиент входа портов ядра (`POST /v1/internal/ports/:port/:method`).
3
+ *
4
+ * Приложение каталога работает в своём контейнере, и инъекции порта через
5
+ * границу процесса нет. Клиент выполняет тот же вызов по сети: тело —
6
+ * аргументы метода, ответ — его результат. Токен приложения выдаёт ядро при
7
+ * установке, оркестратор кладёт его в окружение контейнера.
8
+ */
9
+ /** Отказ ядра: его код и текст — те же, что получил бы вызов внутри ядра. */
10
+ export declare class CorePortError extends Error {
11
+ /** HTTP-статус ответа ядра; 0 — ядро не ответило. */
12
+ readonly status: number;
13
+ /** Код отказа ядра (`APPS_CATALOG_PROXY_APP_PORT_NOT_GRANTED`, `DOCUMENT_NOT_FOUND`, …). */
14
+ readonly code: string;
15
+ /** Параметры отказа из ответа ядра. */
16
+ readonly params: Record<string, unknown>;
17
+ constructor(
18
+ /** HTTP-статус ответа ядра; 0 — ядро не ответило. */
19
+ status: number,
20
+ /** Код отказа ядра (`APPS_CATALOG_PROXY_APP_PORT_NOT_GRANTED`, `DOCUMENT_NOT_FOUND`, …). */
21
+ code: string, message: string,
22
+ /** Параметры отказа из ответа ядра. */
23
+ params?: Record<string, unknown>);
24
+ }
25
+ export interface CorePortsClientOptions {
26
+ /** Адрес ядра в сети узла, например `http://coopback:2998`. */
27
+ baseUrl: string;
28
+ /** Токен приложения (`apt_…`). */
29
+ token: string;
30
+ /** Предел ожидания одного вызова, мс. По умолчанию 30 с — формирование PDF небыстрое. */
31
+ timeoutMs?: number;
32
+ /** Подмена fetch в тестах. */
33
+ fetchFn?: typeof fetch;
34
+ }
35
+ export declare class CorePortsClient {
36
+ private readonly options;
37
+ private readonly baseUrl;
38
+ private readonly timeoutMs;
39
+ private readonly fetchFn;
40
+ constructor(options: CorePortsClientOptions);
41
+ /**
42
+ * Вызвать метод порта ядра.
43
+ *
44
+ * @throws CorePortError — ядро отказало (статус и код из его ответа) либо
45
+ * не ответило (статус 0, код `CORE_UNREACHABLE`).
46
+ */
47
+ call<T = unknown>(port: string, method: string, args: unknown[]): Promise<T>;
48
+ private once;
49
+ }
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ /**
3
+ * Клиент входа портов ядра (`POST /v1/internal/ports/:port/:method`).
4
+ *
5
+ * Приложение каталога работает в своём контейнере, и инъекции порта через
6
+ * границу процесса нет. Клиент выполняет тот же вызов по сети: тело —
7
+ * аргументы метода, ответ — его результат. Токен приложения выдаёт ядро при
8
+ * установке, оркестратор кладёт его в окружение контейнера.
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.CorePortsClient = exports.CorePortError = void 0;
12
+ /** Отказ ядра: его код и текст — те же, что получил бы вызов внутри ядра. */
13
+ class CorePortError extends Error {
14
+ status;
15
+ code;
16
+ params;
17
+ constructor(
18
+ /** HTTP-статус ответа ядра; 0 — ядро не ответило. */
19
+ status,
20
+ /** Код отказа ядра (`APPS_CATALOG_PROXY_APP_PORT_NOT_GRANTED`, `DOCUMENT_NOT_FOUND`, …). */
21
+ code, message,
22
+ /** Параметры отказа из ответа ядра. */
23
+ params = {}) {
24
+ super(message);
25
+ this.status = status;
26
+ this.code = code;
27
+ this.params = params;
28
+ this.name = 'CorePortError';
29
+ }
30
+ }
31
+ exports.CorePortError = CorePortError;
32
+ /**
33
+ * Чтения, которые безопасно повторить при сбое сети. Всё остальное не
34
+ * повторяется: `chain.transact` и `document.generate` меняют состояние, а
35
+ * повторная транзакция в цепи хуже отказа (ADR-18, п. 4).
36
+ */
37
+ const RETRYABLE = new Set([
38
+ 'document.getByHash',
39
+ 'document.validateSigned',
40
+ 'document.buildAggregate',
41
+ 'cooperativeVars.get',
42
+ 'accessToken.identify',
43
+ 'account.getDisplayName',
44
+ 'account.getAccount',
45
+ 'account.getAccounts',
46
+ 'notification.getDeliveries',
47
+ 'userDirectory.findByRoles',
48
+ 'chain.getSingleRow',
49
+ 'chain.queryRows',
50
+ ]);
51
+ const RETRY_PAUSE_MS = 300;
52
+ class CorePortsClient {
53
+ options;
54
+ baseUrl;
55
+ timeoutMs;
56
+ fetchFn;
57
+ constructor(options) {
58
+ this.options = options;
59
+ this.baseUrl = options.baseUrl.replace(/\/+$/, '');
60
+ this.timeoutMs = options.timeoutMs ?? 30_000;
61
+ this.fetchFn = options.fetchFn ?? fetch;
62
+ }
63
+ /**
64
+ * Вызвать метод порта ядра.
65
+ *
66
+ * @throws CorePortError — ядро отказало (статус и код из его ответа) либо
67
+ * не ответило (статус 0, код `CORE_UNREACHABLE`).
68
+ */
69
+ async call(port, method, args) {
70
+ const attempts = RETRYABLE.has(`${port}.${method}`) ? 2 : 1;
71
+ let last;
72
+ for (let attempt = 1; attempt <= attempts; attempt += 1) {
73
+ try {
74
+ return await this.once(port, method, args);
75
+ }
76
+ catch (e) {
77
+ last = e instanceof CorePortError ? e : new CorePortError(0, 'CORE_UNREACHABLE', String(e));
78
+ // Повторяется только молчание ядра и его 5xx: отказ по правам повтор не изменит.
79
+ if (last.status !== 0 && last.status < 500)
80
+ break;
81
+ if (attempt < attempts)
82
+ await new Promise((r) => setTimeout(r, RETRY_PAUSE_MS));
83
+ }
84
+ }
85
+ throw last;
86
+ }
87
+ async once(port, method, args) {
88
+ let res;
89
+ try {
90
+ res = await this.fetchFn(`${this.baseUrl}/v1/internal/ports/${port}/${method}`, {
91
+ method: 'POST',
92
+ headers: { 'content-type': 'application/json', authorization: `Bearer ${this.options.token}` },
93
+ body: JSON.stringify({ args }),
94
+ signal: AbortSignal.timeout(this.timeoutMs),
95
+ });
96
+ }
97
+ catch (e) {
98
+ throw new CorePortError(0, 'CORE_UNREACHABLE', `ядро не ответило на ${port}.${method}: ${e instanceof Error ? e.message : String(e)}`);
99
+ }
100
+ const text = await res.text();
101
+ let body = null;
102
+ try {
103
+ body = text ? JSON.parse(text) : null;
104
+ }
105
+ catch {
106
+ body = null;
107
+ }
108
+ if (!res.ok) {
109
+ throw new CorePortError(res.status, typeof body?.code === 'string' ? body.code : 'CORE_PORT_FAILED', typeof body?.message === 'string' ? body.message : `ядро ответило ${res.status} на ${port}.${method}`, body?.params && typeof body.params === 'object' ? body.params : {});
110
+ }
111
+ return (body?.result ?? null);
112
+ }
113
+ }
114
+ exports.CorePortsClient = CorePortsClient;
@@ -0,0 +1,88 @@
1
+ import { DynamicModule } from '@nestjs/common';
2
+ import { CorePortsClient } from './core-ports.client';
3
+ /**
4
+ * Порты ядра, доступные приложению по сети: имя порта в адресе вызова и
5
+ * DI-токен `@coopenomics/innercoop`, под которым приложение его инжектит.
6
+ * Токены — `Symbol.for(...)`: совпадают с токенами пакета innercoop без
7
+ * зависимости SDK от него.
8
+ */
9
+ export declare const REMOTE_PORT_TOKENS: {
10
+ readonly document: symbol;
11
+ readonly cooperativeVars: symbol;
12
+ readonly accessToken: symbol;
13
+ readonly account: symbol;
14
+ readonly chain: symbol;
15
+ readonly notification: symbol;
16
+ readonly userDirectory: symbol;
17
+ readonly liveFeed: symbol;
18
+ };
19
+ /** Изменение строки таблицы приложения для живого обновления экранов — без данных строки. */
20
+ export interface AppLiveChange {
21
+ /** Таблица базы приложения. */
22
+ table: string;
23
+ /** Ключ строки; не задан — изменилась таблица целиком. */
24
+ key?: string;
25
+ /** Сигнал только персоналу: совету и назначенным приложением. */
26
+ staffOnly?: boolean;
27
+ /** Владельцы строки — учётные имена пайщиков, которым сигнал положен. */
28
+ owners?: string[];
29
+ }
30
+ /**
31
+ * Живое обновление экранов приложения (порт `liveFeed`, 487-39). После
32
+ * записи в свою базу бэкенд сообщает ядру, какие таблицы изменились; стол
33
+ * передаёт сигнал рамке приложения, рамка перечитывает экран.
34
+ *
35
+ * ```ts
36
+ * constructor(@Inject(LIVE_FEED_PORT) private readonly live: IAppLiveFeed) {}
37
+ * await this.live.publish([{ table: 'greetings_templates', key: id, staffOnly: true }]);
38
+ * ```
39
+ */
40
+ export interface IAppLiveFeed {
41
+ publish(changes: AppLiveChange[]): Promise<void>;
42
+ }
43
+ /** DI-токен порта живого обновления. */
44
+ export declare const LIVE_FEED_PORT: symbol;
45
+ /** Имя порта ядра, доступного по сети. */
46
+ export type RemotePortName = keyof typeof REMOTE_PORT_TOKENS;
47
+ /**
48
+ * Методы портов, открытые ядром по сети — зеркало каталога ядра
49
+ * (`remote-ports.catalog.ts` расширения apps). Объект порта отвечает только
50
+ * на них: Nest, Apollo и `JSON.stringify` спрашивают у провайдера служебные
51
+ * свойства (`then`, `toJSON`, `onModuleInit`), и сетевой вызов на каждое
52
+ * такое обращение ронял приложение отказом ядра.
53
+ */
54
+ export declare const REMOTE_PORT_METHODS: Record<RemotePortName, readonly string[]>;
55
+ export interface ExtensionPortsOptions {
56
+ /** Адрес ядра (`CORE_PORTS_URL`). */
57
+ coreUrl: string;
58
+ /** Токен приложения (`CORE_PORTS_TOKEN`). */
59
+ token: string;
60
+ /**
61
+ * Порты, которые приложение использует. Те же имена стоят в манифесте
62
+ * пакета (`coopenomics.ports`): незаявленный порт ядро отклонит.
63
+ */
64
+ ports: RemotePortName[];
65
+ /** Предел ожидания вызова, мс. */
66
+ timeoutMs?: number;
67
+ }
68
+ /**
69
+ * Объект порта, каждый метод которого — вызов ядра по сети.
70
+ *
71
+ * `chain.initialize(username, wif)` — пустое действие: в монолите расширение
72
+ * назначало подписанта своим ключом, вынесенному приложению ключ не
73
+ * передаётся — действия цепи подписывает ядро. Метод оставлен, чтобы код
74
+ * расширения переезжал без правок.
75
+ */
76
+ export declare function remotePort(client: CorePortsClient, port: RemotePortName): object;
77
+ /**
78
+ * Модуль портов ядра для приложения каталога.
79
+ *
80
+ * ```ts
81
+ * ExtensionPortsModule.forRoot({ coreUrl: cfg.corePortsUrl, token: cfg.corePortsToken, ports: ['document'] })
82
+ * // в сервисе приложения — как в монолите:
83
+ * constructor(@Inject(DOCUMENT_PORT) private readonly documents: IDocumentPort) {}
84
+ * ```
85
+ */
86
+ export declare class ExtensionPortsModule {
87
+ static forRoot(options: ExtensionPortsOptions): DynamicModule;
88
+ }
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var ExtensionPortsModule_1;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.ExtensionPortsModule = exports.REMOTE_PORT_METHODS = exports.LIVE_FEED_PORT = exports.REMOTE_PORT_TOKENS = void 0;
11
+ exports.remotePort = remotePort;
12
+ const common_1 = require("@nestjs/common");
13
+ const core_ports_client_1 = require("./core-ports.client");
14
+ /**
15
+ * Порты ядра, доступные приложению по сети: имя порта в адресе вызова и
16
+ * DI-токен `@coopenomics/innercoop`, под которым приложение его инжектит.
17
+ * Токены — `Symbol.for(...)`: совпадают с токенами пакета innercoop без
18
+ * зависимости SDK от него.
19
+ */
20
+ exports.REMOTE_PORT_TOKENS = {
21
+ document: Symbol.for('Innercoop.CorePort.Document'),
22
+ cooperativeVars: Symbol.for('Innercoop.CorePort.CooperativeVars'),
23
+ accessToken: Symbol.for('Innercoop.CorePort.AccessToken'),
24
+ account: Symbol.for('Innercoop.CorePort.Account'),
25
+ chain: Symbol.for('Innercoop.CorePort.Chain'),
26
+ notification: Symbol.for('Innercoop.CorePort.Notification'),
27
+ userDirectory: Symbol.for('Innercoop.CorePort.UserDirectory'),
28
+ liveFeed: Symbol.for('Innercoop.CorePort.LiveFeed'),
29
+ };
30
+ /** DI-токен порта живого обновления. */
31
+ exports.LIVE_FEED_PORT = exports.REMOTE_PORT_TOKENS.liveFeed;
32
+ /**
33
+ * Методы портов, открытые ядром по сети — зеркало каталога ядра
34
+ * (`remote-ports.catalog.ts` расширения apps). Объект порта отвечает только
35
+ * на них: Nest, Apollo и `JSON.stringify` спрашивают у провайдера служебные
36
+ * свойства (`then`, `toJSON`, `onModuleInit`), и сетевой вызов на каждое
37
+ * такое обращение ронял приложение отказом ядра.
38
+ */
39
+ exports.REMOTE_PORT_METHODS = {
40
+ document: ['generate', 'getByHash', 'validateSigned', 'buildAggregate'],
41
+ cooperativeVars: ['get'],
42
+ accessToken: ['identify'],
43
+ account: ['getDisplayName', 'getAccount', 'getAccounts'],
44
+ chain: ['transact', 'getSingleRow', 'queryRows'],
45
+ // Письмо — только по сценариям писем кооператива; служебный сценарий ядро отклонит.
46
+ notification: ['notifyUser', 'getDeliveries'],
47
+ userDirectory: ['findByRoles'],
48
+ liveFeed: ['publish'],
49
+ };
50
+ /**
51
+ * Объект порта, каждый метод которого — вызов ядра по сети.
52
+ *
53
+ * `chain.initialize(username, wif)` — пустое действие: в монолите расширение
54
+ * назначало подписанта своим ключом, вынесенному приложению ключ не
55
+ * передаётся — действия цепи подписывает ядро. Метод оставлен, чтобы код
56
+ * расширения переезжал без правок.
57
+ */
58
+ function remotePort(client, port) {
59
+ const target = {};
60
+ for (const method of exports.REMOTE_PORT_METHODS[port]) {
61
+ target[method] = (...args) => client.call(port, method, args);
62
+ }
63
+ if (port === 'chain')
64
+ target.initialize = () => undefined;
65
+ return Object.freeze(target);
66
+ }
67
+ /**
68
+ * Модуль портов ядра для приложения каталога.
69
+ *
70
+ * ```ts
71
+ * ExtensionPortsModule.forRoot({ coreUrl: cfg.corePortsUrl, token: cfg.corePortsToken, ports: ['document'] })
72
+ * // в сервисе приложения — как в монолите:
73
+ * constructor(@Inject(DOCUMENT_PORT) private readonly documents: IDocumentPort) {}
74
+ * ```
75
+ */
76
+ let ExtensionPortsModule = ExtensionPortsModule_1 = class ExtensionPortsModule {
77
+ static forRoot(options) {
78
+ const client = new core_ports_client_1.CorePortsClient({ baseUrl: options.coreUrl, token: options.token, timeoutMs: options.timeoutMs });
79
+ const providers = [
80
+ { provide: core_ports_client_1.CorePortsClient, useValue: client },
81
+ ...options.ports.map((port) => ({ provide: exports.REMOTE_PORT_TOKENS[port], useValue: remotePort(client, port) })),
82
+ ];
83
+ return { module: ExtensionPortsModule_1, providers, exports: providers.map((p) => p.provide) };
84
+ }
85
+ };
86
+ exports.ExtensionPortsModule = ExtensionPortsModule;
87
+ exports.ExtensionPortsModule = ExtensionPortsModule = ExtensionPortsModule_1 = __decorate([
88
+ (0, common_1.Global)(),
89
+ (0, common_1.Module)({})
90
+ ], ExtensionPortsModule);
package/package.json CHANGED
@@ -1,12 +1,30 @@
1
1
  {
2
2
  "name": "@coopenomics/extension-sdk",
3
- "version": "2026.11.25",
3
+ "version": "2026.12.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "description": "SDK для разработки backend-расширений Apollo Federation v2 subgraph'ов экосистемы кооперативов",
8
8
  "main": "./dist/index.js",
9
9
  "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.js"
14
+ },
15
+ "./database": {
16
+ "types": "./dist/database/index.d.ts",
17
+ "default": "./dist/database/index.js"
18
+ },
19
+ "./package.json": "./package.json"
20
+ },
21
+ "typesVersions": {
22
+ "*": {
23
+ "database": [
24
+ "./dist/database/index.d.ts"
25
+ ]
26
+ }
27
+ },
10
28
  "files": [
11
29
  "dist",
12
30
  "templates",
@@ -16,11 +34,17 @@
16
34
  "build": "tsc -p tsconfig.json",
17
35
  "clean": "rm -rf dist"
18
36
  },
37
+ "dependencies": {
38
+ "ioredis": "^5.4.1",
39
+ "kysely": "0.28.17",
40
+ "pg": "^8.13.0"
41
+ },
19
42
  "peerDependencies": {
20
43
  "@apollo/subgraph": "^2.0.0",
21
44
  "@nestjs/apollo": "^12.0.0",
22
45
  "@nestjs/common": "^10.0.0",
23
46
  "@nestjs/core": "^10.0.0",
47
+ "@nestjs/event-emitter": "^3.0.0",
24
48
  "@nestjs/graphql": "^12.0.0",
25
49
  "@nestjs/passport": "^10.0.0",
26
50
  "graphql": "^16.0.0",
@@ -33,9 +57,11 @@
33
57
  "@nestjs/apollo": "^12.2.1",
34
58
  "@nestjs/common": "^10.4.0",
35
59
  "@nestjs/core": "^10.4.0",
60
+ "@nestjs/event-emitter": "^3.0.1",
36
61
  "@nestjs/graphql": "^12.2.1",
37
62
  "@nestjs/passport": "^10.0.3",
38
63
  "@types/passport-jwt": "^4",
64
+ "@types/pg": "^8.15.6",
39
65
  "graphql": "^16.9.0",
40
66
  "passport-jwt": "^4.0.1",
41
67
  "reflect-metadata": "^0.2.2",
@@ -43,5 +69,5 @@
43
69
  "typescript": "^5.4.0",
44
70
  "unbuild": "^2.0.0"
45
71
  },
46
- "gitHead": "954db4187442310adccb28b7de13c0524f1cb3f1"
72
+ "gitHead": "404b3d1f9bd49f2cc9b0425401c61a69dc115744"
47
73
  }