@coopenomics/extension-kit 2026.10.29 → 2026.11.6-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/dist/index.cjs +115 -0
- package/dist/index.d.cts +91 -8
- package/dist/index.d.mts +91 -8
- package/dist/index.d.ts +91 -8
- package/dist/index.mjs +104 -1
- package/package.json +7 -5
package/dist/index.cjs
CHANGED
|
@@ -718,6 +718,12 @@ exports.IPNProvider = __decorateClass$n([
|
|
|
718
718
|
common.Injectable()
|
|
719
719
|
], exports.IPNProvider);
|
|
720
720
|
|
|
721
|
+
function bankSafeText(text) {
|
|
722
|
+
if (text == null)
|
|
723
|
+
return text;
|
|
724
|
+
return text.replace(/ё/g, "\u0435").replace(/Ё/g, "\u0415");
|
|
725
|
+
}
|
|
726
|
+
|
|
721
727
|
const REGISTERED = /* @__PURE__ */ new Map();
|
|
722
728
|
const BucketRegistry = {
|
|
723
729
|
add(cls, spec) {
|
|
@@ -2307,6 +2313,103 @@ function platformSettings() {
|
|
|
2307
2313
|
return settings;
|
|
2308
2314
|
}
|
|
2309
2315
|
|
|
2316
|
+
function timeZoneOffsetMs(date, timeZone) {
|
|
2317
|
+
const parts = new Intl.DateTimeFormat("en-US", {
|
|
2318
|
+
timeZone,
|
|
2319
|
+
hourCycle: "h23",
|
|
2320
|
+
year: "numeric",
|
|
2321
|
+
month: "2-digit",
|
|
2322
|
+
day: "2-digit",
|
|
2323
|
+
hour: "2-digit",
|
|
2324
|
+
minute: "2-digit",
|
|
2325
|
+
second: "2-digit"
|
|
2326
|
+
}).formatToParts(date);
|
|
2327
|
+
const get = (type) => Number(parts.find((p) => p.type === type)?.value ?? 0);
|
|
2328
|
+
const asUtc = Date.UTC(get("year"), get("month") - 1, get("day"), get("hour"), get("minute"), get("second"));
|
|
2329
|
+
return asUtc - Math.floor(date.getTime() / 1e3) * 1e3;
|
|
2330
|
+
}
|
|
2331
|
+
function nextLocalMidnight(date, timeZone) {
|
|
2332
|
+
const parts = new Intl.DateTimeFormat("en-US", { timeZone, year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(date);
|
|
2333
|
+
const get = (type) => Number(parts.find((p) => p.type === type)?.value ?? 0);
|
|
2334
|
+
const utcMidnight = Date.UTC(get("year"), get("month") - 1, get("day") + 1);
|
|
2335
|
+
return new Date(utcMidnight - timeZoneOffsetMs(new Date(utcMidnight), timeZone));
|
|
2336
|
+
}
|
|
2337
|
+
|
|
2338
|
+
const SECONDS_IN_DAY = 24 * 60 * 60;
|
|
2339
|
+
const DAYS_IN_COMPRESSED_MONTH = 10;
|
|
2340
|
+
const COMPRESSED_WORKER_PACE_SECONDS = 60;
|
|
2341
|
+
function inProduction() {
|
|
2342
|
+
return process.env.NODE_ENV === "production";
|
|
2343
|
+
}
|
|
2344
|
+
function envSeconds(name, allowZero) {
|
|
2345
|
+
const raw = process.env[name];
|
|
2346
|
+
if (raw === void 0 || raw.trim() === "")
|
|
2347
|
+
return null;
|
|
2348
|
+
const value = Number(raw);
|
|
2349
|
+
if (!Number.isFinite(value))
|
|
2350
|
+
return null;
|
|
2351
|
+
if (allowZero ? value < 0 : value <= 0)
|
|
2352
|
+
return null;
|
|
2353
|
+
return Math.floor(value);
|
|
2354
|
+
}
|
|
2355
|
+
function standDaySeconds() {
|
|
2356
|
+
if (inProduction())
|
|
2357
|
+
return SECONDS_IN_DAY;
|
|
2358
|
+
return envSeconds("STAND_DAY_SECONDS", false) ?? SECONDS_IN_DAY;
|
|
2359
|
+
}
|
|
2360
|
+
function isStandTimeConfigured() {
|
|
2361
|
+
if (inProduction())
|
|
2362
|
+
return false;
|
|
2363
|
+
return envSeconds("STAND_DAY_SECONDS", false) !== null || envSeconds("STAND_MONTH_SECONDS", true) !== null || envSeconds("STAND_WORKER_PACE_SECONDS", false) !== null;
|
|
2364
|
+
}
|
|
2365
|
+
function standMonthSeconds() {
|
|
2366
|
+
if (inProduction())
|
|
2367
|
+
return 0;
|
|
2368
|
+
const custom = envSeconds("STAND_MONTH_SECONDS", true);
|
|
2369
|
+
if (custom !== null)
|
|
2370
|
+
return custom;
|
|
2371
|
+
return standDaySeconds() !== SECONDS_IN_DAY ? DAYS_IN_COMPRESSED_MONTH * standDaySeconds() : 0;
|
|
2372
|
+
}
|
|
2373
|
+
function isStandTimeCompressed() {
|
|
2374
|
+
return standDaySeconds() !== SECONDS_IN_DAY || standMonthSeconds() > 0;
|
|
2375
|
+
}
|
|
2376
|
+
function standWorkerPaceSeconds(productionPaceSeconds) {
|
|
2377
|
+
if (!isStandTimeCompressed())
|
|
2378
|
+
return productionPaceSeconds;
|
|
2379
|
+
return envSeconds("STAND_WORKER_PACE_SECONDS", false) ?? COMPRESSED_WORKER_PACE_SECONDS;
|
|
2380
|
+
}
|
|
2381
|
+
function isStandWorkerTurn(productionPaceSeconds, now = /* @__PURE__ */ new Date()) {
|
|
2382
|
+
const paceMinutes = Math.max(1, Math.round(standWorkerPaceSeconds(productionPaceSeconds) / 60));
|
|
2383
|
+
const minutes = Math.floor(now.getTime() / 6e4);
|
|
2384
|
+
return minutes % paceMinutes === 0;
|
|
2385
|
+
}
|
|
2386
|
+
function standPeriodKey(date, timeZone) {
|
|
2387
|
+
const monthSeconds = standMonthSeconds();
|
|
2388
|
+
if (monthSeconds > 0)
|
|
2389
|
+
return Math.floor(date.getTime() / 1e3 / monthSeconds);
|
|
2390
|
+
const parts = new Intl.DateTimeFormat("en-US", { timeZone, year: "numeric", month: "2-digit" }).formatToParts(date);
|
|
2391
|
+
const year = Number(parts.find((p) => p.type === "year")?.value ?? 0);
|
|
2392
|
+
const month = Number(parts.find((p) => p.type === "month")?.value ?? 0);
|
|
2393
|
+
return year * 12 + month;
|
|
2394
|
+
}
|
|
2395
|
+
function standNextPeriodStart(date, timeZone) {
|
|
2396
|
+
const monthSeconds = standMonthSeconds();
|
|
2397
|
+
if (monthSeconds > 0) {
|
|
2398
|
+
return new Date((Math.floor(date.getTime() / 1e3 / monthSeconds) + 1) * monthSeconds * 1e3);
|
|
2399
|
+
}
|
|
2400
|
+
const parts = new Intl.DateTimeFormat("en-US", { timeZone, year: "numeric", month: "2-digit" }).formatToParts(date);
|
|
2401
|
+
const year = Number(parts.find((p) => p.type === "year")?.value ?? 0);
|
|
2402
|
+
const month = Number(parts.find((p) => p.type === "month")?.value ?? 1);
|
|
2403
|
+
const utcMidnight = Date.UTC(month === 12 ? year + 1 : year, month === 12 ? 0 : month, 1);
|
|
2404
|
+
return new Date(utcMidnight - timeZoneOffsetMs(new Date(utcMidnight), timeZone));
|
|
2405
|
+
}
|
|
2406
|
+
function describeStandTime() {
|
|
2407
|
+
if (!isStandTimeCompressed())
|
|
2408
|
+
return "\u0432\u0440\u0435\u043C\u044F \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0435";
|
|
2409
|
+
const month = standMonthSeconds();
|
|
2410
|
+
return `\u0432\u0440\u0435\u043C\u044F \u0441\u0442\u0435\u043D\u0434\u0430 \u0441\u0436\u0430\u0442\u043E: \u0441\u0443\u0442\u043A\u0438 ${standDaySeconds()} \u0441, \u043C\u0435\u0441\u044F\u0446 ${month > 0 ? `${month} \u0441` : "\u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u0439"}, \u0448\u0430\u0433 \u043E\u0431\u0445\u043E\u0434\u043E\u0432 ${standWorkerPaceSeconds(0)} \u0441`;
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2310
2413
|
var __defProp$5 = Object.defineProperty;
|
|
2311
2414
|
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
2312
2415
|
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
@@ -3243,6 +3346,7 @@ exports.SORT_FIELD_PATTERN = SORT_FIELD_PATTERN;
|
|
|
3243
3346
|
exports.SafeMarkup = SafeMarkup;
|
|
3244
3347
|
exports.UseBucket = UseBucket;
|
|
3245
3348
|
exports.attachOne = attachOne;
|
|
3349
|
+
exports.bankSafeText = bankSafeText;
|
|
3246
3350
|
exports.bucketProvidersFor = bucketProvidersFor;
|
|
3247
3351
|
exports.bucketTokenFor = bucketTokenFor;
|
|
3248
3352
|
exports.buildPaginationResult = buildPaginationResult;
|
|
@@ -3259,6 +3363,7 @@ exports.configurePlatformSettings = configurePlatformSettings;
|
|
|
3259
3363
|
exports.councilRolesOf = councilRolesOf;
|
|
3260
3364
|
exports.createPaginationResult = createPaginationResult;
|
|
3261
3365
|
exports.describeConfigField = describeConfigField;
|
|
3366
|
+
exports.describeStandTime = describeStandTime;
|
|
3262
3367
|
exports.desktopGrants = desktopGrants;
|
|
3263
3368
|
exports.desktopGrantsOf = desktopGrantsOf;
|
|
3264
3369
|
exports.domainErrorMessage = domainErrorMessage;
|
|
@@ -3273,8 +3378,12 @@ exports.hasServerSecret = hasServerSecret;
|
|
|
3273
3378
|
exports.isChainTextDigest = isChainTextDigest;
|
|
3274
3379
|
exports.isChainTextOf = isChainTextOf;
|
|
3275
3380
|
exports.isExtensionAvailable = isExtensionAvailable;
|
|
3381
|
+
exports.isStandTimeCompressed = isStandTimeCompressed;
|
|
3382
|
+
exports.isStandTimeConfigured = isStandTimeConfigured;
|
|
3383
|
+
exports.isStandWorkerTurn = isStandWorkerTurn;
|
|
3276
3384
|
exports.memberRolesOf = memberRolesOf;
|
|
3277
3385
|
exports.mergeSecretConfig = mergeSecretConfig;
|
|
3386
|
+
exports.nextLocalMidnight = nextLocalMidnight;
|
|
3278
3387
|
exports.paginationInputToOffset = paginationInputToOffset;
|
|
3279
3388
|
exports.parseChainAssert = parseChainAssert;
|
|
3280
3389
|
exports.pickDefined = pickDefined;
|
|
@@ -3294,6 +3403,12 @@ exports.sanitizeUserText = sanitizeUserText;
|
|
|
3294
3403
|
exports.scopeConditions = scopeConditions;
|
|
3295
3404
|
exports.scopeOfRight = scopeOfRight;
|
|
3296
3405
|
exports.scopesMatched = scopesMatched;
|
|
3406
|
+
exports.standDaySeconds = standDaySeconds;
|
|
3407
|
+
exports.standMonthSeconds = standMonthSeconds;
|
|
3408
|
+
exports.standNextPeriodStart = standNextPeriodStart;
|
|
3409
|
+
exports.standPeriodKey = standPeriodKey;
|
|
3410
|
+
exports.standWorkerPaceSeconds = standWorkerPaceSeconds;
|
|
3411
|
+
exports.timeZoneOffsetMs = timeZoneOffsetMs;
|
|
3297
3412
|
exports.validationMessage = validationMessage;
|
|
3298
3413
|
exports.verifySignedDocumentAgainstStoredDraft = verifySignedDocumentAgainstStoredDraft;
|
|
3299
3414
|
exports.waitForEvent = waitForEvent;
|
package/dist/index.d.cts
CHANGED
|
@@ -5,6 +5,7 @@ import { Observable } from 'rxjs';
|
|
|
5
5
|
import { MongoQuery } from '@casl/ability';
|
|
6
6
|
import { Reflector } from '@nestjs/core';
|
|
7
7
|
import { ZodObject } from 'zod';
|
|
8
|
+
import { IMetaDocument, IGenerate, Registry, IGeneratedDocument, IGenerationOptions } from '@coopenomics/docs-templates';
|
|
8
9
|
import { Cooperative } from 'cooptypes';
|
|
9
10
|
import { Kysely } from 'kysely';
|
|
10
11
|
import { T as TableStore } from './shared/extension-kit.9c3dd9f1.cjs';
|
|
@@ -559,6 +560,19 @@ declare abstract class IPNProvider extends PaymentProvider {
|
|
|
559
560
|
abstract handleIPN(request: any): Promise<void>;
|
|
560
561
|
}
|
|
561
562
|
|
|
563
|
+
/**
|
|
564
|
+
* Текст для банковского поручения: назначение платежа, строка QR-кода оплаты.
|
|
565
|
+
*
|
|
566
|
+
* Банки не принимают букву «ё» в назначении платежа: пайщик копирует
|
|
567
|
+
* назначение в банк, и поручение с «Цифровой Кошелёк» или «аванс под отчёт»
|
|
568
|
+
* отклоняется (владелец 06.11.2026). Буква заменяется на «е» там, где
|
|
569
|
+
* назначение записывается в платёж, заявку на выплату или реквизиты, — один
|
|
570
|
+
* раз и для всех источников: подписи в словарях и тексты интерфейса остаются
|
|
571
|
+
* с «ё», меняется только текст, который передаётся в банк.
|
|
572
|
+
*/
|
|
573
|
+
declare function bankSafeText(text: string): string;
|
|
574
|
+
declare function bankSafeText(text: string | null | undefined): string | null | undefined;
|
|
575
|
+
|
|
562
576
|
/**
|
|
563
577
|
* Объявление хранилища файлов, которое заводит себе расширение.
|
|
564
578
|
*
|
|
@@ -686,7 +700,7 @@ declare enum LangType {
|
|
|
686
700
|
ru = "ru"
|
|
687
701
|
}
|
|
688
702
|
|
|
689
|
-
declare class MetaDocumentInputDTO implements
|
|
703
|
+
declare class MetaDocumentInputDTO implements IMetaDocument {
|
|
690
704
|
title: string;
|
|
691
705
|
registry_id: number;
|
|
692
706
|
lang: LangType;
|
|
@@ -701,7 +715,7 @@ declare class MetaDocumentInputDTO implements Cooperative.Document.IMetaDocument
|
|
|
701
715
|
builder?: string;
|
|
702
716
|
}
|
|
703
717
|
|
|
704
|
-
declare class GenerateMetaDocumentInputDTO implements
|
|
718
|
+
declare class GenerateMetaDocumentInputDTO implements IGenerate {
|
|
705
719
|
title?: string;
|
|
706
720
|
registry_id: number;
|
|
707
721
|
coopname: string;
|
|
@@ -715,9 +729,9 @@ declare class GenerateMetaDocumentInputDTO implements Cooperative.Document.IGene
|
|
|
715
729
|
links?: string[];
|
|
716
730
|
}
|
|
717
731
|
|
|
718
|
-
type Action =
|
|
719
|
-
type ItemAction =
|
|
720
|
-
type HeaderAction =
|
|
732
|
+
type Action = Registry.ExpenseProposalStatement.Action;
|
|
733
|
+
type ItemAction = Registry.ExpenseProposalStatement.IExpenseItem;
|
|
734
|
+
type HeaderAction = Registry.ExpenseProposalStatement.IExpenseProposalHeader;
|
|
721
735
|
/**
|
|
722
736
|
* Позиция-вход генерации СЗ-документа. Приватные поля (имя/реквизиты/назначение)
|
|
723
737
|
* — это вход для фабрики: сервер сохраняет их off-chain в doc_data и публикует
|
|
@@ -1761,7 +1775,76 @@ declare function configurePlatformSettings(value: PlatformSettings): void;
|
|
|
1761
1775
|
*/
|
|
1762
1776
|
declare function platformSettings(): PlatformSettings;
|
|
1763
1777
|
|
|
1764
|
-
|
|
1778
|
+
/**
|
|
1779
|
+
* Шкала времени стенда — общая для всех приложений (решение владельца 01.11.2026).
|
|
1780
|
+
*
|
|
1781
|
+
* В работе сутки и месяцы настоящие. На стенде разработки время сжимают, чтобы
|
|
1782
|
+
* процессы со сроками проходились за минуты: гарантийный срок заказа, списание
|
|
1783
|
+
* обеспечительной части первого числа месяца, сроки курсов «Образования».
|
|
1784
|
+
* Каждое приложение берёт длины из этой шкалы, а не держит свои переменные, — иначе
|
|
1785
|
+
* на одном стенде сутки разной длины в разных приложениях, и процессы,
|
|
1786
|
+
* связанные между собой, расходятся.
|
|
1787
|
+
*
|
|
1788
|
+
* Переменные окружения контроллера:
|
|
1789
|
+
* - `STAND_DAY_SECONDS` — длина суток, секунд (86400 — настоящие);
|
|
1790
|
+
* - `STAND_MONTH_SECONDS` — длина месяца, секунд; 0 — настоящий месяц. Не
|
|
1791
|
+
* задана — при укороченных сутках месяц равен десяти суткам;
|
|
1792
|
+
* - `STAND_WORKER_PACE_SECONDS` — шаг фоновых обходов при сжатом времени,
|
|
1793
|
+
* секунд; не задан — минута.
|
|
1794
|
+
*
|
|
1795
|
+
* `NODE_ENV=production` (боевая и тестовая сеть) — сжатия нет никогда, переменные
|
|
1796
|
+
* не действуют: ошибка в окружении прода не сокращает ничьих сроков.
|
|
1797
|
+
*
|
|
1798
|
+
* Прежние переменные «Образования» (`EDUBRIDGE_GUARANTEE_DAY_SECONDS` и др.)
|
|
1799
|
+
* читает само «Образование» как запасные — ради стендов, где они уже стоят.
|
|
1800
|
+
*/
|
|
1801
|
+
/** Длина суток на стенде, секунд. В работе — всегда настоящие сутки. */
|
|
1802
|
+
declare function standDaySeconds(): number;
|
|
1803
|
+
/** Задана ли шкала стенда явно (хоть одна из переменных). */
|
|
1804
|
+
declare function isStandTimeConfigured(): boolean;
|
|
1805
|
+
/** Длина месяца на стенде, секунд; 0 — настоящий месяц. */
|
|
1806
|
+
declare function standMonthSeconds(): number;
|
|
1807
|
+
/** Время сжато: сутки короче настоящих либо месяц задан длиной. */
|
|
1808
|
+
declare function isStandTimeCompressed(): boolean;
|
|
1809
|
+
/**
|
|
1810
|
+
* Шаг фонового обхода, секунд: в работе — свой шаг приложения, при сжатом
|
|
1811
|
+
* времени — шаг стенда (по умолчанию минута).
|
|
1812
|
+
*/
|
|
1813
|
+
declare function standWorkerPaceSeconds(productionPaceSeconds: number): number;
|
|
1814
|
+
/**
|
|
1815
|
+
* Черёд фонового обхода, который просыпается каждую минуту: в работе — на
|
|
1816
|
+
* каждой минуте, кратной своему шагу (шаг часа — нулевая минута часа), при
|
|
1817
|
+
* сжатом времени — по шагу стенда.
|
|
1818
|
+
*/
|
|
1819
|
+
declare function isStandWorkerTurn(productionPaceSeconds: number, now?: Date): boolean;
|
|
1820
|
+
/**
|
|
1821
|
+
* Номер расчётного периода «месяц», в который попадает момент. В работе —
|
|
1822
|
+
* календарный месяц в часовом поясе кооператива (год × 12 + месяц). При
|
|
1823
|
+
* заданной длине месяца стенда — номер отрезка этой длины от начала эпохи:
|
|
1824
|
+
* «первое число» наступает каждые `STAND_MONTH_SECONDS` секунд.
|
|
1825
|
+
*/
|
|
1826
|
+
declare function standPeriodKey(date: Date, timeZone: string): number;
|
|
1827
|
+
/**
|
|
1828
|
+
* Начало расчётного месяца, следующего за моментом: «первое число», с
|
|
1829
|
+
* которого строка созревает к списанию. В работе — 00:00 первого числа
|
|
1830
|
+
* следующего календарного месяца в часовом поясе кооператива, при заданной
|
|
1831
|
+
* длине месяца стенда — начало следующего отрезка этой длины.
|
|
1832
|
+
*/
|
|
1833
|
+
declare function standNextPeriodStart(date: Date, timeZone: string): Date;
|
|
1834
|
+
/** Строка для журнала при запуске: какая шкала действует. */
|
|
1835
|
+
declare function describeStandTime(): string;
|
|
1836
|
+
|
|
1837
|
+
/**
|
|
1838
|
+
* Календарный день по часовому поясу кооператива. Сроки, которые человек
|
|
1839
|
+
* понимает «до конца дня» (код передачи на пункте выдачи), считаются здесь:
|
|
1840
|
+
* полночь — местная, а не UTC.
|
|
1841
|
+
*/
|
|
1842
|
+
/** Смещение часового пояса от UTC в момент, миллисекунд (Москва — +3 ч). */
|
|
1843
|
+
declare function timeZoneOffsetMs(date: Date, timeZone: string): number;
|
|
1844
|
+
/** Полночь, которой кончается текущий день момента в часовом поясе кооператива. */
|
|
1845
|
+
declare function nextLocalMidnight(date: Date, timeZone: string): Date;
|
|
1846
|
+
|
|
1847
|
+
type GeneratedDocumentDomainInterface = Omit<IGeneratedDocument, 'binary'> & {
|
|
1765
1848
|
binary: string;
|
|
1766
1849
|
};
|
|
1767
1850
|
|
|
@@ -1774,7 +1857,7 @@ declare class GeneratedDocumentDTO implements GeneratedDocumentDomainInterface {
|
|
|
1774
1857
|
constructor(data?: GeneratedDocumentDomainInterface);
|
|
1775
1858
|
}
|
|
1776
1859
|
|
|
1777
|
-
declare class GenerateDocumentOptionsInputDTO implements
|
|
1860
|
+
declare class GenerateDocumentOptionsInputDTO implements IGenerationOptions {
|
|
1778
1861
|
skip_save?: boolean;
|
|
1779
1862
|
lang?: string;
|
|
1780
1863
|
}
|
|
@@ -2364,5 +2447,5 @@ declare function chainRefusalOf(error: unknown): DomainError | null;
|
|
|
2364
2447
|
*/
|
|
2365
2448
|
declare function rethrowChainError(error: unknown): never;
|
|
2366
2449
|
|
|
2367
|
-
export { APP_RIGHTS, ActiveUserStatusGuard, AmountFormatterUtils, AssetUtils, BaseExtensionModule, BucketRegistry, CandidateFilterInputDTO, CandidateOutputDTO, CandidateStatus, CouncilField, CurrencyValidationUtil, CurrentUser, DEFAULT_DOCUMENT_VERSION, DOCUMENT_GENERATION_THROTTLE, DateUtils, DocumentAggregateDTO, DomainError, DomainToBlockchainUtils, EMPTY_HASH, EXTENSION_APP_TERMINATE_EVENT, EXTENSION_REPOSITORY, EXTENSION_SECRET_SET, EXTENSION_SECRET_UNSET, ExpenseProposalStatementGenerateDocumentInputDTO, ExpenseProposalStatementSignedDocumentInputDTO, ExpenseProposalStatementSignedMetaDocumentInputDTO, ExtensionAvailability, ExtensionConfigSuppliedBy, ExtensionDomainEntity, GRANTED_SCOPE_KEY, GenerateDocumentInputDTO, GenerateDocumentOptionsInputDTO, GenerateMetaDocumentInputDTO, GeneratedDocumentDTO, GetLedger2HistoryInputDTO, GetLedger2PostingsInputDTO, GqlJwtAuthGuard, GrantedScope, HttpApiError, HttpJwtAuthGuard, IPNProvider, InjectBucket, KYSELY, LOG_EXTENSION_REPOSITORY, LangType, Ledger2AccountDTO, Ledger2HistoryResponseDTO, Ledger2OperationDTO, Ledger2PostingDTO, Ledger2PostingsResponseDTO, Ledger2WalletDTO, LogExtensionDomainEntity, MAIN_DATABASE, MetaDocumentInputDTO, ONBOARDING_EXPIRY_DAYS, ONBOARDING_EXPIRY_MS, OptionalCurrentUser, OptionalGqlJwtAuthGuard, PaginatedProcessSummary, PaginationInputDTO, PaginationResult, PaginationUtils, PaymentProvider, PollingProvider, ProcessActionDTO, ProcessDeltaDTO, ProcessDocumentDTO, ProcessDocumentSourceDTO, ProcessSummaryDTO, ProcessViewDTO, ProcessesFilterInput, QuantityUtils, RIGHT_METADATA_KEY, RequireRight, RightsGuard, SCOPE_DENIALS, SELF, SORT_FIELD_PATTERN, SafeMarkup, SignatureInfoDTO, SignatureInfoInputDTO, SignedDigitalDocumentDTO, SignedDigitalDocumentInputDTO, TableStore, TransactionDTO, UseBucket, affectedCount, attachOne, bucketProvidersFor, bucketTokenFor, buildPaginationResult, camelRow, chainErrorCode, chainRefusalOf, chainTextDigest, checkPaymentAmount, checkPaymentSymbol, checkRight, checkRightScope, computeOnboardingExpiresAt, configureExtensionAuth, configureLocalChangePublisher, configurePlatformSettings, councilRolesOf, createPaginationResult, describeConfigField, desktopGrants, desktopGrantsOf, domainErrorMessage, expandRights, extensionDatabaseMigrations, generateHashFromString, generateRandomHash, generateUniqueHash, getAmountPlusFee, getAppliedBlockNum, hasServerSecret, inTransaction, isChainTextDigest, isChainTextOf, isExtensionAvailable, memberRolesOf, mergeSecretConfig, paginationInputToOffset, parseChainAssert, pendingLocalChanges, pickDefined, platformSettings, providerSuppliedPaths, rawQuery, redactSecretConfig, registerExtensionDatabaseMigrations, resetExtensionDatabaseMigrations, resolveChainText, rethrowChainError, rightConditions, rightGrants, rightMatches, rightsByRole, rightsHeld, sanitizeUserText, scopeConditions, scopeOfRight, scopesMatched, snakeRow, sortColumn, sortDirection, validationMessage, verifySignedDocumentAgainstStoredDraft, waitForEvent };
|
|
2450
|
+
export { APP_RIGHTS, ActiveUserStatusGuard, AmountFormatterUtils, AssetUtils, BaseExtensionModule, BucketRegistry, CandidateFilterInputDTO, CandidateOutputDTO, CandidateStatus, CouncilField, CurrencyValidationUtil, CurrentUser, DEFAULT_DOCUMENT_VERSION, DOCUMENT_GENERATION_THROTTLE, DateUtils, DocumentAggregateDTO, DomainError, DomainToBlockchainUtils, EMPTY_HASH, EXTENSION_APP_TERMINATE_EVENT, EXTENSION_REPOSITORY, EXTENSION_SECRET_SET, EXTENSION_SECRET_UNSET, ExpenseProposalStatementGenerateDocumentInputDTO, ExpenseProposalStatementSignedDocumentInputDTO, ExpenseProposalStatementSignedMetaDocumentInputDTO, ExtensionAvailability, ExtensionConfigSuppliedBy, ExtensionDomainEntity, GRANTED_SCOPE_KEY, GenerateDocumentInputDTO, GenerateDocumentOptionsInputDTO, GenerateMetaDocumentInputDTO, GeneratedDocumentDTO, GetLedger2HistoryInputDTO, GetLedger2PostingsInputDTO, GqlJwtAuthGuard, GrantedScope, HttpApiError, HttpJwtAuthGuard, IPNProvider, InjectBucket, KYSELY, LOG_EXTENSION_REPOSITORY, LangType, Ledger2AccountDTO, Ledger2HistoryResponseDTO, Ledger2OperationDTO, Ledger2PostingDTO, Ledger2PostingsResponseDTO, Ledger2WalletDTO, LogExtensionDomainEntity, MAIN_DATABASE, MetaDocumentInputDTO, ONBOARDING_EXPIRY_DAYS, ONBOARDING_EXPIRY_MS, OptionalCurrentUser, OptionalGqlJwtAuthGuard, PaginatedProcessSummary, PaginationInputDTO, PaginationResult, PaginationUtils, PaymentProvider, PollingProvider, ProcessActionDTO, ProcessDeltaDTO, ProcessDocumentDTO, ProcessDocumentSourceDTO, ProcessSummaryDTO, ProcessViewDTO, ProcessesFilterInput, QuantityUtils, RIGHT_METADATA_KEY, RequireRight, RightsGuard, SCOPE_DENIALS, SELF, SORT_FIELD_PATTERN, SafeMarkup, SignatureInfoDTO, SignatureInfoInputDTO, SignedDigitalDocumentDTO, SignedDigitalDocumentInputDTO, TableStore, TransactionDTO, UseBucket, affectedCount, attachOne, bankSafeText, bucketProvidersFor, bucketTokenFor, buildPaginationResult, camelRow, chainErrorCode, chainRefusalOf, chainTextDigest, checkPaymentAmount, checkPaymentSymbol, checkRight, checkRightScope, computeOnboardingExpiresAt, configureExtensionAuth, configureLocalChangePublisher, configurePlatformSettings, councilRolesOf, createPaginationResult, describeConfigField, describeStandTime, desktopGrants, desktopGrantsOf, domainErrorMessage, expandRights, extensionDatabaseMigrations, generateHashFromString, generateRandomHash, generateUniqueHash, getAmountPlusFee, getAppliedBlockNum, hasServerSecret, inTransaction, isChainTextDigest, isChainTextOf, isExtensionAvailable, isStandTimeCompressed, isStandTimeConfigured, isStandWorkerTurn, memberRolesOf, mergeSecretConfig, nextLocalMidnight, paginationInputToOffset, parseChainAssert, pendingLocalChanges, pickDefined, platformSettings, providerSuppliedPaths, rawQuery, redactSecretConfig, registerExtensionDatabaseMigrations, resetExtensionDatabaseMigrations, resolveChainText, rethrowChainError, rightConditions, rightGrants, rightMatches, rightsByRole, rightsHeld, sanitizeUserText, scopeConditions, scopeOfRight, scopesMatched, snakeRow, sortColumn, sortDirection, standDaySeconds, standMonthSeconds, standNextPeriodStart, standPeriodKey, standWorkerPaceSeconds, timeZoneOffsetMs, validationMessage, verifySignedDocumentAgainstStoredDraft, waitForEvent };
|
|
2368
2451
|
export type { AppRights, AssignableRole, AttachedRole, BucketSource, BucketSpec, CouncilRole, DeserializedDescriptionOfExtension, DesktopGrantsRequest, DomainErrorParams, EventSource, EventWait, ExcludeCommonProps, ExtensionAppTerminatePayload, ExtensionAuthOptions, ExtensionConfigFieldPolicy, ExtensionConfigPolicy, ExtensionDatabaseMigrationClass, ExtensionDomainInterface, ExtensionDomainRepository, ExtensionSchemaMigrationAfterContext, GeneratedDocumentDomainInterface, GeneratedDocumentDraft, GrantedAction, IDesktopConfig, IExtensionSchemaMigration, IGrantedScope, IRegistryExtension, IResolvedRegistryExtension, IRightRequirement, LoadGeneratedDocumentByDocHash, LogExtensionDomainInterface, LogExtensionDomainRepository, LogExtensionFilter, LogExtensionPaginationOptions, LogExtensionPaginationResult, MainDatabase, MemberRole, NarrowRightScope, PaymentDetails, PendingLocalChange, PlatformBlockchainSettings, PlatformSettings, RegisteredBucket, RequireFields, RightActor, RightFacts, RightGrant, RightOutcome, RightScope, RightSource, RightsCaller, RightsGroup, RightsTable, RolePermission, SchemaMigration, SchemaMigrationClass, SchemaQueryRunner, ScopeCheckInput, ScopeCheckResult, SignedDocumentMetaCompareMode, SignedDocumentMetaVerification, SignedDocumentToVerify, TransactResultWithResponse };
|
package/dist/index.d.mts
CHANGED
|
@@ -5,6 +5,7 @@ import { Observable } from 'rxjs';
|
|
|
5
5
|
import { MongoQuery } from '@casl/ability';
|
|
6
6
|
import { Reflector } from '@nestjs/core';
|
|
7
7
|
import { ZodObject } from 'zod';
|
|
8
|
+
import { IMetaDocument, IGenerate, Registry, IGeneratedDocument, IGenerationOptions } from '@coopenomics/docs-templates';
|
|
8
9
|
import { Cooperative } from 'cooptypes';
|
|
9
10
|
import { Kysely } from 'kysely';
|
|
10
11
|
import { T as TableStore } from './shared/extension-kit.9c3dd9f1.mjs';
|
|
@@ -559,6 +560,19 @@ declare abstract class IPNProvider extends PaymentProvider {
|
|
|
559
560
|
abstract handleIPN(request: any): Promise<void>;
|
|
560
561
|
}
|
|
561
562
|
|
|
563
|
+
/**
|
|
564
|
+
* Текст для банковского поручения: назначение платежа, строка QR-кода оплаты.
|
|
565
|
+
*
|
|
566
|
+
* Банки не принимают букву «ё» в назначении платежа: пайщик копирует
|
|
567
|
+
* назначение в банк, и поручение с «Цифровой Кошелёк» или «аванс под отчёт»
|
|
568
|
+
* отклоняется (владелец 06.11.2026). Буква заменяется на «е» там, где
|
|
569
|
+
* назначение записывается в платёж, заявку на выплату или реквизиты, — один
|
|
570
|
+
* раз и для всех источников: подписи в словарях и тексты интерфейса остаются
|
|
571
|
+
* с «ё», меняется только текст, который передаётся в банк.
|
|
572
|
+
*/
|
|
573
|
+
declare function bankSafeText(text: string): string;
|
|
574
|
+
declare function bankSafeText(text: string | null | undefined): string | null | undefined;
|
|
575
|
+
|
|
562
576
|
/**
|
|
563
577
|
* Объявление хранилища файлов, которое заводит себе расширение.
|
|
564
578
|
*
|
|
@@ -686,7 +700,7 @@ declare enum LangType {
|
|
|
686
700
|
ru = "ru"
|
|
687
701
|
}
|
|
688
702
|
|
|
689
|
-
declare class MetaDocumentInputDTO implements
|
|
703
|
+
declare class MetaDocumentInputDTO implements IMetaDocument {
|
|
690
704
|
title: string;
|
|
691
705
|
registry_id: number;
|
|
692
706
|
lang: LangType;
|
|
@@ -701,7 +715,7 @@ declare class MetaDocumentInputDTO implements Cooperative.Document.IMetaDocument
|
|
|
701
715
|
builder?: string;
|
|
702
716
|
}
|
|
703
717
|
|
|
704
|
-
declare class GenerateMetaDocumentInputDTO implements
|
|
718
|
+
declare class GenerateMetaDocumentInputDTO implements IGenerate {
|
|
705
719
|
title?: string;
|
|
706
720
|
registry_id: number;
|
|
707
721
|
coopname: string;
|
|
@@ -715,9 +729,9 @@ declare class GenerateMetaDocumentInputDTO implements Cooperative.Document.IGene
|
|
|
715
729
|
links?: string[];
|
|
716
730
|
}
|
|
717
731
|
|
|
718
|
-
type Action =
|
|
719
|
-
type ItemAction =
|
|
720
|
-
type HeaderAction =
|
|
732
|
+
type Action = Registry.ExpenseProposalStatement.Action;
|
|
733
|
+
type ItemAction = Registry.ExpenseProposalStatement.IExpenseItem;
|
|
734
|
+
type HeaderAction = Registry.ExpenseProposalStatement.IExpenseProposalHeader;
|
|
721
735
|
/**
|
|
722
736
|
* Позиция-вход генерации СЗ-документа. Приватные поля (имя/реквизиты/назначение)
|
|
723
737
|
* — это вход для фабрики: сервер сохраняет их off-chain в doc_data и публикует
|
|
@@ -1761,7 +1775,76 @@ declare function configurePlatformSettings(value: PlatformSettings): void;
|
|
|
1761
1775
|
*/
|
|
1762
1776
|
declare function platformSettings(): PlatformSettings;
|
|
1763
1777
|
|
|
1764
|
-
|
|
1778
|
+
/**
|
|
1779
|
+
* Шкала времени стенда — общая для всех приложений (решение владельца 01.11.2026).
|
|
1780
|
+
*
|
|
1781
|
+
* В работе сутки и месяцы настоящие. На стенде разработки время сжимают, чтобы
|
|
1782
|
+
* процессы со сроками проходились за минуты: гарантийный срок заказа, списание
|
|
1783
|
+
* обеспечительной части первого числа месяца, сроки курсов «Образования».
|
|
1784
|
+
* Каждое приложение берёт длины из этой шкалы, а не держит свои переменные, — иначе
|
|
1785
|
+
* на одном стенде сутки разной длины в разных приложениях, и процессы,
|
|
1786
|
+
* связанные между собой, расходятся.
|
|
1787
|
+
*
|
|
1788
|
+
* Переменные окружения контроллера:
|
|
1789
|
+
* - `STAND_DAY_SECONDS` — длина суток, секунд (86400 — настоящие);
|
|
1790
|
+
* - `STAND_MONTH_SECONDS` — длина месяца, секунд; 0 — настоящий месяц. Не
|
|
1791
|
+
* задана — при укороченных сутках месяц равен десяти суткам;
|
|
1792
|
+
* - `STAND_WORKER_PACE_SECONDS` — шаг фоновых обходов при сжатом времени,
|
|
1793
|
+
* секунд; не задан — минута.
|
|
1794
|
+
*
|
|
1795
|
+
* `NODE_ENV=production` (боевая и тестовая сеть) — сжатия нет никогда, переменные
|
|
1796
|
+
* не действуют: ошибка в окружении прода не сокращает ничьих сроков.
|
|
1797
|
+
*
|
|
1798
|
+
* Прежние переменные «Образования» (`EDUBRIDGE_GUARANTEE_DAY_SECONDS` и др.)
|
|
1799
|
+
* читает само «Образование» как запасные — ради стендов, где они уже стоят.
|
|
1800
|
+
*/
|
|
1801
|
+
/** Длина суток на стенде, секунд. В работе — всегда настоящие сутки. */
|
|
1802
|
+
declare function standDaySeconds(): number;
|
|
1803
|
+
/** Задана ли шкала стенда явно (хоть одна из переменных). */
|
|
1804
|
+
declare function isStandTimeConfigured(): boolean;
|
|
1805
|
+
/** Длина месяца на стенде, секунд; 0 — настоящий месяц. */
|
|
1806
|
+
declare function standMonthSeconds(): number;
|
|
1807
|
+
/** Время сжато: сутки короче настоящих либо месяц задан длиной. */
|
|
1808
|
+
declare function isStandTimeCompressed(): boolean;
|
|
1809
|
+
/**
|
|
1810
|
+
* Шаг фонового обхода, секунд: в работе — свой шаг приложения, при сжатом
|
|
1811
|
+
* времени — шаг стенда (по умолчанию минута).
|
|
1812
|
+
*/
|
|
1813
|
+
declare function standWorkerPaceSeconds(productionPaceSeconds: number): number;
|
|
1814
|
+
/**
|
|
1815
|
+
* Черёд фонового обхода, который просыпается каждую минуту: в работе — на
|
|
1816
|
+
* каждой минуте, кратной своему шагу (шаг часа — нулевая минута часа), при
|
|
1817
|
+
* сжатом времени — по шагу стенда.
|
|
1818
|
+
*/
|
|
1819
|
+
declare function isStandWorkerTurn(productionPaceSeconds: number, now?: Date): boolean;
|
|
1820
|
+
/**
|
|
1821
|
+
* Номер расчётного периода «месяц», в который попадает момент. В работе —
|
|
1822
|
+
* календарный месяц в часовом поясе кооператива (год × 12 + месяц). При
|
|
1823
|
+
* заданной длине месяца стенда — номер отрезка этой длины от начала эпохи:
|
|
1824
|
+
* «первое число» наступает каждые `STAND_MONTH_SECONDS` секунд.
|
|
1825
|
+
*/
|
|
1826
|
+
declare function standPeriodKey(date: Date, timeZone: string): number;
|
|
1827
|
+
/**
|
|
1828
|
+
* Начало расчётного месяца, следующего за моментом: «первое число», с
|
|
1829
|
+
* которого строка созревает к списанию. В работе — 00:00 первого числа
|
|
1830
|
+
* следующего календарного месяца в часовом поясе кооператива, при заданной
|
|
1831
|
+
* длине месяца стенда — начало следующего отрезка этой длины.
|
|
1832
|
+
*/
|
|
1833
|
+
declare function standNextPeriodStart(date: Date, timeZone: string): Date;
|
|
1834
|
+
/** Строка для журнала при запуске: какая шкала действует. */
|
|
1835
|
+
declare function describeStandTime(): string;
|
|
1836
|
+
|
|
1837
|
+
/**
|
|
1838
|
+
* Календарный день по часовому поясу кооператива. Сроки, которые человек
|
|
1839
|
+
* понимает «до конца дня» (код передачи на пункте выдачи), считаются здесь:
|
|
1840
|
+
* полночь — местная, а не UTC.
|
|
1841
|
+
*/
|
|
1842
|
+
/** Смещение часового пояса от UTC в момент, миллисекунд (Москва — +3 ч). */
|
|
1843
|
+
declare function timeZoneOffsetMs(date: Date, timeZone: string): number;
|
|
1844
|
+
/** Полночь, которой кончается текущий день момента в часовом поясе кооператива. */
|
|
1845
|
+
declare function nextLocalMidnight(date: Date, timeZone: string): Date;
|
|
1846
|
+
|
|
1847
|
+
type GeneratedDocumentDomainInterface = Omit<IGeneratedDocument, 'binary'> & {
|
|
1765
1848
|
binary: string;
|
|
1766
1849
|
};
|
|
1767
1850
|
|
|
@@ -1774,7 +1857,7 @@ declare class GeneratedDocumentDTO implements GeneratedDocumentDomainInterface {
|
|
|
1774
1857
|
constructor(data?: GeneratedDocumentDomainInterface);
|
|
1775
1858
|
}
|
|
1776
1859
|
|
|
1777
|
-
declare class GenerateDocumentOptionsInputDTO implements
|
|
1860
|
+
declare class GenerateDocumentOptionsInputDTO implements IGenerationOptions {
|
|
1778
1861
|
skip_save?: boolean;
|
|
1779
1862
|
lang?: string;
|
|
1780
1863
|
}
|
|
@@ -2364,5 +2447,5 @@ declare function chainRefusalOf(error: unknown): DomainError | null;
|
|
|
2364
2447
|
*/
|
|
2365
2448
|
declare function rethrowChainError(error: unknown): never;
|
|
2366
2449
|
|
|
2367
|
-
export { APP_RIGHTS, ActiveUserStatusGuard, AmountFormatterUtils, AssetUtils, BaseExtensionModule, BucketRegistry, CandidateFilterInputDTO, CandidateOutputDTO, CandidateStatus, CouncilField, CurrencyValidationUtil, CurrentUser, DEFAULT_DOCUMENT_VERSION, DOCUMENT_GENERATION_THROTTLE, DateUtils, DocumentAggregateDTO, DomainError, DomainToBlockchainUtils, EMPTY_HASH, EXTENSION_APP_TERMINATE_EVENT, EXTENSION_REPOSITORY, EXTENSION_SECRET_SET, EXTENSION_SECRET_UNSET, ExpenseProposalStatementGenerateDocumentInputDTO, ExpenseProposalStatementSignedDocumentInputDTO, ExpenseProposalStatementSignedMetaDocumentInputDTO, ExtensionAvailability, ExtensionConfigSuppliedBy, ExtensionDomainEntity, GRANTED_SCOPE_KEY, GenerateDocumentInputDTO, GenerateDocumentOptionsInputDTO, GenerateMetaDocumentInputDTO, GeneratedDocumentDTO, GetLedger2HistoryInputDTO, GetLedger2PostingsInputDTO, GqlJwtAuthGuard, GrantedScope, HttpApiError, HttpJwtAuthGuard, IPNProvider, InjectBucket, KYSELY, LOG_EXTENSION_REPOSITORY, LangType, Ledger2AccountDTO, Ledger2HistoryResponseDTO, Ledger2OperationDTO, Ledger2PostingDTO, Ledger2PostingsResponseDTO, Ledger2WalletDTO, LogExtensionDomainEntity, MAIN_DATABASE, MetaDocumentInputDTO, ONBOARDING_EXPIRY_DAYS, ONBOARDING_EXPIRY_MS, OptionalCurrentUser, OptionalGqlJwtAuthGuard, PaginatedProcessSummary, PaginationInputDTO, PaginationResult, PaginationUtils, PaymentProvider, PollingProvider, ProcessActionDTO, ProcessDeltaDTO, ProcessDocumentDTO, ProcessDocumentSourceDTO, ProcessSummaryDTO, ProcessViewDTO, ProcessesFilterInput, QuantityUtils, RIGHT_METADATA_KEY, RequireRight, RightsGuard, SCOPE_DENIALS, SELF, SORT_FIELD_PATTERN, SafeMarkup, SignatureInfoDTO, SignatureInfoInputDTO, SignedDigitalDocumentDTO, SignedDigitalDocumentInputDTO, TableStore, TransactionDTO, UseBucket, affectedCount, attachOne, bucketProvidersFor, bucketTokenFor, buildPaginationResult, camelRow, chainErrorCode, chainRefusalOf, chainTextDigest, checkPaymentAmount, checkPaymentSymbol, checkRight, checkRightScope, computeOnboardingExpiresAt, configureExtensionAuth, configureLocalChangePublisher, configurePlatformSettings, councilRolesOf, createPaginationResult, describeConfigField, desktopGrants, desktopGrantsOf, domainErrorMessage, expandRights, extensionDatabaseMigrations, generateHashFromString, generateRandomHash, generateUniqueHash, getAmountPlusFee, getAppliedBlockNum, hasServerSecret, inTransaction, isChainTextDigest, isChainTextOf, isExtensionAvailable, memberRolesOf, mergeSecretConfig, paginationInputToOffset, parseChainAssert, pendingLocalChanges, pickDefined, platformSettings, providerSuppliedPaths, rawQuery, redactSecretConfig, registerExtensionDatabaseMigrations, resetExtensionDatabaseMigrations, resolveChainText, rethrowChainError, rightConditions, rightGrants, rightMatches, rightsByRole, rightsHeld, sanitizeUserText, scopeConditions, scopeOfRight, scopesMatched, snakeRow, sortColumn, sortDirection, validationMessage, verifySignedDocumentAgainstStoredDraft, waitForEvent };
|
|
2450
|
+
export { APP_RIGHTS, ActiveUserStatusGuard, AmountFormatterUtils, AssetUtils, BaseExtensionModule, BucketRegistry, CandidateFilterInputDTO, CandidateOutputDTO, CandidateStatus, CouncilField, CurrencyValidationUtil, CurrentUser, DEFAULT_DOCUMENT_VERSION, DOCUMENT_GENERATION_THROTTLE, DateUtils, DocumentAggregateDTO, DomainError, DomainToBlockchainUtils, EMPTY_HASH, EXTENSION_APP_TERMINATE_EVENT, EXTENSION_REPOSITORY, EXTENSION_SECRET_SET, EXTENSION_SECRET_UNSET, ExpenseProposalStatementGenerateDocumentInputDTO, ExpenseProposalStatementSignedDocumentInputDTO, ExpenseProposalStatementSignedMetaDocumentInputDTO, ExtensionAvailability, ExtensionConfigSuppliedBy, ExtensionDomainEntity, GRANTED_SCOPE_KEY, GenerateDocumentInputDTO, GenerateDocumentOptionsInputDTO, GenerateMetaDocumentInputDTO, GeneratedDocumentDTO, GetLedger2HistoryInputDTO, GetLedger2PostingsInputDTO, GqlJwtAuthGuard, GrantedScope, HttpApiError, HttpJwtAuthGuard, IPNProvider, InjectBucket, KYSELY, LOG_EXTENSION_REPOSITORY, LangType, Ledger2AccountDTO, Ledger2HistoryResponseDTO, Ledger2OperationDTO, Ledger2PostingDTO, Ledger2PostingsResponseDTO, Ledger2WalletDTO, LogExtensionDomainEntity, MAIN_DATABASE, MetaDocumentInputDTO, ONBOARDING_EXPIRY_DAYS, ONBOARDING_EXPIRY_MS, OptionalCurrentUser, OptionalGqlJwtAuthGuard, PaginatedProcessSummary, PaginationInputDTO, PaginationResult, PaginationUtils, PaymentProvider, PollingProvider, ProcessActionDTO, ProcessDeltaDTO, ProcessDocumentDTO, ProcessDocumentSourceDTO, ProcessSummaryDTO, ProcessViewDTO, ProcessesFilterInput, QuantityUtils, RIGHT_METADATA_KEY, RequireRight, RightsGuard, SCOPE_DENIALS, SELF, SORT_FIELD_PATTERN, SafeMarkup, SignatureInfoDTO, SignatureInfoInputDTO, SignedDigitalDocumentDTO, SignedDigitalDocumentInputDTO, TableStore, TransactionDTO, UseBucket, affectedCount, attachOne, bankSafeText, bucketProvidersFor, bucketTokenFor, buildPaginationResult, camelRow, chainErrorCode, chainRefusalOf, chainTextDigest, checkPaymentAmount, checkPaymentSymbol, checkRight, checkRightScope, computeOnboardingExpiresAt, configureExtensionAuth, configureLocalChangePublisher, configurePlatformSettings, councilRolesOf, createPaginationResult, describeConfigField, describeStandTime, desktopGrants, desktopGrantsOf, domainErrorMessage, expandRights, extensionDatabaseMigrations, generateHashFromString, generateRandomHash, generateUniqueHash, getAmountPlusFee, getAppliedBlockNum, hasServerSecret, inTransaction, isChainTextDigest, isChainTextOf, isExtensionAvailable, isStandTimeCompressed, isStandTimeConfigured, isStandWorkerTurn, memberRolesOf, mergeSecretConfig, nextLocalMidnight, paginationInputToOffset, parseChainAssert, pendingLocalChanges, pickDefined, platformSettings, providerSuppliedPaths, rawQuery, redactSecretConfig, registerExtensionDatabaseMigrations, resetExtensionDatabaseMigrations, resolveChainText, rethrowChainError, rightConditions, rightGrants, rightMatches, rightsByRole, rightsHeld, sanitizeUserText, scopeConditions, scopeOfRight, scopesMatched, snakeRow, sortColumn, sortDirection, standDaySeconds, standMonthSeconds, standNextPeriodStart, standPeriodKey, standWorkerPaceSeconds, timeZoneOffsetMs, validationMessage, verifySignedDocumentAgainstStoredDraft, waitForEvent };
|
|
2368
2451
|
export type { AppRights, AssignableRole, AttachedRole, BucketSource, BucketSpec, CouncilRole, DeserializedDescriptionOfExtension, DesktopGrantsRequest, DomainErrorParams, EventSource, EventWait, ExcludeCommonProps, ExtensionAppTerminatePayload, ExtensionAuthOptions, ExtensionConfigFieldPolicy, ExtensionConfigPolicy, ExtensionDatabaseMigrationClass, ExtensionDomainInterface, ExtensionDomainRepository, ExtensionSchemaMigrationAfterContext, GeneratedDocumentDomainInterface, GeneratedDocumentDraft, GrantedAction, IDesktopConfig, IExtensionSchemaMigration, IGrantedScope, IRegistryExtension, IResolvedRegistryExtension, IRightRequirement, LoadGeneratedDocumentByDocHash, LogExtensionDomainInterface, LogExtensionDomainRepository, LogExtensionFilter, LogExtensionPaginationOptions, LogExtensionPaginationResult, MainDatabase, MemberRole, NarrowRightScope, PaymentDetails, PendingLocalChange, PlatformBlockchainSettings, PlatformSettings, RegisteredBucket, RequireFields, RightActor, RightFacts, RightGrant, RightOutcome, RightScope, RightSource, RightsCaller, RightsGroup, RightsTable, RolePermission, SchemaMigration, SchemaMigrationClass, SchemaQueryRunner, ScopeCheckInput, ScopeCheckResult, SignedDocumentMetaCompareMode, SignedDocumentMetaVerification, SignedDocumentToVerify, TransactResultWithResponse };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { Observable } from 'rxjs';
|
|
|
5
5
|
import { MongoQuery } from '@casl/ability';
|
|
6
6
|
import { Reflector } from '@nestjs/core';
|
|
7
7
|
import { ZodObject } from 'zod';
|
|
8
|
+
import { IMetaDocument, IGenerate, Registry, IGeneratedDocument, IGenerationOptions } from '@coopenomics/docs-templates';
|
|
8
9
|
import { Cooperative } from 'cooptypes';
|
|
9
10
|
import { Kysely } from 'kysely';
|
|
10
11
|
import { T as TableStore } from './shared/extension-kit.9c3dd9f1.js';
|
|
@@ -559,6 +560,19 @@ declare abstract class IPNProvider extends PaymentProvider {
|
|
|
559
560
|
abstract handleIPN(request: any): Promise<void>;
|
|
560
561
|
}
|
|
561
562
|
|
|
563
|
+
/**
|
|
564
|
+
* Текст для банковского поручения: назначение платежа, строка QR-кода оплаты.
|
|
565
|
+
*
|
|
566
|
+
* Банки не принимают букву «ё» в назначении платежа: пайщик копирует
|
|
567
|
+
* назначение в банк, и поручение с «Цифровой Кошелёк» или «аванс под отчёт»
|
|
568
|
+
* отклоняется (владелец 06.11.2026). Буква заменяется на «е» там, где
|
|
569
|
+
* назначение записывается в платёж, заявку на выплату или реквизиты, — один
|
|
570
|
+
* раз и для всех источников: подписи в словарях и тексты интерфейса остаются
|
|
571
|
+
* с «ё», меняется только текст, который передаётся в банк.
|
|
572
|
+
*/
|
|
573
|
+
declare function bankSafeText(text: string): string;
|
|
574
|
+
declare function bankSafeText(text: string | null | undefined): string | null | undefined;
|
|
575
|
+
|
|
562
576
|
/**
|
|
563
577
|
* Объявление хранилища файлов, которое заводит себе расширение.
|
|
564
578
|
*
|
|
@@ -686,7 +700,7 @@ declare enum LangType {
|
|
|
686
700
|
ru = "ru"
|
|
687
701
|
}
|
|
688
702
|
|
|
689
|
-
declare class MetaDocumentInputDTO implements
|
|
703
|
+
declare class MetaDocumentInputDTO implements IMetaDocument {
|
|
690
704
|
title: string;
|
|
691
705
|
registry_id: number;
|
|
692
706
|
lang: LangType;
|
|
@@ -701,7 +715,7 @@ declare class MetaDocumentInputDTO implements Cooperative.Document.IMetaDocument
|
|
|
701
715
|
builder?: string;
|
|
702
716
|
}
|
|
703
717
|
|
|
704
|
-
declare class GenerateMetaDocumentInputDTO implements
|
|
718
|
+
declare class GenerateMetaDocumentInputDTO implements IGenerate {
|
|
705
719
|
title?: string;
|
|
706
720
|
registry_id: number;
|
|
707
721
|
coopname: string;
|
|
@@ -715,9 +729,9 @@ declare class GenerateMetaDocumentInputDTO implements Cooperative.Document.IGene
|
|
|
715
729
|
links?: string[];
|
|
716
730
|
}
|
|
717
731
|
|
|
718
|
-
type Action =
|
|
719
|
-
type ItemAction =
|
|
720
|
-
type HeaderAction =
|
|
732
|
+
type Action = Registry.ExpenseProposalStatement.Action;
|
|
733
|
+
type ItemAction = Registry.ExpenseProposalStatement.IExpenseItem;
|
|
734
|
+
type HeaderAction = Registry.ExpenseProposalStatement.IExpenseProposalHeader;
|
|
721
735
|
/**
|
|
722
736
|
* Позиция-вход генерации СЗ-документа. Приватные поля (имя/реквизиты/назначение)
|
|
723
737
|
* — это вход для фабрики: сервер сохраняет их off-chain в doc_data и публикует
|
|
@@ -1761,7 +1775,76 @@ declare function configurePlatformSettings(value: PlatformSettings): void;
|
|
|
1761
1775
|
*/
|
|
1762
1776
|
declare function platformSettings(): PlatformSettings;
|
|
1763
1777
|
|
|
1764
|
-
|
|
1778
|
+
/**
|
|
1779
|
+
* Шкала времени стенда — общая для всех приложений (решение владельца 01.11.2026).
|
|
1780
|
+
*
|
|
1781
|
+
* В работе сутки и месяцы настоящие. На стенде разработки время сжимают, чтобы
|
|
1782
|
+
* процессы со сроками проходились за минуты: гарантийный срок заказа, списание
|
|
1783
|
+
* обеспечительной части первого числа месяца, сроки курсов «Образования».
|
|
1784
|
+
* Каждое приложение берёт длины из этой шкалы, а не держит свои переменные, — иначе
|
|
1785
|
+
* на одном стенде сутки разной длины в разных приложениях, и процессы,
|
|
1786
|
+
* связанные между собой, расходятся.
|
|
1787
|
+
*
|
|
1788
|
+
* Переменные окружения контроллера:
|
|
1789
|
+
* - `STAND_DAY_SECONDS` — длина суток, секунд (86400 — настоящие);
|
|
1790
|
+
* - `STAND_MONTH_SECONDS` — длина месяца, секунд; 0 — настоящий месяц. Не
|
|
1791
|
+
* задана — при укороченных сутках месяц равен десяти суткам;
|
|
1792
|
+
* - `STAND_WORKER_PACE_SECONDS` — шаг фоновых обходов при сжатом времени,
|
|
1793
|
+
* секунд; не задан — минута.
|
|
1794
|
+
*
|
|
1795
|
+
* `NODE_ENV=production` (боевая и тестовая сеть) — сжатия нет никогда, переменные
|
|
1796
|
+
* не действуют: ошибка в окружении прода не сокращает ничьих сроков.
|
|
1797
|
+
*
|
|
1798
|
+
* Прежние переменные «Образования» (`EDUBRIDGE_GUARANTEE_DAY_SECONDS` и др.)
|
|
1799
|
+
* читает само «Образование» как запасные — ради стендов, где они уже стоят.
|
|
1800
|
+
*/
|
|
1801
|
+
/** Длина суток на стенде, секунд. В работе — всегда настоящие сутки. */
|
|
1802
|
+
declare function standDaySeconds(): number;
|
|
1803
|
+
/** Задана ли шкала стенда явно (хоть одна из переменных). */
|
|
1804
|
+
declare function isStandTimeConfigured(): boolean;
|
|
1805
|
+
/** Длина месяца на стенде, секунд; 0 — настоящий месяц. */
|
|
1806
|
+
declare function standMonthSeconds(): number;
|
|
1807
|
+
/** Время сжато: сутки короче настоящих либо месяц задан длиной. */
|
|
1808
|
+
declare function isStandTimeCompressed(): boolean;
|
|
1809
|
+
/**
|
|
1810
|
+
* Шаг фонового обхода, секунд: в работе — свой шаг приложения, при сжатом
|
|
1811
|
+
* времени — шаг стенда (по умолчанию минута).
|
|
1812
|
+
*/
|
|
1813
|
+
declare function standWorkerPaceSeconds(productionPaceSeconds: number): number;
|
|
1814
|
+
/**
|
|
1815
|
+
* Черёд фонового обхода, который просыпается каждую минуту: в работе — на
|
|
1816
|
+
* каждой минуте, кратной своему шагу (шаг часа — нулевая минута часа), при
|
|
1817
|
+
* сжатом времени — по шагу стенда.
|
|
1818
|
+
*/
|
|
1819
|
+
declare function isStandWorkerTurn(productionPaceSeconds: number, now?: Date): boolean;
|
|
1820
|
+
/**
|
|
1821
|
+
* Номер расчётного периода «месяц», в который попадает момент. В работе —
|
|
1822
|
+
* календарный месяц в часовом поясе кооператива (год × 12 + месяц). При
|
|
1823
|
+
* заданной длине месяца стенда — номер отрезка этой длины от начала эпохи:
|
|
1824
|
+
* «первое число» наступает каждые `STAND_MONTH_SECONDS` секунд.
|
|
1825
|
+
*/
|
|
1826
|
+
declare function standPeriodKey(date: Date, timeZone: string): number;
|
|
1827
|
+
/**
|
|
1828
|
+
* Начало расчётного месяца, следующего за моментом: «первое число», с
|
|
1829
|
+
* которого строка созревает к списанию. В работе — 00:00 первого числа
|
|
1830
|
+
* следующего календарного месяца в часовом поясе кооператива, при заданной
|
|
1831
|
+
* длине месяца стенда — начало следующего отрезка этой длины.
|
|
1832
|
+
*/
|
|
1833
|
+
declare function standNextPeriodStart(date: Date, timeZone: string): Date;
|
|
1834
|
+
/** Строка для журнала при запуске: какая шкала действует. */
|
|
1835
|
+
declare function describeStandTime(): string;
|
|
1836
|
+
|
|
1837
|
+
/**
|
|
1838
|
+
* Календарный день по часовому поясу кооператива. Сроки, которые человек
|
|
1839
|
+
* понимает «до конца дня» (код передачи на пункте выдачи), считаются здесь:
|
|
1840
|
+
* полночь — местная, а не UTC.
|
|
1841
|
+
*/
|
|
1842
|
+
/** Смещение часового пояса от UTC в момент, миллисекунд (Москва — +3 ч). */
|
|
1843
|
+
declare function timeZoneOffsetMs(date: Date, timeZone: string): number;
|
|
1844
|
+
/** Полночь, которой кончается текущий день момента в часовом поясе кооператива. */
|
|
1845
|
+
declare function nextLocalMidnight(date: Date, timeZone: string): Date;
|
|
1846
|
+
|
|
1847
|
+
type GeneratedDocumentDomainInterface = Omit<IGeneratedDocument, 'binary'> & {
|
|
1765
1848
|
binary: string;
|
|
1766
1849
|
};
|
|
1767
1850
|
|
|
@@ -1774,7 +1857,7 @@ declare class GeneratedDocumentDTO implements GeneratedDocumentDomainInterface {
|
|
|
1774
1857
|
constructor(data?: GeneratedDocumentDomainInterface);
|
|
1775
1858
|
}
|
|
1776
1859
|
|
|
1777
|
-
declare class GenerateDocumentOptionsInputDTO implements
|
|
1860
|
+
declare class GenerateDocumentOptionsInputDTO implements IGenerationOptions {
|
|
1778
1861
|
skip_save?: boolean;
|
|
1779
1862
|
lang?: string;
|
|
1780
1863
|
}
|
|
@@ -2364,5 +2447,5 @@ declare function chainRefusalOf(error: unknown): DomainError | null;
|
|
|
2364
2447
|
*/
|
|
2365
2448
|
declare function rethrowChainError(error: unknown): never;
|
|
2366
2449
|
|
|
2367
|
-
export { APP_RIGHTS, ActiveUserStatusGuard, AmountFormatterUtils, AssetUtils, BaseExtensionModule, BucketRegistry, CandidateFilterInputDTO, CandidateOutputDTO, CandidateStatus, CouncilField, CurrencyValidationUtil, CurrentUser, DEFAULT_DOCUMENT_VERSION, DOCUMENT_GENERATION_THROTTLE, DateUtils, DocumentAggregateDTO, DomainError, DomainToBlockchainUtils, EMPTY_HASH, EXTENSION_APP_TERMINATE_EVENT, EXTENSION_REPOSITORY, EXTENSION_SECRET_SET, EXTENSION_SECRET_UNSET, ExpenseProposalStatementGenerateDocumentInputDTO, ExpenseProposalStatementSignedDocumentInputDTO, ExpenseProposalStatementSignedMetaDocumentInputDTO, ExtensionAvailability, ExtensionConfigSuppliedBy, ExtensionDomainEntity, GRANTED_SCOPE_KEY, GenerateDocumentInputDTO, GenerateDocumentOptionsInputDTO, GenerateMetaDocumentInputDTO, GeneratedDocumentDTO, GetLedger2HistoryInputDTO, GetLedger2PostingsInputDTO, GqlJwtAuthGuard, GrantedScope, HttpApiError, HttpJwtAuthGuard, IPNProvider, InjectBucket, KYSELY, LOG_EXTENSION_REPOSITORY, LangType, Ledger2AccountDTO, Ledger2HistoryResponseDTO, Ledger2OperationDTO, Ledger2PostingDTO, Ledger2PostingsResponseDTO, Ledger2WalletDTO, LogExtensionDomainEntity, MAIN_DATABASE, MetaDocumentInputDTO, ONBOARDING_EXPIRY_DAYS, ONBOARDING_EXPIRY_MS, OptionalCurrentUser, OptionalGqlJwtAuthGuard, PaginatedProcessSummary, PaginationInputDTO, PaginationResult, PaginationUtils, PaymentProvider, PollingProvider, ProcessActionDTO, ProcessDeltaDTO, ProcessDocumentDTO, ProcessDocumentSourceDTO, ProcessSummaryDTO, ProcessViewDTO, ProcessesFilterInput, QuantityUtils, RIGHT_METADATA_KEY, RequireRight, RightsGuard, SCOPE_DENIALS, SELF, SORT_FIELD_PATTERN, SafeMarkup, SignatureInfoDTO, SignatureInfoInputDTO, SignedDigitalDocumentDTO, SignedDigitalDocumentInputDTO, TableStore, TransactionDTO, UseBucket, affectedCount, attachOne, bucketProvidersFor, bucketTokenFor, buildPaginationResult, camelRow, chainErrorCode, chainRefusalOf, chainTextDigest, checkPaymentAmount, checkPaymentSymbol, checkRight, checkRightScope, computeOnboardingExpiresAt, configureExtensionAuth, configureLocalChangePublisher, configurePlatformSettings, councilRolesOf, createPaginationResult, describeConfigField, desktopGrants, desktopGrantsOf, domainErrorMessage, expandRights, extensionDatabaseMigrations, generateHashFromString, generateRandomHash, generateUniqueHash, getAmountPlusFee, getAppliedBlockNum, hasServerSecret, inTransaction, isChainTextDigest, isChainTextOf, isExtensionAvailable, memberRolesOf, mergeSecretConfig, paginationInputToOffset, parseChainAssert, pendingLocalChanges, pickDefined, platformSettings, providerSuppliedPaths, rawQuery, redactSecretConfig, registerExtensionDatabaseMigrations, resetExtensionDatabaseMigrations, resolveChainText, rethrowChainError, rightConditions, rightGrants, rightMatches, rightsByRole, rightsHeld, sanitizeUserText, scopeConditions, scopeOfRight, scopesMatched, snakeRow, sortColumn, sortDirection, validationMessage, verifySignedDocumentAgainstStoredDraft, waitForEvent };
|
|
2450
|
+
export { APP_RIGHTS, ActiveUserStatusGuard, AmountFormatterUtils, AssetUtils, BaseExtensionModule, BucketRegistry, CandidateFilterInputDTO, CandidateOutputDTO, CandidateStatus, CouncilField, CurrencyValidationUtil, CurrentUser, DEFAULT_DOCUMENT_VERSION, DOCUMENT_GENERATION_THROTTLE, DateUtils, DocumentAggregateDTO, DomainError, DomainToBlockchainUtils, EMPTY_HASH, EXTENSION_APP_TERMINATE_EVENT, EXTENSION_REPOSITORY, EXTENSION_SECRET_SET, EXTENSION_SECRET_UNSET, ExpenseProposalStatementGenerateDocumentInputDTO, ExpenseProposalStatementSignedDocumentInputDTO, ExpenseProposalStatementSignedMetaDocumentInputDTO, ExtensionAvailability, ExtensionConfigSuppliedBy, ExtensionDomainEntity, GRANTED_SCOPE_KEY, GenerateDocumentInputDTO, GenerateDocumentOptionsInputDTO, GenerateMetaDocumentInputDTO, GeneratedDocumentDTO, GetLedger2HistoryInputDTO, GetLedger2PostingsInputDTO, GqlJwtAuthGuard, GrantedScope, HttpApiError, HttpJwtAuthGuard, IPNProvider, InjectBucket, KYSELY, LOG_EXTENSION_REPOSITORY, LangType, Ledger2AccountDTO, Ledger2HistoryResponseDTO, Ledger2OperationDTO, Ledger2PostingDTO, Ledger2PostingsResponseDTO, Ledger2WalletDTO, LogExtensionDomainEntity, MAIN_DATABASE, MetaDocumentInputDTO, ONBOARDING_EXPIRY_DAYS, ONBOARDING_EXPIRY_MS, OptionalCurrentUser, OptionalGqlJwtAuthGuard, PaginatedProcessSummary, PaginationInputDTO, PaginationResult, PaginationUtils, PaymentProvider, PollingProvider, ProcessActionDTO, ProcessDeltaDTO, ProcessDocumentDTO, ProcessDocumentSourceDTO, ProcessSummaryDTO, ProcessViewDTO, ProcessesFilterInput, QuantityUtils, RIGHT_METADATA_KEY, RequireRight, RightsGuard, SCOPE_DENIALS, SELF, SORT_FIELD_PATTERN, SafeMarkup, SignatureInfoDTO, SignatureInfoInputDTO, SignedDigitalDocumentDTO, SignedDigitalDocumentInputDTO, TableStore, TransactionDTO, UseBucket, affectedCount, attachOne, bankSafeText, bucketProvidersFor, bucketTokenFor, buildPaginationResult, camelRow, chainErrorCode, chainRefusalOf, chainTextDigest, checkPaymentAmount, checkPaymentSymbol, checkRight, checkRightScope, computeOnboardingExpiresAt, configureExtensionAuth, configureLocalChangePublisher, configurePlatformSettings, councilRolesOf, createPaginationResult, describeConfigField, describeStandTime, desktopGrants, desktopGrantsOf, domainErrorMessage, expandRights, extensionDatabaseMigrations, generateHashFromString, generateRandomHash, generateUniqueHash, getAmountPlusFee, getAppliedBlockNum, hasServerSecret, inTransaction, isChainTextDigest, isChainTextOf, isExtensionAvailable, isStandTimeCompressed, isStandTimeConfigured, isStandWorkerTurn, memberRolesOf, mergeSecretConfig, nextLocalMidnight, paginationInputToOffset, parseChainAssert, pendingLocalChanges, pickDefined, platformSettings, providerSuppliedPaths, rawQuery, redactSecretConfig, registerExtensionDatabaseMigrations, resetExtensionDatabaseMigrations, resolveChainText, rethrowChainError, rightConditions, rightGrants, rightMatches, rightsByRole, rightsHeld, sanitizeUserText, scopeConditions, scopeOfRight, scopesMatched, snakeRow, sortColumn, sortDirection, standDaySeconds, standMonthSeconds, standNextPeriodStart, standPeriodKey, standWorkerPaceSeconds, timeZoneOffsetMs, validationMessage, verifySignedDocumentAgainstStoredDraft, waitForEvent };
|
|
2368
2451
|
export type { AppRights, AssignableRole, AttachedRole, BucketSource, BucketSpec, CouncilRole, DeserializedDescriptionOfExtension, DesktopGrantsRequest, DomainErrorParams, EventSource, EventWait, ExcludeCommonProps, ExtensionAppTerminatePayload, ExtensionAuthOptions, ExtensionConfigFieldPolicy, ExtensionConfigPolicy, ExtensionDatabaseMigrationClass, ExtensionDomainInterface, ExtensionDomainRepository, ExtensionSchemaMigrationAfterContext, GeneratedDocumentDomainInterface, GeneratedDocumentDraft, GrantedAction, IDesktopConfig, IExtensionSchemaMigration, IGrantedScope, IRegistryExtension, IResolvedRegistryExtension, IRightRequirement, LoadGeneratedDocumentByDocHash, LogExtensionDomainInterface, LogExtensionDomainRepository, LogExtensionFilter, LogExtensionPaginationOptions, LogExtensionPaginationResult, MainDatabase, MemberRole, NarrowRightScope, PaymentDetails, PendingLocalChange, PlatformBlockchainSettings, PlatformSettings, RegisteredBucket, RequireFields, RightActor, RightFacts, RightGrant, RightOutcome, RightScope, RightSource, RightsCaller, RightsGroup, RightsTable, RolePermission, SchemaMigration, SchemaMigrationClass, SchemaQueryRunner, ScopeCheckInput, ScopeCheckResult, SignedDocumentMetaCompareMode, SignedDocumentMetaVerification, SignedDocumentToVerify, TransactResultWithResponse };
|
package/dist/index.mjs
CHANGED
|
@@ -710,6 +710,12 @@ IPNProvider = __decorateClass$n([
|
|
|
710
710
|
Injectable()
|
|
711
711
|
], IPNProvider);
|
|
712
712
|
|
|
713
|
+
function bankSafeText(text) {
|
|
714
|
+
if (text == null)
|
|
715
|
+
return text;
|
|
716
|
+
return text.replace(/ё/g, "\u0435").replace(/Ё/g, "\u0415");
|
|
717
|
+
}
|
|
718
|
+
|
|
713
719
|
const REGISTERED = /* @__PURE__ */ new Map();
|
|
714
720
|
const BucketRegistry = {
|
|
715
721
|
add(cls, spec) {
|
|
@@ -2299,6 +2305,103 @@ function platformSettings() {
|
|
|
2299
2305
|
return settings;
|
|
2300
2306
|
}
|
|
2301
2307
|
|
|
2308
|
+
function timeZoneOffsetMs(date, timeZone) {
|
|
2309
|
+
const parts = new Intl.DateTimeFormat("en-US", {
|
|
2310
|
+
timeZone,
|
|
2311
|
+
hourCycle: "h23",
|
|
2312
|
+
year: "numeric",
|
|
2313
|
+
month: "2-digit",
|
|
2314
|
+
day: "2-digit",
|
|
2315
|
+
hour: "2-digit",
|
|
2316
|
+
minute: "2-digit",
|
|
2317
|
+
second: "2-digit"
|
|
2318
|
+
}).formatToParts(date);
|
|
2319
|
+
const get = (type) => Number(parts.find((p) => p.type === type)?.value ?? 0);
|
|
2320
|
+
const asUtc = Date.UTC(get("year"), get("month") - 1, get("day"), get("hour"), get("minute"), get("second"));
|
|
2321
|
+
return asUtc - Math.floor(date.getTime() / 1e3) * 1e3;
|
|
2322
|
+
}
|
|
2323
|
+
function nextLocalMidnight(date, timeZone) {
|
|
2324
|
+
const parts = new Intl.DateTimeFormat("en-US", { timeZone, year: "numeric", month: "2-digit", day: "2-digit" }).formatToParts(date);
|
|
2325
|
+
const get = (type) => Number(parts.find((p) => p.type === type)?.value ?? 0);
|
|
2326
|
+
const utcMidnight = Date.UTC(get("year"), get("month") - 1, get("day") + 1);
|
|
2327
|
+
return new Date(utcMidnight - timeZoneOffsetMs(new Date(utcMidnight), timeZone));
|
|
2328
|
+
}
|
|
2329
|
+
|
|
2330
|
+
const SECONDS_IN_DAY = 24 * 60 * 60;
|
|
2331
|
+
const DAYS_IN_COMPRESSED_MONTH = 10;
|
|
2332
|
+
const COMPRESSED_WORKER_PACE_SECONDS = 60;
|
|
2333
|
+
function inProduction() {
|
|
2334
|
+
return process.env.NODE_ENV === "production";
|
|
2335
|
+
}
|
|
2336
|
+
function envSeconds(name, allowZero) {
|
|
2337
|
+
const raw = process.env[name];
|
|
2338
|
+
if (raw === void 0 || raw.trim() === "")
|
|
2339
|
+
return null;
|
|
2340
|
+
const value = Number(raw);
|
|
2341
|
+
if (!Number.isFinite(value))
|
|
2342
|
+
return null;
|
|
2343
|
+
if (allowZero ? value < 0 : value <= 0)
|
|
2344
|
+
return null;
|
|
2345
|
+
return Math.floor(value);
|
|
2346
|
+
}
|
|
2347
|
+
function standDaySeconds() {
|
|
2348
|
+
if (inProduction())
|
|
2349
|
+
return SECONDS_IN_DAY;
|
|
2350
|
+
return envSeconds("STAND_DAY_SECONDS", false) ?? SECONDS_IN_DAY;
|
|
2351
|
+
}
|
|
2352
|
+
function isStandTimeConfigured() {
|
|
2353
|
+
if (inProduction())
|
|
2354
|
+
return false;
|
|
2355
|
+
return envSeconds("STAND_DAY_SECONDS", false) !== null || envSeconds("STAND_MONTH_SECONDS", true) !== null || envSeconds("STAND_WORKER_PACE_SECONDS", false) !== null;
|
|
2356
|
+
}
|
|
2357
|
+
function standMonthSeconds() {
|
|
2358
|
+
if (inProduction())
|
|
2359
|
+
return 0;
|
|
2360
|
+
const custom = envSeconds("STAND_MONTH_SECONDS", true);
|
|
2361
|
+
if (custom !== null)
|
|
2362
|
+
return custom;
|
|
2363
|
+
return standDaySeconds() !== SECONDS_IN_DAY ? DAYS_IN_COMPRESSED_MONTH * standDaySeconds() : 0;
|
|
2364
|
+
}
|
|
2365
|
+
function isStandTimeCompressed() {
|
|
2366
|
+
return standDaySeconds() !== SECONDS_IN_DAY || standMonthSeconds() > 0;
|
|
2367
|
+
}
|
|
2368
|
+
function standWorkerPaceSeconds(productionPaceSeconds) {
|
|
2369
|
+
if (!isStandTimeCompressed())
|
|
2370
|
+
return productionPaceSeconds;
|
|
2371
|
+
return envSeconds("STAND_WORKER_PACE_SECONDS", false) ?? COMPRESSED_WORKER_PACE_SECONDS;
|
|
2372
|
+
}
|
|
2373
|
+
function isStandWorkerTurn(productionPaceSeconds, now = /* @__PURE__ */ new Date()) {
|
|
2374
|
+
const paceMinutes = Math.max(1, Math.round(standWorkerPaceSeconds(productionPaceSeconds) / 60));
|
|
2375
|
+
const minutes = Math.floor(now.getTime() / 6e4);
|
|
2376
|
+
return minutes % paceMinutes === 0;
|
|
2377
|
+
}
|
|
2378
|
+
function standPeriodKey(date, timeZone) {
|
|
2379
|
+
const monthSeconds = standMonthSeconds();
|
|
2380
|
+
if (monthSeconds > 0)
|
|
2381
|
+
return Math.floor(date.getTime() / 1e3 / monthSeconds);
|
|
2382
|
+
const parts = new Intl.DateTimeFormat("en-US", { timeZone, year: "numeric", month: "2-digit" }).formatToParts(date);
|
|
2383
|
+
const year = Number(parts.find((p) => p.type === "year")?.value ?? 0);
|
|
2384
|
+
const month = Number(parts.find((p) => p.type === "month")?.value ?? 0);
|
|
2385
|
+
return year * 12 + month;
|
|
2386
|
+
}
|
|
2387
|
+
function standNextPeriodStart(date, timeZone) {
|
|
2388
|
+
const monthSeconds = standMonthSeconds();
|
|
2389
|
+
if (monthSeconds > 0) {
|
|
2390
|
+
return new Date((Math.floor(date.getTime() / 1e3 / monthSeconds) + 1) * monthSeconds * 1e3);
|
|
2391
|
+
}
|
|
2392
|
+
const parts = new Intl.DateTimeFormat("en-US", { timeZone, year: "numeric", month: "2-digit" }).formatToParts(date);
|
|
2393
|
+
const year = Number(parts.find((p) => p.type === "year")?.value ?? 0);
|
|
2394
|
+
const month = Number(parts.find((p) => p.type === "month")?.value ?? 1);
|
|
2395
|
+
const utcMidnight = Date.UTC(month === 12 ? year + 1 : year, month === 12 ? 0 : month, 1);
|
|
2396
|
+
return new Date(utcMidnight - timeZoneOffsetMs(new Date(utcMidnight), timeZone));
|
|
2397
|
+
}
|
|
2398
|
+
function describeStandTime() {
|
|
2399
|
+
if (!isStandTimeCompressed())
|
|
2400
|
+
return "\u0432\u0440\u0435\u043C\u044F \u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0435\u0435";
|
|
2401
|
+
const month = standMonthSeconds();
|
|
2402
|
+
return `\u0432\u0440\u0435\u043C\u044F \u0441\u0442\u0435\u043D\u0434\u0430 \u0441\u0436\u0430\u0442\u043E: \u0441\u0443\u0442\u043A\u0438 ${standDaySeconds()} \u0441, \u043C\u0435\u0441\u044F\u0446 ${month > 0 ? `${month} \u0441` : "\u043D\u0430\u0441\u0442\u043E\u044F\u0449\u0438\u0439"}, \u0448\u0430\u0433 \u043E\u0431\u0445\u043E\u0434\u043E\u0432 ${standWorkerPaceSeconds(0)} \u0441`;
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2302
2405
|
var __defProp$5 = Object.defineProperty;
|
|
2303
2406
|
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
2304
2407
|
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
@@ -3168,4 +3271,4 @@ function rethrowChainError(error) {
|
|
|
3168
3271
|
throw DomainError.badRequest(code ?? "CHAIN_ASSERT", { message: text });
|
|
3169
3272
|
}
|
|
3170
3273
|
|
|
3171
|
-
export { APP_RIGHTS, ActiveUserStatusGuard, AmountFormatterUtils, AssetUtils, BaseExtensionModule, BucketRegistry, CandidateFilterInputDTO, CandidateOutputDTO, CandidateStatus, CouncilField, CurrencyValidationUtil, CurrentUser, DEFAULT_DOCUMENT_VERSION, DOCUMENT_GENERATION_THROTTLE, DateUtils, DocumentAggregateDTO, DomainError, DomainToBlockchainUtils, EMPTY_HASH, EXTENSION_APP_TERMINATE_EVENT, EXTENSION_REPOSITORY, EXTENSION_SECRET_SET, EXTENSION_SECRET_UNSET, ExpenseProposalStatementGenerateDocumentInputDTO, ExpenseProposalStatementSignedDocumentInputDTO, ExpenseProposalStatementSignedMetaDocumentInputDTO, ExtensionAvailability, ExtensionConfigSuppliedBy, ExtensionDomainEntity, GRANTED_SCOPE_KEY, GenerateDocumentInputDTO, GenerateDocumentOptionsInputDTO, GenerateMetaDocumentInputDTO, GeneratedDocumentDTO, GetLedger2HistoryInputDTO, GetLedger2PostingsInputDTO, GqlJwtAuthGuard, GrantedScope, HttpApiError, HttpJwtAuthGuard, IPNProvider, InjectBucket, LOG_EXTENSION_REPOSITORY, LangType, Ledger2AccountDTO, Ledger2HistoryResponseDTO, Ledger2OperationDTO, Ledger2PostingDTO, Ledger2PostingsResponseDTO, Ledger2WalletDTO, LogExtensionDomainEntity, MetaDocumentInputDTO, ONBOARDING_EXPIRY_DAYS, ONBOARDING_EXPIRY_MS, OptionalCurrentUser, OptionalGqlJwtAuthGuard, PaginatedProcessSummary, PaginationInputDTO, PaginationResult, PaginationUtils, PaymentProvider, PollingProvider, ProcessActionDTO, ProcessDeltaDTO, ProcessDocumentDTO, ProcessDocumentSourceDTO, ProcessSummaryDTO, ProcessViewDTO, ProcessesFilterInput, QuantityUtils, RIGHT_METADATA_KEY, RequireRight, RightsGuard, SCOPE_DENIALS, SELF, SORT_FIELD_PATTERN, SafeMarkup, SignatureInfoDTO, SignatureInfoInputDTO, SignedDigitalDocumentDTO, SignedDigitalDocumentInputDTO, TransactionDTO, UseBucket, attachOne, bucketProvidersFor, bucketTokenFor, buildPaginationResult, chainErrorCode, chainRefusalOf, chainTextDigest, checkPaymentAmount, checkPaymentSymbol, checkRight, checkRightScope, computeOnboardingExpiresAt, configureExtensionAuth, configurePlatformSettings, councilRolesOf, createPaginationResult, describeConfigField, desktopGrants, desktopGrantsOf, domainErrorMessage, expandRights, extensionDatabaseMigrations, generateHashFromString, generateRandomHash, generateUniqueHash, getAmountPlusFee, getAppliedBlockNum, hasServerSecret, isChainTextDigest, isChainTextOf, isExtensionAvailable, memberRolesOf, mergeSecretConfig, oneOf, paginationInputToOffset, parseChainAssert, pickDefined, platformSettings, providerSuppliedPaths, redactSecretConfig, registerExtensionDatabaseMigrations, resetExtensionDatabaseMigrations, resolveChainText, rethrowChainError, rightConditions, rightGrants, rightMatches, rightsByRole, rightsHeld, sanitizeUserText, scopeConditions, scopeOfRight, scopesMatched, validationMessage, verifySignedDocumentAgainstStoredDraft, waitForEvent };
|
|
3274
|
+
export { APP_RIGHTS, ActiveUserStatusGuard, AmountFormatterUtils, AssetUtils, BaseExtensionModule, BucketRegistry, CandidateFilterInputDTO, CandidateOutputDTO, CandidateStatus, CouncilField, CurrencyValidationUtil, CurrentUser, DEFAULT_DOCUMENT_VERSION, DOCUMENT_GENERATION_THROTTLE, DateUtils, DocumentAggregateDTO, DomainError, DomainToBlockchainUtils, EMPTY_HASH, EXTENSION_APP_TERMINATE_EVENT, EXTENSION_REPOSITORY, EXTENSION_SECRET_SET, EXTENSION_SECRET_UNSET, ExpenseProposalStatementGenerateDocumentInputDTO, ExpenseProposalStatementSignedDocumentInputDTO, ExpenseProposalStatementSignedMetaDocumentInputDTO, ExtensionAvailability, ExtensionConfigSuppliedBy, ExtensionDomainEntity, GRANTED_SCOPE_KEY, GenerateDocumentInputDTO, GenerateDocumentOptionsInputDTO, GenerateMetaDocumentInputDTO, GeneratedDocumentDTO, GetLedger2HistoryInputDTO, GetLedger2PostingsInputDTO, GqlJwtAuthGuard, GrantedScope, HttpApiError, HttpJwtAuthGuard, IPNProvider, InjectBucket, LOG_EXTENSION_REPOSITORY, LangType, Ledger2AccountDTO, Ledger2HistoryResponseDTO, Ledger2OperationDTO, Ledger2PostingDTO, Ledger2PostingsResponseDTO, Ledger2WalletDTO, LogExtensionDomainEntity, MetaDocumentInputDTO, ONBOARDING_EXPIRY_DAYS, ONBOARDING_EXPIRY_MS, OptionalCurrentUser, OptionalGqlJwtAuthGuard, PaginatedProcessSummary, PaginationInputDTO, PaginationResult, PaginationUtils, PaymentProvider, PollingProvider, ProcessActionDTO, ProcessDeltaDTO, ProcessDocumentDTO, ProcessDocumentSourceDTO, ProcessSummaryDTO, ProcessViewDTO, ProcessesFilterInput, QuantityUtils, RIGHT_METADATA_KEY, RequireRight, RightsGuard, SCOPE_DENIALS, SELF, SORT_FIELD_PATTERN, SafeMarkup, SignatureInfoDTO, SignatureInfoInputDTO, SignedDigitalDocumentDTO, SignedDigitalDocumentInputDTO, TransactionDTO, UseBucket, attachOne, bankSafeText, bucketProvidersFor, bucketTokenFor, buildPaginationResult, chainErrorCode, chainRefusalOf, chainTextDigest, checkPaymentAmount, checkPaymentSymbol, checkRight, checkRightScope, computeOnboardingExpiresAt, configureExtensionAuth, configurePlatformSettings, councilRolesOf, createPaginationResult, describeConfigField, describeStandTime, desktopGrants, desktopGrantsOf, domainErrorMessage, expandRights, extensionDatabaseMigrations, generateHashFromString, generateRandomHash, generateUniqueHash, getAmountPlusFee, getAppliedBlockNum, hasServerSecret, isChainTextDigest, isChainTextOf, isExtensionAvailable, isStandTimeCompressed, isStandTimeConfigured, isStandWorkerTurn, memberRolesOf, mergeSecretConfig, nextLocalMidnight, oneOf, paginationInputToOffset, parseChainAssert, pickDefined, platformSettings, providerSuppliedPaths, redactSecretConfig, registerExtensionDatabaseMigrations, resetExtensionDatabaseMigrations, resolveChainText, rethrowChainError, rightConditions, rightGrants, rightMatches, rightsByRole, rightsHeld, sanitizeUserText, scopeConditions, scopeOfRight, scopesMatched, standDaySeconds, standMonthSeconds, standNextPeriodStart, standPeriodKey, standWorkerPaceSeconds, timeZoneOffsetMs, validationMessage, verifySignedDocumentAgainstStoredDraft, waitForEvent };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coopenomics/extension-kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2026.
|
|
4
|
+
"version": "2026.11.6-2",
|
|
5
5
|
"description": "Служебный каркас расширения цифрового кооператива: базовый модуль, сущности и репозитории расширения, авторизация, каркас блокчейн-синхронизации, контракт миграций схемы, контракт реестра",
|
|
6
6
|
"author": "Alex Ant <dacom.dark.sun@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -39,8 +39,9 @@
|
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@casl/ability": "^7.0.0",
|
|
42
|
+
"@coopenomics/docs-templates": "1.5.4",
|
|
42
43
|
"@coopenomics/i18n": "workspace:*",
|
|
43
|
-
"@coopenomics/sdk": "2026.
|
|
44
|
+
"@coopenomics/sdk": "2026.11.6-2",
|
|
44
45
|
"@nestjs/common": "^10.0.0",
|
|
45
46
|
"@nestjs/core": "^10.0.0",
|
|
46
47
|
"@nestjs/graphql": "^12.2.1",
|
|
@@ -61,7 +62,8 @@
|
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@casl/ability": "^7.0.0",
|
|
64
|
-
"@coopenomics/
|
|
65
|
+
"@coopenomics/docs-templates": "1.5.4",
|
|
66
|
+
"@coopenomics/i18n": "2026.11.6-2",
|
|
65
67
|
"@nestjs/common": "^10.0.0",
|
|
66
68
|
"@nestjs/core": "^10.0.0",
|
|
67
69
|
"@nestjs/graphql": "^12.2.1",
|
|
@@ -70,7 +72,7 @@
|
|
|
70
72
|
"@wharfkit/session": "^1.4.0",
|
|
71
73
|
"class-transformer": "^0.5.1",
|
|
72
74
|
"class-validator": "^0.14.1",
|
|
73
|
-
"cooptypes": "2026.
|
|
75
|
+
"cooptypes": "2026.11.6-2",
|
|
74
76
|
"graphql": "^16.9.0",
|
|
75
77
|
"graphql-type-json": "^0.3.2",
|
|
76
78
|
"kysely": "0.28.17",
|
|
@@ -82,5 +84,5 @@
|
|
|
82
84
|
"unbuild": "^2.0.0",
|
|
83
85
|
"zod": "^3.0.0"
|
|
84
86
|
},
|
|
85
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "15b51a5731b2e1cb344fbf6a71f99f04859ebeda"
|
|
86
88
|
}
|