@coopenomics/extension-kit 2026.12.1 → 2026.12.3-dev.10
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 +558 -1092
- package/dist/index.d.cts +6 -208
- package/dist/index.d.mts +6 -208
- package/dist/index.d.ts +6 -208
- package/dist/index.mjs +312 -868
- package/dist/sync/index.cjs +4 -602
- package/dist/sync/index.d.cts +1 -501
- package/dist/sync/index.d.mts +1 -501
- package/dist/sync/index.d.ts +1 -501
- package/dist/sync/index.mjs +1 -595
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -5,9 +5,12 @@ 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 {
|
|
9
|
-
import {
|
|
8
|
+
import { Registry, IGeneratedDocument } from '@coopenomics/docs-templates';
|
|
9
|
+
import { SignedDigitalDocumentInputDTO, GenerateMetaDocumentInputDTO, MetaDocumentInputDTO, PaginationInputDTO, PaginationResult } from '@coopenomics/extension-sdk/graphql';
|
|
10
|
+
export { AccountType, CertificateDTO, CertificateFields, DocumentAggregateDTO, EntrepreneurCertificateDTO, GenerateDocumentInputDTO, GenerateDocumentOptionsInputDTO, GenerateMetaDocumentInputDTO, GeneratedDocumentDTO, IndividualCertificateDTO, LangType, MetaDocumentInputDTO, OrganizationCertificateDTO, PaginationInputDTO, PaginationResult, RepresentedByCertificateDTO, SORT_FIELD_PATTERN, SignatureInfoDTO, SignatureInfoInputDTO, SignedDigitalDocumentDTO, SignedDigitalDocumentInputDTO, SignerCertificateResolver, TransactionDTO, UserCertificateUnion, createPaginationResult, printSubgraphSdl, validationMessage } from '@coopenomics/extension-sdk/graphql';
|
|
10
11
|
export * from '@coopenomics/extension-sdk/database';
|
|
12
|
+
export * from '@coopenomics/extension-sdk/secrets';
|
|
13
|
+
import { Cooperative } from 'cooptypes';
|
|
11
14
|
import { ValidationOptions } from 'class-validator';
|
|
12
15
|
|
|
13
16
|
/**
|
|
@@ -669,63 +672,6 @@ declare function bucketProvidersFor(fileStoragePortToken: symbol | string, consu
|
|
|
669
672
|
name: string;
|
|
670
673
|
}>): Provider[];
|
|
671
674
|
|
|
672
|
-
declare class SignatureInfoInputDTO {
|
|
673
|
-
readonly id: number;
|
|
674
|
-
readonly signer: string;
|
|
675
|
-
readonly public_key: string;
|
|
676
|
-
readonly signature: string;
|
|
677
|
-
readonly signed_at: string;
|
|
678
|
-
readonly signed_hash: string;
|
|
679
|
-
readonly meta: string;
|
|
680
|
-
}
|
|
681
|
-
declare class SignedDigitalDocumentInputDTO {
|
|
682
|
-
readonly version: string;
|
|
683
|
-
readonly hash: string;
|
|
684
|
-
readonly doc_hash: string;
|
|
685
|
-
readonly meta_hash: string;
|
|
686
|
-
readonly meta: any;
|
|
687
|
-
readonly signatures: SignatureInfoInputDTO[];
|
|
688
|
-
constructor(data: SignedDigitalDocumentInputDTO);
|
|
689
|
-
/**
|
|
690
|
-
* Преобразует подписанный документ DTO в формат IChainDocument для блокчейна
|
|
691
|
-
*/
|
|
692
|
-
toDocument(): Cooperative.Document.IChainDocument2;
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
/** Язык, на котором формируется документ. */
|
|
696
|
-
declare enum LangType {
|
|
697
|
-
ru = "ru"
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
declare class MetaDocumentInputDTO implements IMetaDocument {
|
|
701
|
-
title: string;
|
|
702
|
-
registry_id: number;
|
|
703
|
-
lang: LangType;
|
|
704
|
-
generator: string;
|
|
705
|
-
version: string;
|
|
706
|
-
coopname: string;
|
|
707
|
-
username: string;
|
|
708
|
-
created_at: string;
|
|
709
|
-
block_num: number;
|
|
710
|
-
timezone: string;
|
|
711
|
-
links: string[];
|
|
712
|
-
builder?: string;
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
declare class GenerateMetaDocumentInputDTO implements IGenerate {
|
|
716
|
-
title?: string;
|
|
717
|
-
registry_id: number;
|
|
718
|
-
coopname: string;
|
|
719
|
-
username: string;
|
|
720
|
-
lang?: LangType;
|
|
721
|
-
generator?: string;
|
|
722
|
-
version?: string;
|
|
723
|
-
created_at?: string;
|
|
724
|
-
block_num?: number;
|
|
725
|
-
timezone?: string;
|
|
726
|
-
links?: string[];
|
|
727
|
-
}
|
|
728
|
-
|
|
729
675
|
type Action = Registry.ExpenseProposalStatement.Action;
|
|
730
676
|
type ItemAction = Registry.ExpenseProposalStatement.IExpenseItem;
|
|
731
677
|
type HeaderAction = Registry.ExpenseProposalStatement.IExpenseProposalHeader;
|
|
@@ -1369,46 +1315,6 @@ declare function extensionDatabaseMigrations(): ReadonlyArray<ExtensionDatabaseM
|
|
|
1369
1315
|
/** Сбросить список. Только для тестов, которые поднимают граф модулей заново. */
|
|
1370
1316
|
declare function resetExtensionDatabaseMigrations(): void;
|
|
1371
1317
|
|
|
1372
|
-
/**
|
|
1373
|
-
* Допустимое поле сортировки: имя из латиницы, цифр и подчёркивания и, по
|
|
1374
|
-
* желанию, направление через двоеточие (`created_at:desc` — так сортирует
|
|
1375
|
-
* реестр пайщиков, репозиторий пользователей разбирает пару сам). Поле уходит
|
|
1376
|
-
* в `ORDER BY` строкой, и любой другой символ открывал бы подстановку SQL.
|
|
1377
|
-
* Какая именно колонка разрешена, решает репозиторий по своему списку или
|
|
1378
|
-
* метаданным сущности (`resolveSortColumn`); здесь отсекается всё, что именем
|
|
1379
|
-
* колонки быть не может. Пустая строка — «без сортировки»: её отдаёт таблица
|
|
1380
|
-
* со снятой сортировкой, и репозитории берут порядок по умолчанию.
|
|
1381
|
-
*/
|
|
1382
|
-
declare const SORT_FIELD_PATTERN: RegExp;
|
|
1383
|
-
/**
|
|
1384
|
-
* Входные параметры для пагинации и сортировки
|
|
1385
|
-
*/
|
|
1386
|
-
declare class PaginationInputDTO {
|
|
1387
|
-
page: number;
|
|
1388
|
-
limit: number;
|
|
1389
|
-
sortBy?: string;
|
|
1390
|
-
sortOrder: 'ASC' | 'DESC';
|
|
1391
|
-
}
|
|
1392
|
-
/**
|
|
1393
|
-
* Результат пагинации (универсальный для TypeScript)
|
|
1394
|
-
*/
|
|
1395
|
-
declare class PaginationResult<T> {
|
|
1396
|
-
items: T[];
|
|
1397
|
-
totalCount: number;
|
|
1398
|
-
totalPages: number;
|
|
1399
|
-
currentPage: number;
|
|
1400
|
-
}
|
|
1401
|
-
/**
|
|
1402
|
-
* Создание объекта GraphQL для результата пагинации
|
|
1403
|
-
* @param name - Имя объекта GraphQL
|
|
1404
|
-
* @param ItemType - Класс элемента списка
|
|
1405
|
-
*/
|
|
1406
|
-
declare function createPaginationResult<T>(ItemType: new (...args: any[]) => T, name: string): abstract new () => {
|
|
1407
|
-
items: T[];
|
|
1408
|
-
totalCount: number;
|
|
1409
|
-
totalPages: number;
|
|
1410
|
-
currentPage: number;
|
|
1411
|
-
};
|
|
1412
1318
|
/**
|
|
1413
1319
|
* Сборка `PaginationResult<U>` для consumer'ов, читающих через порт innercoop
|
|
1414
1320
|
* (нет своего Repository.findAndCount, доступен только raw `{items, totalCount}`).
|
|
@@ -1743,21 +1649,6 @@ declare function contentAsset(amount: string | number | null | undefined, symbol
|
|
|
1743
1649
|
*/
|
|
1744
1650
|
type RequireFields<T, K> = Partial<T> & Required<Pick<T, Extract<K & keyof T, keyof T>>>;
|
|
1745
1651
|
|
|
1746
|
-
/**
|
|
1747
|
-
* DTO для результата транзакции.
|
|
1748
|
-
*/
|
|
1749
|
-
declare class TransactionDTO {
|
|
1750
|
-
chain?: any;
|
|
1751
|
-
request?: any;
|
|
1752
|
-
resolved?: any;
|
|
1753
|
-
response?: any;
|
|
1754
|
-
returns?: any;
|
|
1755
|
-
revisions?: any;
|
|
1756
|
-
signatures?: any;
|
|
1757
|
-
signer?: any;
|
|
1758
|
-
transaction?: any;
|
|
1759
|
-
}
|
|
1760
|
-
|
|
1761
1652
|
/**
|
|
1762
1653
|
* Настройки контура, одинаковые для всех расширений и не содержащие секретов.
|
|
1763
1654
|
*
|
|
@@ -1897,20 +1788,6 @@ type GeneratedDocumentDomainInterface = Omit<IGeneratedDocument, 'binary'> & {
|
|
|
1897
1788
|
binary: string;
|
|
1898
1789
|
};
|
|
1899
1790
|
|
|
1900
|
-
declare class GeneratedDocumentDTO implements GeneratedDocumentDomainInterface {
|
|
1901
|
-
full_title: string;
|
|
1902
|
-
html: string;
|
|
1903
|
-
hash: string;
|
|
1904
|
-
meta: any;
|
|
1905
|
-
binary: string;
|
|
1906
|
-
constructor(data?: GeneratedDocumentDomainInterface);
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
|
-
declare class GenerateDocumentOptionsInputDTO implements IGenerationOptions {
|
|
1910
|
-
skip_save?: boolean;
|
|
1911
|
-
lang?: string;
|
|
1912
|
-
}
|
|
1913
|
-
|
|
1914
1791
|
/**
|
|
1915
1792
|
* Убрать из формы документа поля, которые проставляет реестр, а не заявитель.
|
|
1916
1793
|
*
|
|
@@ -1919,72 +1796,6 @@ declare class GenerateDocumentOptionsInputDTO implements IGenerationOptions {
|
|
|
1919
1796
|
*/
|
|
1920
1797
|
type ExcludeCommonProps<T> = Omit<T, 'coopname' | 'username' | 'registry_id'>;
|
|
1921
1798
|
|
|
1922
|
-
declare const GenerateDocumentInputDTO_base: _nestjs_common.Type<Omit<GenerateMetaDocumentInputDTO, "registry_id">>;
|
|
1923
|
-
/**
|
|
1924
|
-
* То же, что `GenerateMetaDocumentInputDTO`, но реестр обязателен на уровне
|
|
1925
|
-
* типов TypeScript.
|
|
1926
|
-
*
|
|
1927
|
-
* `registry_id` намеренно без `@Field`: в схеме у `GenerateDocumentInput` этого
|
|
1928
|
-
* поля нет и не было — реестр проставляет сервер по вызванной мутации, а не
|
|
1929
|
-
* клиент. Добавить `@Field` значило бы завести новое обязательное поле во
|
|
1930
|
-
* входном типе и сломать всех клиентов.
|
|
1931
|
-
*/
|
|
1932
|
-
declare class GenerateDocumentInputDTO extends GenerateDocumentInputDTO_base {
|
|
1933
|
-
registry_id: number;
|
|
1934
|
-
constructor();
|
|
1935
|
-
}
|
|
1936
|
-
|
|
1937
|
-
/** Реквизиты одной подписи под документом. */
|
|
1938
|
-
declare class SignatureInfoDTO {
|
|
1939
|
-
readonly id: number;
|
|
1940
|
-
readonly signer: string;
|
|
1941
|
-
readonly public_key: string;
|
|
1942
|
-
readonly signature: string;
|
|
1943
|
-
readonly signed_at: string;
|
|
1944
|
-
readonly signed_hash: string;
|
|
1945
|
-
readonly meta: any;
|
|
1946
|
-
readonly is_valid?: boolean;
|
|
1947
|
-
}
|
|
1948
|
-
/**
|
|
1949
|
-
* Подписанный документ целиком.
|
|
1950
|
-
*
|
|
1951
|
-
* Конструктор переносит подписи как есть, не пересобирая их: поля совпадают по
|
|
1952
|
-
* именам, а всё, что ядро добавило сверх контракта (тот самый сертификат),
|
|
1953
|
-
* доезжает до его собственного резолвера нетронутым.
|
|
1954
|
-
*/
|
|
1955
|
-
declare class SignedDigitalDocumentDTO {
|
|
1956
|
-
readonly version: string;
|
|
1957
|
-
readonly hash: string;
|
|
1958
|
-
readonly doc_hash: string;
|
|
1959
|
-
readonly meta_hash: string;
|
|
1960
|
-
readonly meta: any;
|
|
1961
|
-
readonly signatures: SignatureInfoDTO[];
|
|
1962
|
-
constructor(data: {
|
|
1963
|
-
version: string;
|
|
1964
|
-
hash: string;
|
|
1965
|
-
doc_hash: string;
|
|
1966
|
-
meta_hash: string;
|
|
1967
|
-
meta: any;
|
|
1968
|
-
signatures: readonly any[];
|
|
1969
|
-
});
|
|
1970
|
-
}
|
|
1971
|
-
|
|
1972
|
-
declare class DocumentAggregateDTO {
|
|
1973
|
-
hash: string;
|
|
1974
|
-
document: SignedDigitalDocumentDTO;
|
|
1975
|
-
rawDocument?: GeneratedDocumentDTO;
|
|
1976
|
-
/**
|
|
1977
|
-
* Принимает любой агрегат нужной формы: и доменный из ядра, и результат
|
|
1978
|
-
* `IDocumentPort.buildAggregate`. Номинальной связи с ними нет — каркас не
|
|
1979
|
-
* зависит ни от контроллера, ни от `@coopenomics/innercoop` (INV-007).
|
|
1980
|
-
*/
|
|
1981
|
-
constructor(data?: {
|
|
1982
|
-
hash: string;
|
|
1983
|
-
document: any;
|
|
1984
|
-
rawDocument?: any;
|
|
1985
|
-
});
|
|
1986
|
-
}
|
|
1987
|
-
|
|
1988
1799
|
/**
|
|
1989
1800
|
* Сверка подписанного документа с черновиком, который ему предшествовал.
|
|
1990
1801
|
*
|
|
@@ -2452,19 +2263,6 @@ declare class DomainError extends HttpException implements Branded {
|
|
|
2452
2263
|
static badGateway(code: string, params?: DomainErrorParams): DomainError;
|
|
2453
2264
|
static serviceUnavailable(code: string, params?: DomainErrorParams): DomainError;
|
|
2454
2265
|
}
|
|
2455
|
-
/**
|
|
2456
|
-
* Сообщение для class-validator по ключу словаря. Переводится в момент
|
|
2457
|
-
* проверки — на язык запроса, а не при загрузке модуля:
|
|
2458
|
-
*
|
|
2459
|
-
* @IsNotEmpty({ message: validationMessage('validation.required') })
|
|
2460
|
-
*
|
|
2461
|
-
* В параметры сообщения попадают `property` (имя поля) и `value`.
|
|
2462
|
-
*/
|
|
2463
|
-
declare function validationMessage(key: string, params?: DomainErrorParams): (args: {
|
|
2464
|
-
property: string;
|
|
2465
|
-
value?: unknown;
|
|
2466
|
-
constraints?: unknown[];
|
|
2467
|
-
}) => string;
|
|
2468
2266
|
|
|
2469
2267
|
/**
|
|
2470
2268
|
* Разбор отказа контракта. Контракт пишет причину как `КОД: текст`
|
|
@@ -2504,5 +2302,5 @@ declare function chainRefusalOf(error: unknown): DomainError | null;
|
|
|
2504
2302
|
*/
|
|
2505
2303
|
declare function rethrowChainError(error: unknown): never;
|
|
2506
2304
|
|
|
2507
|
-
export { APP_RIGHTS, ActiveUserStatusGuard, AmountFormatterUtils, AssetUtils, BaseExtensionModule, BucketRegistry, CandidateFilterInputDTO, CandidateOutputDTO, CandidateStatus, CouncilField, CurrencyValidationUtil, CurrentUser, DEFAULT_DOCUMENT_VERSION, DOCUMENT_GENERATION_THROTTLE, DateUtils,
|
|
2305
|
+
export { APP_RIGHTS, ActiveUserStatusGuard, AmountFormatterUtils, AssetUtils, BaseExtensionModule, BucketRegistry, CandidateFilterInputDTO, CandidateOutputDTO, CandidateStatus, CouncilField, CurrencyValidationUtil, CurrentUser, DEFAULT_DOCUMENT_VERSION, DOCUMENT_GENERATION_THROTTLE, DateUtils, DomainError, DomainToBlockchainUtils, EMPTY_HASH, EXPENSE_PLAN_RECURRENCE_MONTHS, EXTENSION_APP_TERMINATE_EVENT, EXTENSION_REPOSITORY, EXTENSION_SECRET_SET, EXTENSION_SECRET_UNSET, ExpenseProposalStatementGenerateDocumentInputDTO, ExpenseProposalStatementSignedDocumentInputDTO, ExpenseProposalStatementSignedMetaDocumentInputDTO, ExtensionAvailability, ExtensionConfigSuppliedBy, ExtensionDomainEntity, GRANTED_SCOPE_KEY, GetLedger2HistoryInputDTO, GetLedger2PostingsInputDTO, GqlJwtAuthGuard, GrantedScope, HttpApiError, HttpJwtAuthGuard, IPNProvider, InjectBucket, LOG_EXTENSION_REPOSITORY, Ledger2AccountDTO, Ledger2HistoryResponseDTO, Ledger2OperationDTO, Ledger2PostingDTO, Ledger2PostingsResponseDTO, Ledger2WalletDTO, LogExtensionDomainEntity, ONBOARDING_EXPIRY_DAYS, ONBOARDING_EXPIRY_MS, OptionalCurrentUser, OptionalGqlJwtAuthGuard, PaginatedProcessSummary, PaginationUtils, PaymentProvider, PollingProvider, ProcessActionDTO, ProcessContentDTO, ProcessContentFactDTO, ProcessContentLineDTO, ProcessContentLinkDTO, ProcessDeltaDTO, ProcessDocumentDTO, ProcessDocumentSourceDTO, ProcessSummaryDTO, ProcessViewDTO, ProcessesFilterInput, QuantityUtils, RIGHT_METADATA_KEY, RequireRight, RightsGuard, SCOPE_DENIALS, SELF, SafeMarkup, UseBucket, bankSafeText, bucketProvidersFor, bucketTokenFor, buildPaginationResult, catalogAppTitle, chainErrorCode, chainRefusalOf, chainTextDigest, checkPaymentAmount, checkPaymentSymbol, checkRight, checkRightScope, computeOnboardingExpiresAt, configureExtensionAuth, configurePlatformSettings, contentAsset, contentDay, contentFact, contentMoney, councilRolesOf, describeConfigField, describeStandTime, desktopGrants, desktopGrantsOf, domainErrorMessage, expandRights, expensePlanRecurrenceMonths, expensePlanReserveMonths, expensePlanReserveShare, expensePlanScheduleDates, extensionDatabaseMigrations, generateHashFromString, generateRandomHash, generateUniqueHash, getAmountPlusFee, getAppliedBlockNum, hasServerSecret, isChainTextDigest, isChainTextOf, isExtensionAvailable, isStandTimeCompressed, isStandTimeConfigured, isStandWorkerTurn, memberRolesOf, mergeSecretConfig, nextExpensePlanDate, nextLocalMidnight, paginationInputToOffset, parseChainAssert, pickDefined, platformSettings, processContentRegistry, providerSuppliedPaths, redactSecretConfig, registerExtensionDatabaseMigrations, resetExtensionDatabaseMigrations, resolveChainText, rethrowChainError, rightConditions, rightGrants, rightMatches, rightsByRole, rightsHeld, sanitizeUserText, scopeConditions, scopeOfRight, scopesMatched, standDaySeconds, standMonthSeconds, standNextPeriodStart, standPeriodKey, standWorkerPaceSeconds, timeZoneOffsetMs, verifySignedDocumentAgainstStoredDraft, waitForEvent };
|
|
2508
2306
|
export type { AppRights, AssignableRole, AttachedRole, BucketSource, BucketSpec, CouncilRole, DeserializedDescriptionOfExtension, DesktopGrantsRequest, DomainErrorParams, EventSource, EventWait, ExcludeCommonProps, ExpensePlanRecurrenceKey, ExtensionAppTerminatePayload, ExtensionAuthOptions, ExtensionConfigFieldPolicy, ExtensionConfigPolicy, ExtensionDatabaseMigrationClass, ExtensionDomainInterface, ExtensionDomainRepository, ExtensionSchemaMigrationAfterContext, GeneratedDocumentDomainInterface, GeneratedDocumentDraft, GrantedAction, IDesktopConfig, IExtensionSchemaMigration, IGrantedScope, IRegistryExtension, IResolvedRegistryExtension, IRightRequirement, LoadGeneratedDocumentByDocHash, LogExtensionDomainInterface, LogExtensionDomainRepository, LogExtensionFilter, LogExtensionPaginationOptions, LogExtensionPaginationResult, MemberRole, NarrowRightScope, PaymentDetails, PlatformBlockchainSettings, PlatformSettings, ProcessContentProvider, RegisteredBucket, RequireFields, RightActor, RightFacts, RightGrant, RightOutcome, RightScope, RightSource, RightsCaller, RightsGroup, RightsTable, RolePermission, SchemaMigration, SchemaMigrationClass, SchemaQueryRunner, ScopeCheckInput, ScopeCheckResult, SignedDocumentMetaCompareMode, SignedDocumentMetaVerification, SignedDocumentToVerify, TransactResultWithResponse };
|