@coopenomics/extension-kit 2026.9.30 → 2026.10.11

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 CHANGED
@@ -3,13 +3,15 @@
3
3
  const common = require('@nestjs/common');
4
4
  const graphql = require('@nestjs/graphql');
5
5
  const server = require('@coopenomics/i18n/server');
6
- const core = require('@nestjs/core');
7
6
  const passport = require('@nestjs/passport');
8
7
  const node_crypto = require('node:crypto');
8
+ const ability = require('@casl/ability');
9
+ const core = require('@nestjs/core');
9
10
  const zod = require('zod');
10
11
  const classValidator = require('class-validator');
11
12
  const classTransformer = require('class-transformer');
12
- const graphqlTypeJson = require('graphql-type-json');
13
+ const GraphQLJSON = require('graphql-type-json');
14
+ const transaction = require('./shared/extension-kit.e25d0843.cjs');
13
15
  const sdk = require('@coopenomics/sdk');
14
16
  const antelope = require('@wharfkit/antelope');
15
17
  const moment = require('moment');
@@ -17,9 +19,12 @@ const crypto = require('crypto');
17
19
  const moment$1 = require('moment-timezone');
18
20
  require('moment/locale/ru');
19
21
  const cooptypes = require('cooptypes');
22
+ require('kysely');
23
+ require('node:async_hooks');
20
24
 
21
25
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
22
26
 
27
+ const GraphQLJSON__default = /*#__PURE__*/_interopDefaultCompat(GraphQLJSON);
23
28
  const moment__default = /*#__PURE__*/_interopDefaultCompat(moment);
24
29
  const crypto__default = /*#__PURE__*/_interopDefaultCompat(crypto);
25
30
  const moment__default$1 = /*#__PURE__*/_interopDefaultCompat(moment$1);
@@ -168,17 +173,9 @@ function validationMessage(key, params = {}) {
168
173
  return (args) => server.t(key, { property: args.property, value: String(args.value ?? ""), ...params });
169
174
  }
170
175
 
171
- const ROLES_DENY_SELF_KEY = "roles_deny_self";
172
- const ROLES_ANY_STATUS_KEY = "roles_any_status";
173
- function AuthRoles(roles, options = {}) {
174
- const self = options.self ?? [];
175
- const args = self.length ? `roles: ${JSON.stringify(roles)}, self: ${JSON.stringify(self)}` : `roles: ${JSON.stringify(roles)}`;
176
- const decorators = [common.SetMetadata("roles", roles), graphql.Directive(`@auth(${args})`)];
177
- if (options.allowSelf === false)
178
- decorators.push(common.SetMetadata(ROLES_DENY_SELF_KEY, true));
179
- if (options.anyStatus === true)
180
- decorators.push(common.SetMetadata(ROLES_ANY_STATUS_KEY, true));
181
- return common.applyDecorators(...decorators);
176
+ function CouncilField(self = []) {
177
+ const council = 'roles: ["chairman", "member"]';
178
+ return graphql.Directive(`@auth(${self.length ? `${council}, self: ${JSON.stringify(self)}` : council})`);
182
179
  }
183
180
  const CurrentUser = common.createParamDecorator((data, context) => {
184
181
  const ctx = graphql.GqlExecutionContext.create(context);
@@ -210,20 +207,18 @@ function hasServerSecret(headers) {
210
207
  return a.length === b.length && node_crypto.timingSafeEqual(a, b);
211
208
  }
212
209
 
213
- var __defProp$g = Object.defineProperty;
214
- var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
215
- var __decorateClass$g = (decorators, target, key, kind) => {
216
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
210
+ var __defProp$q = Object.defineProperty;
211
+ var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
212
+ var __decorateClass$q = (decorators, target, key, kind) => {
213
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
217
214
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
218
215
  if (decorator = decorators[i])
219
216
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
220
217
  if (kind && result)
221
- __defProp$g(target, key, result);
218
+ __defProp$q(target, key, result);
222
219
  return result;
223
220
  };
224
- var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
225
221
  const ACTIVE_USER_STATUS = "active";
226
- const PARTICIPANT_ROLE = "user";
227
222
  exports.GqlJwtAuthGuard = class GqlJwtAuthGuard extends passport.AuthGuard("jwt") {
228
223
  getRequest(context) {
229
224
  const ctx = graphql.GqlExecutionContext.create(context);
@@ -245,7 +240,7 @@ exports.GqlJwtAuthGuard = class GqlJwtAuthGuard extends passport.AuthGuard("jwt"
245
240
  return super.canActivate(context);
246
241
  }
247
242
  };
248
- exports.GqlJwtAuthGuard = __decorateClass$g([
243
+ exports.GqlJwtAuthGuard = __decorateClass$q([
249
244
  common.Injectable()
250
245
  ], exports.GqlJwtAuthGuard);
251
246
  function hasAuthorizationHeader(headers) {
@@ -270,7 +265,7 @@ exports.OptionalGqlJwtAuthGuard = class OptionalGqlJwtAuthGuard extends passport
270
265
  throw DomainError.unauthorized("KIT_SESSION_ENDED");
271
266
  }
272
267
  };
273
- exports.OptionalGqlJwtAuthGuard = __decorateClass$g([
268
+ exports.OptionalGqlJwtAuthGuard = __decorateClass$q([
274
269
  common.Injectable()
275
270
  ], exports.OptionalGqlJwtAuthGuard);
276
271
  exports.HttpJwtAuthGuard = class HttpJwtAuthGuard extends passport.AuthGuard("jwt") {
@@ -285,49 +280,9 @@ exports.HttpJwtAuthGuard = class HttpJwtAuthGuard extends passport.AuthGuard("jw
285
280
  return super.canActivate(context);
286
281
  }
287
282
  };
288
- exports.HttpJwtAuthGuard = __decorateClass$g([
283
+ exports.HttpJwtAuthGuard = __decorateClass$q([
289
284
  common.Injectable()
290
285
  ], exports.HttpJwtAuthGuard);
291
- exports.RolesGuard = class RolesGuard {
292
- // Токен указан явно: пакет собирается esbuild'ом, а он не умеет
293
- // `emitDecoratorMetadata`. Без `@Inject` Nest не увидел бы `design:paramtypes`,
294
- // построил бы гард без аргументов, и `reflector` оказался бы `undefined` —
295
- // отказ приходил бы не отказом, а 500 на первом же запросе с ролями.
296
- constructor(reflector) {
297
- this.reflector = reflector;
298
- }
299
- canActivate(context) {
300
- const ctx = graphql.GqlExecutionContext.create(context);
301
- const request = ctx.getContext().req;
302
- if (hasServerSecret(request?.headers)) {
303
- return true;
304
- }
305
- const allowedRoles = this.reflector.get("roles", context.getHandler());
306
- if (!allowedRoles) {
307
- return true;
308
- }
309
- const { user } = request;
310
- const args = ctx.getArgs();
311
- const data = args.data;
312
- const filter = args.filter;
313
- const denySelf = this.reflector.get(ROLES_DENY_SELF_KEY, context.getHandler()) === true;
314
- if (!denySelf && (data && data.username && user.username === data.username || filter && filter.username && user.username === filter.username || args.username && user.username === args.username)) {
315
- return true;
316
- }
317
- if (allowedRoles.includes(user.role)) {
318
- const anyStatus = this.reflector.get(ROLES_ANY_STATUS_KEY, context.getHandler()) === true;
319
- if (user.role === PARTICIPANT_ROLE && !anyStatus && user.status !== ACTIVE_USER_STATUS) {
320
- throw DomainError.forbidden("KIT_MEMBERS_ONLY");
321
- }
322
- return true;
323
- }
324
- throw DomainError.unauthorized("KIT_INSUFFICIENT_RIGHTS");
325
- }
326
- };
327
- exports.RolesGuard = __decorateClass$g([
328
- common.Injectable(),
329
- __decorateParam(0, common.Inject(core.Reflector))
330
- ], exports.RolesGuard);
331
286
  exports.ActiveUserStatusGuard = class ActiveUserStatusGuard {
332
287
  canActivate(context) {
333
288
  const ctx = graphql.GqlExecutionContext.create(context);
@@ -345,19 +300,380 @@ exports.ActiveUserStatusGuard = class ActiveUserStatusGuard {
345
300
  return true;
346
301
  }
347
302
  };
348
- exports.ActiveUserStatusGuard = __decorateClass$g([
303
+ exports.ActiveUserStatusGuard = __decorateClass$q([
349
304
  common.Injectable()
350
305
  ], exports.ActiveUserStatusGuard);
351
306
 
352
- var __defProp$f = Object.defineProperty;
353
- var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
354
- var __decorateClass$f = (decorators, target, key, kind) => {
355
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
307
+ const NARROW_SCOPES = /* @__PURE__ */ new Set(["own", "own-KU", "chaired-KU", "to-self"]);
308
+ function rightMatches(actions, action) {
309
+ if (actions.includes(action))
310
+ return true;
311
+ const colon = action.lastIndexOf(":");
312
+ if (colon > 0 && NARROW_SCOPES.has(action.slice(colon + 1))) {
313
+ return actions.includes(`${action.slice(0, colon)}:all`);
314
+ }
315
+ return false;
316
+ }
317
+ function rightConditions(table, roles, resource, action) {
318
+ const out = [];
319
+ for (const role of roles) {
320
+ for (const group of table[role] ?? []) {
321
+ const actions = group.rights[resource];
322
+ if (actions && rightMatches(actions, action))
323
+ out.push(group.when);
324
+ }
325
+ }
326
+ return out;
327
+ }
328
+ function rightGrants(table, roles, resource, action) {
329
+ const out = [];
330
+ for (const role of roles) {
331
+ for (const group of table[role] ?? []) {
332
+ const actions = group.rights[resource];
333
+ if (!actions)
334
+ continue;
335
+ if (!rightMatches(actions, action))
336
+ continue;
337
+ const colon = action.lastIndexOf(":");
338
+ const narrow = colon > 0 && NARROW_SCOPES.has(action.slice(colon + 1));
339
+ out.push({ when: group.when, wide: narrow && actions.includes(`${action.slice(0, colon)}:all`) });
340
+ }
341
+ }
342
+ return out;
343
+ }
344
+ function rightsHeld(table, roles, held) {
345
+ const set = /* @__PURE__ */ new Set();
346
+ for (const role of roles) {
347
+ for (const group of table[role] ?? []) {
348
+ if (!group.when.every((condition) => held.has(condition)))
349
+ continue;
350
+ for (const [resource, actions] of Object.entries(group.rights)) {
351
+ for (const action of actions)
352
+ set.add(`${resource}:${action}`);
353
+ }
354
+ }
355
+ }
356
+ return [...set];
357
+ }
358
+ function rightsByRole(table) {
359
+ const out = {};
360
+ for (const role of Object.keys(table)) {
361
+ const merged = {};
362
+ for (const group of table[role]) {
363
+ for (const [resource, actions] of Object.entries(group.rights)) {
364
+ merged[resource] = [...merged[resource] ?? [], ...actions];
365
+ }
366
+ }
367
+ out[role] = merged;
368
+ }
369
+ return out;
370
+ }
371
+ function expandRights(rights) {
372
+ const set = /* @__PURE__ */ new Set();
373
+ for (const right of rights) {
374
+ set.add(right);
375
+ const colon = right.lastIndexOf(":");
376
+ if (colon > 0 && right.slice(colon + 1) === "all") {
377
+ for (const scope of NARROW_SCOPES)
378
+ set.add(`${right.slice(0, colon)}:${scope}`);
379
+ }
380
+ }
381
+ return [...set];
382
+ }
383
+ const RIGHT_METADATA_KEY = "required_right";
384
+ const SELF = { self: true };
385
+ const RequireRight = (resource, action, source) => common.SetMetadata(RIGHT_METADATA_KEY, { resource, action, source });
386
+ function scopeOfRight(resource, action, implied = {}) {
387
+ const colon = action.lastIndexOf(":");
388
+ const tail = colon > 0 ? action.slice(colon + 1) : "";
389
+ if (tail === "all" || NARROW_SCOPES.has(tail))
390
+ return tail;
391
+ return implied[`${resource}:${action}`] ?? null;
392
+ }
393
+ function scopeConditions(scope, actor) {
394
+ switch (scope) {
395
+ case "own":
396
+ return { owner: actor.username };
397
+ case "to-self":
398
+ return { recipient: actor.username };
399
+ case "own-KU":
400
+ return { ku: { $in: [...actor.kus] } };
401
+ case "chaired-KU":
402
+ return { ku: { $in: [...actor.chairedKus] } };
403
+ }
404
+ }
405
+ function scopesMatched(resource, scopes, actor, facts) {
406
+ return scopes.filter((scope) => {
407
+ const ability$1 = ability.createMongoAbility([{ action: "act", subject: resource, conditions: scopeConditions(scope, actor) }]);
408
+ return ability$1.can("act", ability.subject(resource, { ...facts }));
409
+ });
410
+ }
411
+ const SCOPE_DENIALS = {
412
+ own: "KIT_RIGHT_SCOPE_OWN",
413
+ "own-KU": "KIT_RIGHT_SCOPE_OWN_KU",
414
+ "chaired-KU": "KIT_RIGHT_SCOPE_CHAIRED_KU",
415
+ "to-self": "KIT_RIGHT_SCOPE_TO_SELF"
416
+ };
417
+ function readPath$1(args, path) {
418
+ let value = args;
419
+ for (const key of path.split(".")) {
420
+ if (value === null || typeof value !== "object")
421
+ return void 0;
422
+ value = value[key];
423
+ }
424
+ return value;
425
+ }
426
+ function unique(items) {
427
+ return [...new Set(items)];
428
+ }
429
+ async function checkRightScope(input) {
430
+ const sources = Array.isArray(input.source) ? input.source : [input.source];
431
+ let merged;
432
+ for (const source of sources) {
433
+ const one = await checkScopeOfSource(input, source);
434
+ if (!one.allowed)
435
+ return one;
436
+ merged = merged ? { scopes: unique([...merged.scopes, ...one.scope.scopes]), kus: one.scope.kus !== void 0 ? one.scope.kus : merged.kus } : one.scope;
437
+ }
438
+ return { allowed: true, scope: merged ?? { scopes: [] } };
439
+ }
440
+ async function checkScopeOfSource(input, source) {
441
+ const { resource, args } = input;
442
+ const scopes = unique(
443
+ input.granted.map((grant) => grant.wide ? "all" : scopeOfRight(resource, grant.action, input.implied)).filter(
444
+ (scope) => scope !== null
445
+ )
446
+ );
447
+ const wide = scopes.includes("all") || input.granted.some((grant) => !grant.wide && scopeOfRight(resource, grant.action, input.implied) === null);
448
+ const narrow = scopes.filter((scope) => scope !== "all");
449
+ const pass = (scope) => ({ allowed: true, scope });
450
+ const deny = (scope = narrow[0]) => ({ allowed: false, denial: SCOPE_DENIALS[scope], scope: { scopes: [] } });
451
+ if (!source || "self" in source)
452
+ return pass({ scopes });
453
+ const actor = async () => ({
454
+ username: input.username,
455
+ kus: narrow.includes("own-KU") ? await input.kus() : [],
456
+ chairedKus: narrow.includes("chaired-KU") ? await input.chairedKus() : []
457
+ });
458
+ if ("list" in source) {
459
+ const value = source.list === null ? null : readPath$1(args, source.list);
460
+ const requested = value === void 0 || value === null || value === "" ? null : String(value);
461
+ if (wide)
462
+ return pass({ scopes, kus: requested ? [requested] : null });
463
+ const kuScope = narrow.find((scope) => scope === "own-KU" || scope === "chaired-KU");
464
+ if (!kuScope)
465
+ return pass({ scopes });
466
+ const { kus, chairedKus } = await actor();
467
+ const own = unique([...kus, ...chairedKus]);
468
+ if (requested && !own.includes(requested))
469
+ return deny(kuScope);
470
+ return pass({ scopes, kus: requested ? [requested] : own });
471
+ }
472
+ if (wide)
473
+ return pass({ scopes });
474
+ let facts;
475
+ if ("owner" in source) {
476
+ const value = readPath$1(args, source.owner);
477
+ facts = [value === void 0 || value === null || value === "" ? {} : { owner: String(value) }];
478
+ } else if ("ku" in source) {
479
+ const value = readPath$1(args, source.ku);
480
+ facts = value === void 0 || value === null ? [] : [{ ku: String(value) }];
481
+ } else {
482
+ const value = readPath$1(args, source.id);
483
+ const ids = (Array.isArray(value) ? value : [value]).filter((id) => id !== void 0 && id !== null).map(String);
484
+ facts = ids.length > 0 ? await input.locate(source.of, ids) : [];
485
+ }
486
+ if (facts.length === 0)
487
+ return pass({ scopes: [] });
488
+ const who = await actor();
489
+ const matched = facts.map((one) => scopesMatched(resource, narrow, who, one));
490
+ const any = "of" in source && source.match === "any";
491
+ const allowed = any ? matched.some((list) => list.length > 0) : matched.every((list) => list.length > 0);
492
+ if (!allowed)
493
+ return deny();
494
+ return pass({ scopes: unique(matched.flat()) });
495
+ }
496
+ const GRANTED_SCOPE_KEY = "grantedScope";
497
+ const GrantedScope = common.createParamDecorator((_data, context) => {
498
+ const request = graphql.GqlExecutionContext.create(context).getContext().req;
499
+ return request?.[GRANTED_SCOPE_KEY] ?? { scopes: [] };
500
+ });
501
+
502
+ var __defProp$p = Object.defineProperty;
503
+ var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
504
+ var __decorateClass$p = (decorators, target, key, kind) => {
505
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
356
506
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
357
507
  if (decorator = decorators[i])
358
508
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
359
509
  if (kind && result)
360
- __defProp$f(target, key, result);
510
+ __defProp$p(target, key, result);
511
+ return result;
512
+ };
513
+ var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
514
+ const APP_RIGHTS = Symbol("APP_RIGHTS");
515
+ function councilRolesOf(role) {
516
+ const core = String(role ?? "").toLowerCase();
517
+ if (core === "chairman")
518
+ return ["council", "chairman"];
519
+ if (core === "member")
520
+ return ["council"];
521
+ return [];
522
+ }
523
+ const ACCEPTED_STATUS = "active";
524
+ function memberRolesOf(caller) {
525
+ const accepted = caller.status === ACCEPTED_STATUS ? ["participant"] : [];
526
+ return [...accepted, ...councilRolesOf(caller.role)];
527
+ }
528
+ const NO_RIGHT = "KIT_INSUFFICIENT_RIGHTS";
529
+ function conditionOrder(def) {
530
+ return Object.keys(def.conditionDenials ?? {});
531
+ }
532
+ async function grantedActions(def, caller, roles, resource, actions) {
533
+ const lazy = new Set(def.lazyConditions ?? []);
534
+ const held = /* @__PURE__ */ new Set();
535
+ const read = /* @__PURE__ */ new Set();
536
+ const resolve = async (wanted) => {
537
+ const fresh = wanted.filter((condition) => !read.has(condition));
538
+ if (fresh.length === 0 || !def.conditions)
539
+ return;
540
+ fresh.forEach((condition) => read.add(condition));
541
+ for (const condition of await def.conditions(caller, roles, fresh))
542
+ held.add(condition);
543
+ };
544
+ const granted = [];
545
+ const unmet = [];
546
+ for (const action of actions) {
547
+ const rows = rightGrants(def.table, roles, resource, action);
548
+ if (rows.length === 0)
549
+ continue;
550
+ const satisfied = () => rows.filter((row) => row.when.every((condition) => held.has(condition)));
551
+ const settled = rows.some((row) => row.when.length === 0) && !rows.some((row) => row.wide);
552
+ if (!settled) {
553
+ await resolve(rows.flatMap((row) => row.when).filter((condition) => !lazy.has(condition)));
554
+ if (satisfied().length === 0) {
555
+ const worth = rows.filter((row) => row.when.every((condition) => lazy.has(condition) || held.has(condition)));
556
+ await resolve(worth.flatMap((row) => row.when).filter((condition) => lazy.has(condition)));
557
+ }
558
+ }
559
+ const ok = satisfied();
560
+ if (ok.length > 0)
561
+ granted.push({ action, wide: ok.some((row) => row.wide) });
562
+ else
563
+ unmet.push(...rows.map((row) => row.when.filter((condition) => !held.has(condition))));
564
+ }
565
+ if (granted.length > 0 || unmet.length === 0)
566
+ return { granted };
567
+ const nearest = [...unmet].sort((a, b) => a.length - b.length)[0];
568
+ const order = conditionOrder(def);
569
+ return { granted, missing: order.find((condition) => nearest.includes(condition)) ?? nearest[0] };
570
+ }
571
+ async function checkRight(def, caller, roles, requirement, args) {
572
+ const actions = Array.isArray(requirement.action) ? requirement.action : [requirement.action];
573
+ const { granted, missing } = await grantedActions(def, caller, roles, requirement.resource, actions);
574
+ if (granted.length === 0) {
575
+ if (missing === void 0)
576
+ return { allowed: false, reason: "right", denial: NO_RIGHT };
577
+ return { allowed: false, reason: "condition", denial: def.conditionDenials?.[missing] ?? NO_RIGHT };
578
+ }
579
+ const scope = await checkRightScope({
580
+ resource: requirement.resource,
581
+ granted,
582
+ source: requirement.source,
583
+ implied: def.impliedScopes,
584
+ args,
585
+ username: caller.username,
586
+ kus: async () => def.kus ? def.kus(caller.username) : [],
587
+ chairedKus: async () => def.chairedKus ? def.chairedKus(caller.username) : [],
588
+ locate: async (kind, ids) => def.locate ? def.locate(kind, ids) : []
589
+ });
590
+ if (!scope.allowed)
591
+ return { allowed: false, reason: "scope", denial: scope.denial ?? NO_RIGHT };
592
+ return { allowed: true, scope: scope.scope };
593
+ }
594
+ function allConditions(table) {
595
+ const out = /* @__PURE__ */ new Set();
596
+ for (const groups of Object.values(table))
597
+ for (const group of groups)
598
+ group.when.forEach((condition) => out.add(condition));
599
+ return [...out];
600
+ }
601
+ async function desktopGrants(def, caller, config) {
602
+ const roles = await def.roles(caller);
603
+ if (roles.length === 0)
604
+ return [];
605
+ const wanted = allConditions(def.table);
606
+ const held = def.conditions && wanted.length > 0 ? await def.conditions(caller, roles, wanted, config) : /* @__PURE__ */ new Set();
607
+ const grants = new Set(expandRights(rightsHeld(def.table, roles, held)));
608
+ for (const extra of def.extraGrants?.(caller, roles, held) ?? [])
609
+ grants.add(extra);
610
+ return [...grants];
611
+ }
612
+ function desktopGrantsOf(def) {
613
+ return {
614
+ extensionName: def.extensionName,
615
+ resolveGrants: async (ctx) => {
616
+ const open = def.publicGrants ?? [];
617
+ if (!ctx.username)
618
+ return [...open];
619
+ const held = await desktopGrants(def, { username: ctx.username, role: ctx.userRole, status: ctx.userStatus }, ctx.config ?? null);
620
+ return open.length > 0 ? [.../* @__PURE__ */ new Set([...open, ...held])] : held;
621
+ }
622
+ };
623
+ }
624
+ exports.RightsGuard = class RightsGuard {
625
+ constructor(reflector, def) {
626
+ this.reflector = reflector;
627
+ this.def = def;
628
+ this.logger = new common.Logger(exports.RightsGuard.name);
629
+ }
630
+ async canActivate(context) {
631
+ const requirement = this.reflector.getAllAndOverride(RIGHT_METADATA_KEY, [
632
+ context.getHandler(),
633
+ context.getClass()
634
+ ]);
635
+ if (!requirement)
636
+ return true;
637
+ const gql = graphql.GqlExecutionContext.create(context);
638
+ const request = gql.getContext()?.req;
639
+ if (hasServerSecret(request?.headers)) {
640
+ const everything = { scopes: ["all"], kus: null };
641
+ if (request)
642
+ request[GRANTED_SCOPE_KEY] = everything;
643
+ return true;
644
+ }
645
+ const user = request?.user;
646
+ if (!user?.username)
647
+ throw DomainError.unauthorized("KIT_USER_NOT_AUTHORIZED");
648
+ const caller = { username: user.username, role: user.role, status: user.status };
649
+ const roles = await this.def.roles(caller, request);
650
+ const outcome = await checkRight(this.def, caller, roles, requirement, gql.getArgs() ?? {});
651
+ if (!outcome.allowed) {
652
+ const actions = Array.isArray(requirement.action) ? requirement.action.join("|") : requirement.action;
653
+ this.logger.warn(
654
+ `forbidden-attempt: member=${caller.username} extension=${this.def.extensionName} operation=${context.getClass()?.name}.${context.getHandler()?.name} right=${requirement.resource}:${actions} reason=${outcome.reason} denial=${outcome.denial} roles=[${roles.join(", ")}]`
655
+ );
656
+ throw DomainError.forbidden(outcome.denial);
657
+ }
658
+ request[GRANTED_SCOPE_KEY] = outcome.scope;
659
+ return true;
660
+ }
661
+ };
662
+ exports.RightsGuard = __decorateClass$p([
663
+ common.Injectable(),
664
+ __decorateParam(0, common.Inject(core.Reflector)),
665
+ __decorateParam(1, common.Inject(APP_RIGHTS))
666
+ ], exports.RightsGuard);
667
+
668
+ var __defProp$o = Object.defineProperty;
669
+ var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
670
+ var __decorateClass$o = (decorators, target, key, kind) => {
671
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
672
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
673
+ if (decorator = decorators[i])
674
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
675
+ if (kind && result)
676
+ __defProp$o(target, key, result);
361
677
  return result;
362
678
  };
363
679
  exports.BaseExtensionModule = class BaseExtensionModule {
@@ -368,34 +684,34 @@ exports.BaseExtensionModule = class BaseExtensionModule {
368
684
  async onModuleInit() {
369
685
  }
370
686
  };
371
- exports.BaseExtensionModule = __decorateClass$f([
687
+ exports.BaseExtensionModule = __decorateClass$o([
372
688
  common.Injectable()
373
689
  ], exports.BaseExtensionModule);
374
690
 
375
- var __defProp$e = Object.defineProperty;
376
- var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
377
- var __decorateClass$e = (decorators, target, key, kind) => {
378
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
691
+ var __defProp$n = Object.defineProperty;
692
+ var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
693
+ var __decorateClass$n = (decorators, target, key, kind) => {
694
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
379
695
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
380
696
  if (decorator = decorators[i])
381
697
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
382
698
  if (kind && result)
383
- __defProp$e(target, key, result);
699
+ __defProp$n(target, key, result);
384
700
  return result;
385
701
  };
386
702
  exports.PaymentProvider = class PaymentProvider extends exports.BaseExtensionModule {
387
703
  };
388
- exports.PaymentProvider = __decorateClass$e([
704
+ exports.PaymentProvider = __decorateClass$n([
389
705
  common.Injectable()
390
706
  ], exports.PaymentProvider);
391
707
  exports.PollingProvider = class PollingProvider extends exports.PaymentProvider {
392
708
  };
393
- exports.PollingProvider = __decorateClass$e([
709
+ exports.PollingProvider = __decorateClass$n([
394
710
  common.Injectable()
395
711
  ], exports.PollingProvider);
396
712
  exports.IPNProvider = class IPNProvider extends exports.PaymentProvider {
397
713
  };
398
- exports.IPNProvider = __decorateClass$e([
714
+ exports.IPNProvider = __decorateClass$n([
399
715
  common.Injectable()
400
716
  ], exports.IPNProvider);
401
717
 
@@ -454,48 +770,48 @@ function bucketProvidersFor(fileStoragePortToken, consumers) {
454
770
  });
455
771
  }
456
772
 
457
- var __defProp$d = Object.defineProperty;
458
- var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
459
- var __decorateClass$d = (decorators, target, key, kind) => {
460
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
773
+ var __defProp$m = Object.defineProperty;
774
+ var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
775
+ var __decorateClass$m = (decorators, target, key, kind) => {
776
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
461
777
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
462
778
  if (decorator = decorators[i])
463
779
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
464
780
  if (kind && result)
465
- __defProp$d(target, key, result);
781
+ __defProp$m(target, key, result);
466
782
  return result;
467
783
  };
468
784
  exports.SignatureInfoInputDTO = class SignatureInfoInputDTO {
469
785
  };
470
- __decorateClass$d([
786
+ __decorateClass$m([
471
787
  graphql.Field(() => Number, { description: "\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u043D\u043E\u043C\u0435\u0440\u0430 \u043F\u043E\u0434\u043F\u0438\u0441\u0438" }),
472
788
  classValidator.IsNumber()
473
789
  ], exports.SignatureInfoInputDTO.prototype, "id", 2);
474
- __decorateClass$d([
790
+ __decorateClass$m([
475
791
  graphql.Field(() => String, { description: "\u0410\u043A\u043A\u0430\u0443\u043D\u0442 \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u0432\u0448\u0435\u0433\u043E" }),
476
792
  classValidator.IsString()
477
793
  ], exports.SignatureInfoInputDTO.prototype, "signer", 2);
478
- __decorateClass$d([
794
+ __decorateClass$m([
479
795
  graphql.Field(() => String, { description: "\u041F\u0443\u0431\u043B\u0438\u0447\u043D\u044B\u0439 \u043A\u043B\u044E\u0447" }),
480
796
  classValidator.IsString()
481
797
  ], exports.SignatureInfoInputDTO.prototype, "public_key", 2);
482
- __decorateClass$d([
798
+ __decorateClass$m([
483
799
  graphql.Field(() => String, { description: "\u041F\u043E\u0434\u043F\u0438\u0441\u044C \u0445\u044D\u0448\u0430" }),
484
800
  classValidator.IsString()
485
801
  ], exports.SignatureInfoInputDTO.prototype, "signature", 2);
486
- __decorateClass$d([
802
+ __decorateClass$m([
487
803
  graphql.Field(() => String, { description: "\u0412\u0440\u0435\u043C\u044F \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0438\u044F" }),
488
804
  classValidator.IsString()
489
805
  ], exports.SignatureInfoInputDTO.prototype, "signed_at", 2);
490
- __decorateClass$d([
806
+ __decorateClass$m([
491
807
  graphql.Field(() => String, { description: "\u041F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u043D\u044B\u0439 \u0445\u044D\u0448" }),
492
808
  classValidator.IsString()
493
809
  ], exports.SignatureInfoInputDTO.prototype, "signed_hash", 2);
494
- __decorateClass$d([
810
+ __decorateClass$m([
495
811
  graphql.Field(() => String, { description: "\u041C\u0435\u0442\u0430-\u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u043E\u0434\u043F\u0438\u0441\u0438" }),
496
812
  classValidator.IsString()
497
813
  ], exports.SignatureInfoInputDTO.prototype, "meta", 2);
498
- exports.SignatureInfoInputDTO = __decorateClass$d([
814
+ exports.SignatureInfoInputDTO = __decorateClass$m([
499
815
  graphql.InputType("SignatureInfoInput")
500
816
  ], exports.SignatureInfoInputDTO);
501
817
  exports.SignedDigitalDocumentInputDTO = class SignedDigitalDocumentInputDTO {
@@ -516,33 +832,33 @@ exports.SignedDigitalDocumentInputDTO = class SignedDigitalDocumentInputDTO {
516
832
  };
517
833
  }
518
834
  };
519
- __decorateClass$d([
835
+ __decorateClass$m([
520
836
  graphql.Field(() => String, { description: "\u0412\u0435\u0440\u0441\u0438\u044F \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u0430 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" }),
521
837
  classValidator.IsString()
522
838
  ], exports.SignedDigitalDocumentInputDTO.prototype, "version", 2);
523
- __decorateClass$d([
839
+ __decorateClass$m([
524
840
  graphql.Field(() => String, { description: "\u041E\u0431\u0449\u0438\u0439 \u0445\u044D\u0448 (doc_hash + meta_hash)" }),
525
841
  classValidator.IsString()
526
842
  ], exports.SignedDigitalDocumentInputDTO.prototype, "hash", 2);
527
- __decorateClass$d([
843
+ __decorateClass$m([
528
844
  graphql.Field(() => String, { description: "\u0425\u044D\u0448 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0433\u043E \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" }),
529
845
  classValidator.IsString()
530
846
  ], exports.SignedDigitalDocumentInputDTO.prototype, "doc_hash", 2);
531
- __decorateClass$d([
847
+ __decorateClass$m([
532
848
  graphql.Field(() => String, { description: "\u0425\u044D\u0448 \u043C\u0435\u0442\u0430-\u0434\u0430\u043D\u043D\u044B\u0445" }),
533
849
  classValidator.IsString()
534
850
  ], exports.SignedDigitalDocumentInputDTO.prototype, "meta_hash", 2);
535
- __decorateClass$d([
536
- graphql.Field(() => graphqlTypeJson.GraphQLJSON, { description: "\u041C\u0435\u0442\u0430\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" })
851
+ __decorateClass$m([
852
+ graphql.Field(() => GraphQLJSON.GraphQLJSON, { description: "\u041C\u0435\u0442\u0430\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" })
537
853
  ], exports.SignedDigitalDocumentInputDTO.prototype, "meta", 2);
538
- __decorateClass$d([
854
+ __decorateClass$m([
539
855
  graphql.Field(() => [exports.SignatureInfoInputDTO], { description: "\u0412\u0435\u043A\u0442\u043E\u0440 \u043F\u043E\u0434\u043F\u0438\u0441\u0435\u0439" }),
540
856
  classValidator.IsArray(),
541
857
  classValidator.ArrayMinSize(1),
542
858
  classValidator.ValidateNested({ each: true }),
543
859
  classTransformer.Type(() => exports.SignatureInfoInputDTO)
544
860
  ], exports.SignedDigitalDocumentInputDTO.prototype, "signatures", 2);
545
- exports.SignedDigitalDocumentInputDTO = __decorateClass$d([
861
+ exports.SignedDigitalDocumentInputDTO = __decorateClass$m([
546
862
  graphql.InputType("SignedDigitalDocumentInput")
547
863
  ], exports.SignedDigitalDocumentInputDTO);
548
864
 
@@ -555,186 +871,186 @@ graphql.registerEnumType(LangType, {
555
871
  description: "\u042F\u0437\u044B\u043A \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430"
556
872
  });
557
873
 
558
- var __defProp$c = Object.defineProperty;
559
- var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
560
- var __decorateClass$c = (decorators, target, key, kind) => {
561
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
874
+ var __defProp$l = Object.defineProperty;
875
+ var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
876
+ var __decorateClass$l = (decorators, target, key, kind) => {
877
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target;
562
878
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
563
879
  if (decorator = decorators[i])
564
880
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
565
881
  if (kind && result)
566
- __defProp$c(target, key, result);
882
+ __defProp$l(target, key, result);
567
883
  return result;
568
884
  };
569
885
  exports.MetaDocumentInputDTO = class MetaDocumentInputDTO {
570
886
  };
571
- __decorateClass$c([
887
+ __decorateClass$l([
572
888
  graphql.Field(() => String, { description: "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" }),
573
889
  classValidator.IsString()
574
890
  ], exports.MetaDocumentInputDTO.prototype, "title", 2);
575
- __decorateClass$c([
891
+ __decorateClass$l([
576
892
  graphql.Field(() => graphql.Int, { description: "ID \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435" }),
577
893
  classValidator.IsNumber()
578
894
  ], exports.MetaDocumentInputDTO.prototype, "registry_id", 2);
579
- __decorateClass$c([
895
+ __decorateClass$l([
580
896
  graphql.Field(() => String, { description: "\u042F\u0437\u044B\u043A \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" }),
581
897
  classValidator.IsEnum(LangType)
582
898
  ], exports.MetaDocumentInputDTO.prototype, "lang", 2);
583
- __decorateClass$c([
899
+ __decorateClass$l([
584
900
  graphql.Field(() => String, { description: "\u0418\u043C\u044F \u0433\u0435\u043D\u0435\u0440\u0430\u0442\u043E\u0440\u0430, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E \u0434\u043B\u044F \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" }),
585
901
  classValidator.IsString()
586
902
  ], exports.MetaDocumentInputDTO.prototype, "generator", 2);
587
- __decorateClass$c([
903
+ __decorateClass$l([
588
904
  graphql.Field(() => String, { description: "\u0412\u0435\u0440\u0441\u0438\u044F \u0433\u0435\u043D\u0435\u0440\u0430\u0442\u043E\u0440\u0430, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E \u0434\u043B\u044F \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" }),
589
905
  classValidator.IsString()
590
906
  ], exports.MetaDocumentInputDTO.prototype, "version", 2);
591
- __decorateClass$c([
907
+ __decorateClass$l([
592
908
  graphql.Field(() => String, { description: "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043A\u043E\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u0430, \u0441\u0432\u044F\u0437\u0430\u043D\u043D\u043E\u0435 \u0441 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u043C" }),
593
909
  classValidator.IsString()
594
910
  ], exports.MetaDocumentInputDTO.prototype, "coopname", 2);
595
- __decorateClass$c([
911
+ __decorateClass$l([
596
912
  graphql.Field(() => String, { description: "\u0418\u043C\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F, \u0441\u043E\u0437\u0434\u0430\u0432\u0448\u0435\u0433\u043E \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442" }),
597
913
  classValidator.IsString()
598
914
  ], exports.MetaDocumentInputDTO.prototype, "username", 2);
599
- __decorateClass$c([
915
+ __decorateClass$l([
600
916
  graphql.Field(() => String, { description: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" }),
601
917
  classValidator.IsString()
602
918
  ], exports.MetaDocumentInputDTO.prototype, "created_at", 2);
603
- __decorateClass$c([
919
+ __decorateClass$l([
604
920
  graphql.Field(() => graphql.Int, { description: "\u041D\u043E\u043C\u0435\u0440 \u0431\u043B\u043E\u043A\u0430, \u043D\u0430 \u043A\u043E\u0442\u043E\u0440\u043E\u043C \u0431\u044B\u043B \u0441\u043E\u0437\u0434\u0430\u043D \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442" }),
605
921
  classValidator.IsInt()
606
922
  ], exports.MetaDocumentInputDTO.prototype, "block_num", 2);
607
- __decorateClass$c([
923
+ __decorateClass$l([
608
924
  graphql.Field(() => String, { description: "\u0427\u0430\u0441\u043E\u0432\u043E\u0439 \u043F\u043E\u044F\u0441, \u0432 \u043A\u043E\u0442\u043E\u0440\u043E\u043C \u0431\u044B\u043B \u0441\u043E\u0437\u0434\u0430\u043D \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442" }),
609
925
  classValidator.IsString()
610
926
  ], exports.MetaDocumentInputDTO.prototype, "timezone", 2);
611
- __decorateClass$c([
927
+ __decorateClass$l([
612
928
  graphql.Field(() => [String], { description: "\u0421\u0441\u044B\u043B\u043A\u0438, \u0441\u0432\u044F\u0437\u0430\u043D\u043D\u044B\u0435 \u0441 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u043C" }),
613
929
  classValidator.IsArray(),
614
930
  classValidator.IsString({ each: true })
615
931
  ], exports.MetaDocumentInputDTO.prototype, "links", 2);
616
- exports.MetaDocumentInputDTO = __decorateClass$c([
932
+ exports.MetaDocumentInputDTO = __decorateClass$l([
617
933
  graphql.InputType("MetaDocumentInput")
618
934
  ], exports.MetaDocumentInputDTO);
619
935
 
620
- var __defProp$b = Object.defineProperty;
621
- var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
622
- var __decorateClass$b = (decorators, target, key, kind) => {
623
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
936
+ var __defProp$k = Object.defineProperty;
937
+ var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
938
+ var __decorateClass$k = (decorators, target, key, kind) => {
939
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
624
940
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
625
941
  if (decorator = decorators[i])
626
942
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
627
943
  if (kind && result)
628
- __defProp$b(target, key, result);
944
+ __defProp$k(target, key, result);
629
945
  return result;
630
946
  };
631
947
  exports.GenerateMetaDocumentInputDTO = class GenerateMetaDocumentInputDTO {
632
948
  };
633
- __decorateClass$b([
949
+ __decorateClass$k([
634
950
  graphql.Field(() => String, { description: "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", nullable: true }),
635
951
  classValidator.IsOptional(),
636
952
  classValidator.IsString()
637
953
  ], exports.GenerateMetaDocumentInputDTO.prototype, "title", 2);
638
- __decorateClass$b([
954
+ __decorateClass$k([
639
955
  graphql.Field(() => graphql.Int, { description: "ID \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0432 \u0440\u0435\u0435\u0441\u0442\u0440\u0435" }),
640
956
  classValidator.IsNumber()
641
957
  ], exports.GenerateMetaDocumentInputDTO.prototype, "registry_id", 2);
642
- __decorateClass$b([
958
+ __decorateClass$k([
643
959
  graphql.Field(() => String, { description: "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043A\u043E\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u0430, \u0441\u0432\u044F\u0437\u0430\u043D\u043D\u043E\u0435 \u0441 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u043C" }),
644
960
  classValidator.IsString()
645
961
  ], exports.GenerateMetaDocumentInputDTO.prototype, "coopname", 2);
646
- __decorateClass$b([
962
+ __decorateClass$k([
647
963
  graphql.Field(() => String, { description: "\u0418\u043C\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F, \u0441\u043E\u0437\u0434\u0430\u0432\u0448\u0435\u0433\u043E \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442" }),
648
964
  classValidator.IsString()
649
965
  ], exports.GenerateMetaDocumentInputDTO.prototype, "username", 2);
650
- __decorateClass$b([
966
+ __decorateClass$k([
651
967
  graphql.Field(() => String, { description: "\u042F\u0437\u044B\u043A \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", nullable: true }),
652
968
  classValidator.IsOptional(),
653
969
  classValidator.IsEnum(LangType)
654
970
  ], exports.GenerateMetaDocumentInputDTO.prototype, "lang", 2);
655
- __decorateClass$b([
971
+ __decorateClass$k([
656
972
  graphql.Field(() => String, { description: "\u0418\u043C\u044F \u0433\u0435\u043D\u0435\u0440\u0430\u0442\u043E\u0440\u0430, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E \u0434\u043B\u044F \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", nullable: true }),
657
973
  classValidator.IsOptional(),
658
974
  classValidator.IsString()
659
975
  ], exports.GenerateMetaDocumentInputDTO.prototype, "generator", 2);
660
- __decorateClass$b([
976
+ __decorateClass$k([
661
977
  graphql.Field(() => String, { description: "\u0412\u0435\u0440\u0441\u0438\u044F \u0433\u0435\u043D\u0435\u0440\u0430\u0442\u043E\u0440\u0430, \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u043D\u043E\u0433\u043E \u0434\u043B\u044F \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", nullable: true }),
662
978
  classValidator.IsOptional(),
663
979
  classValidator.IsString()
664
980
  ], exports.GenerateMetaDocumentInputDTO.prototype, "version", 2);
665
- __decorateClass$b([
981
+ __decorateClass$k([
666
982
  graphql.Field(() => String, { description: "\u0414\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430", nullable: true }),
667
983
  classValidator.IsOptional()
668
984
  ], exports.GenerateMetaDocumentInputDTO.prototype, "created_at", 2);
669
- __decorateClass$b([
985
+ __decorateClass$k([
670
986
  graphql.Field(() => graphql.Int, { description: "\u041D\u043E\u043C\u0435\u0440 \u0431\u043B\u043E\u043A\u0430, \u043D\u0430 \u043A\u043E\u0442\u043E\u0440\u043E\u043C \u0431\u044B\u043B \u0441\u043E\u0437\u0434\u0430\u043D \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442", nullable: true }),
671
987
  classValidator.IsOptional(),
672
988
  classValidator.IsInt()
673
989
  ], exports.GenerateMetaDocumentInputDTO.prototype, "block_num", 2);
674
- __decorateClass$b([
990
+ __decorateClass$k([
675
991
  graphql.Field(() => String, { description: "\u0427\u0430\u0441\u043E\u0432\u043E\u0439 \u043F\u043E\u044F\u0441, \u0432 \u043A\u043E\u0442\u043E\u0440\u043E\u043C \u0431\u044B\u043B \u0441\u043E\u0437\u0434\u0430\u043D \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442", nullable: true }),
676
992
  classValidator.IsOptional(),
677
993
  classValidator.IsString()
678
994
  ], exports.GenerateMetaDocumentInputDTO.prototype, "timezone", 2);
679
- __decorateClass$b([
995
+ __decorateClass$k([
680
996
  graphql.Field(() => [String], { description: "\u0421\u0441\u044B\u043B\u043A\u0438, \u0441\u0432\u044F\u0437\u0430\u043D\u043D\u044B\u0435 \u0441 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u043C", nullable: true }),
681
997
  classValidator.IsOptional(),
682
998
  classValidator.IsArray(),
683
999
  classValidator.IsString({ each: true })
684
1000
  ], exports.GenerateMetaDocumentInputDTO.prototype, "links", 2);
685
- exports.GenerateMetaDocumentInputDTO = __decorateClass$b([
1001
+ exports.GenerateMetaDocumentInputDTO = __decorateClass$k([
686
1002
  graphql.InputType("GenerateMetaDocumentInput")
687
1003
  ], exports.GenerateMetaDocumentInputDTO);
688
1004
 
689
- var __defProp$a = Object.defineProperty;
690
- var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
691
- var __decorateClass$a = (decorators, target, key, kind) => {
692
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
1005
+ var __defProp$j = Object.defineProperty;
1006
+ var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
1007
+ var __decorateClass$j = (decorators, target, key, kind) => {
1008
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
693
1009
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
694
1010
  if (decorator = decorators[i])
695
1011
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
696
1012
  if (kind && result)
697
- __defProp$a(target, key, result);
1013
+ __defProp$j(target, key, result);
698
1014
  return result;
699
1015
  };
700
1016
  let ExpenseProposalItemInputDTO = class {
701
1017
  };
702
- __decorateClass$a([
1018
+ __decorateClass$j([
703
1019
  graphql.Field(() => String, { description: "\u041F\u043E\u0440\u044F\u0434\u043A\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u0441\u0442\u0440\u043E\u043A\u0438" }),
704
1020
  classValidator.IsString()
705
1021
  ], ExpenseProposalItemInputDTO.prototype, "number", 2);
706
- __decorateClass$a([
1022
+ __decorateClass$j([
707
1023
  graphql.Field(() => String, { description: "\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0440\u0430\u0441\u0445\u043E\u0434\u0430" }),
708
1024
  classValidator.IsString()
709
1025
  ], ExpenseProposalItemInputDTO.prototype, "description", 2);
710
- __decorateClass$a([
1026
+ __decorateClass$j([
711
1027
  graphql.Field(() => String, { description: "\u0421\u0443\u043C\u043C\u0430 \u0441\u0442\u0440\u043E\u043A\u0438" }),
712
1028
  classValidator.IsString()
713
1029
  ], ExpenseProposalItemInputDTO.prototype, "amount", 2);
714
- __decorateClass$a([
1030
+ __decorateClass$j([
715
1031
  graphql.Field(() => String, { description: "\u0422\u0438\u043F \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u0435\u043B\u044F (SELF / MEMBER / ORG)" }),
716
1032
  classValidator.IsString()
717
1033
  ], ExpenseProposalItemInputDTO.prototype, "recipient_type", 2);
718
- __decorateClass$a([
1034
+ __decorateClass$j([
719
1035
  graphql.Field(() => String, { description: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043E\u043F\u043B\u0430\u0442\u044B (ADVANCE / DIRECT)" }),
720
1036
  classValidator.IsString()
721
1037
  ], ExpenseProposalItemInputDTO.prototype, "mechanics", 2);
722
- __decorateClass$a([
1038
+ __decorateClass$j([
723
1039
  graphql.Field(() => String, { description: "\u0418\u043C\u044F \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u0435\u043B\u044F", nullable: true }),
724
1040
  classValidator.IsOptional(),
725
1041
  classValidator.IsString()
726
1042
  ], ExpenseProposalItemInputDTO.prototype, "recipient_name", 2);
727
- __decorateClass$a([
1043
+ __decorateClass$j([
728
1044
  graphql.Field(() => String, { description: "\u0420\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u0435\u043B\u044F", nullable: true }),
729
1045
  classValidator.IsOptional(),
730
1046
  classValidator.IsString()
731
1047
  ], ExpenseProposalItemInputDTO.prototype, "requisites", 2);
732
- __decorateClass$a([
1048
+ __decorateClass$j([
733
1049
  graphql.Field(() => String, { description: "\u041D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043F\u043B\u0430\u0442\u0435\u0436\u0430 \u2014 \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u043E\u0439 \u0441\u0442\u0440\u043E\u043A\u043E\u0439 \u043F\u043E\u0441\u043B\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u043E\u0432", nullable: true }),
734
1050
  classValidator.IsOptional(),
735
1051
  classValidator.IsString()
736
1052
  ], ExpenseProposalItemInputDTO.prototype, "payment_purpose", 2);
737
- __decorateClass$a([
1053
+ __decorateClass$j([
738
1054
  graphql.Field(() => String, {
739
1055
  description: "\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0441\u043E\u0445\u0440\u0430\u043D\u0451\u043D\u043D\u044B\u0445 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u043E\u0432 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u0435\u043B\u044F-\u043F\u0430\u0439\u0449\u0438\u043A\u0430 \u2014 \u0441\u0435\u0440\u0432\u0435\u0440 \u043F\u043E\u0434\u0441\u0442\u0430\u0432\u0438\u0442 \u043F\u043E\u043B\u043D\u044B\u0435 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B \u0432 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442.",
740
1056
  nullable: true
@@ -742,7 +1058,7 @@ __decorateClass$a([
742
1058
  classValidator.IsOptional(),
743
1059
  classValidator.IsString()
744
1060
  ], ExpenseProposalItemInputDTO.prototype, "payment_method_id", 2);
745
- __decorateClass$a([
1061
+ __decorateClass$j([
746
1062
  graphql.Field(() => String, {
747
1063
  description: "\u0418\u043C\u044F \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0430 \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u0435\u043B\u044F-\u043F\u0430\u0439\u0449\u0438\u043A\u0430 (\u0432\u043B\u0430\u0434\u0435\u043B\u0435\u0446 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u043E\u0432).",
748
1064
  nullable: true
@@ -750,60 +1066,60 @@ __decorateClass$a([
750
1066
  classValidator.IsOptional(),
751
1067
  classValidator.IsString()
752
1068
  ], ExpenseProposalItemInputDTO.prototype, "recipient_username", 2);
753
- ExpenseProposalItemInputDTO = __decorateClass$a([
1069
+ ExpenseProposalItemInputDTO = __decorateClass$j([
754
1070
  graphql.InputType("ExpenseProposalItemInput")
755
1071
  ], ExpenseProposalItemInputDTO);
756
1072
  let ExpenseProposalSignedItemInputDTO = class {
757
1073
  };
758
- __decorateClass$a([
1074
+ __decorateClass$j([
759
1075
  graphql.Field(() => String, { description: "\u041F\u043E\u0440\u044F\u0434\u043A\u043E\u0432\u044B\u0439 \u043D\u043E\u043C\u0435\u0440 \u0441\u0442\u0440\u043E\u043A\u0438" }),
760
1076
  classValidator.IsString()
761
1077
  ], ExpenseProposalSignedItemInputDTO.prototype, "number", 2);
762
- __decorateClass$a([
1078
+ __decorateClass$j([
763
1079
  graphql.Field(() => String, { description: "\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0440\u0430\u0441\u0445\u043E\u0434\u0430" }),
764
1080
  classValidator.IsString()
765
1081
  ], ExpenseProposalSignedItemInputDTO.prototype, "description", 2);
766
- __decorateClass$a([
1082
+ __decorateClass$j([
767
1083
  graphql.Field(() => String, { description: "\u0421\u0443\u043C\u043C\u0430 \u0441\u0442\u0440\u043E\u043A\u0438" }),
768
1084
  classValidator.IsString()
769
1085
  ], ExpenseProposalSignedItemInputDTO.prototype, "amount", 2);
770
- __decorateClass$a([
1086
+ __decorateClass$j([
771
1087
  graphql.Field(() => String, { description: "\u0422\u0438\u043F \u043F\u043E\u043B\u0443\u0447\u0430\u0442\u0435\u043B\u044F (SELF / MEMBER / ORG)" }),
772
1088
  classValidator.IsString()
773
1089
  ], ExpenseProposalSignedItemInputDTO.prototype, "recipient_type", 2);
774
- __decorateClass$a([
1090
+ __decorateClass$j([
775
1091
  graphql.Field(() => String, { description: "\u0421\u043F\u043E\u0441\u043E\u0431 \u043E\u043F\u043B\u0430\u0442\u044B (ADVANCE / DIRECT)" }),
776
1092
  classValidator.IsString()
777
1093
  ], ExpenseProposalSignedItemInputDTO.prototype, "mechanics", 2);
778
- ExpenseProposalSignedItemInputDTO = __decorateClass$a([
1094
+ ExpenseProposalSignedItemInputDTO = __decorateClass$j([
779
1095
  graphql.InputType("ExpenseProposalSignedItemInput")
780
1096
  ], ExpenseProposalSignedItemInputDTO);
781
1097
  let ExpenseProposalHeaderInputDTO = class {
782
1098
  };
783
- __decorateClass$a([
1099
+ __decorateClass$j([
784
1100
  graphql.Field(() => String, { description: "\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0446\u0435\u043B\u0438 \u0440\u0430\u0441\u0445\u043E\u0434\u043E\u0432" }),
785
1101
  classValidator.IsString()
786
1102
  ], ExpenseProposalHeaderInputDTO.prototype, "description", 2);
787
- __decorateClass$a([
1103
+ __decorateClass$j([
788
1104
  graphql.Field(() => String, { description: "\u0418\u0442\u043E\u0433\u043E\u0432\u0430\u044F \u0441\u0443\u043C\u043C\u0430 \u0440\u0430\u0441\u0445\u043E\u0434\u043E\u0432" }),
789
1105
  classValidator.IsString()
790
1106
  ], ExpenseProposalHeaderInputDTO.prototype, "total_amount", 2);
791
- __decorateClass$a([
1107
+ __decorateClass$j([
792
1108
  graphql.Field(() => graphql.Int, { description: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u043E\u0437\u0438\u0446\u0438\u0439" }),
793
1109
  classValidator.IsInt()
794
1110
  ], ExpenseProposalHeaderInputDTO.prototype, "items_count", 2);
795
- __decorateClass$a([
1111
+ __decorateClass$j([
796
1112
  graphql.Field(() => String, { description: "\u041A\u043E\u0448\u0435\u043B\u0451\u043A-\u0438\u0441\u0442\u043E\u0447\u043D\u0438\u043A" }),
797
1113
  classValidator.IsString()
798
1114
  ], ExpenseProposalHeaderInputDTO.prototype, "source_wallet", 2);
799
- __decorateClass$a([
1115
+ __decorateClass$j([
800
1116
  graphql.Field(() => String, { description: "\u0421\u0440\u043E\u043A \u0438\u0441\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F (\xAB\u0432 \u0441\u0440\u043E\u043A \u0434\u043E\xBB), \u0444\u043E\u0440\u043C\u0430\u0442 DD.MM.YYYY" }),
801
1117
  classValidator.IsString(),
802
1118
  classValidator.Matches(/^\d{2}\.\d{2}\.\d{4}$/, {
803
1119
  message: validationMessage("kit.expenseStatement.dueDateFormat")
804
1120
  })
805
1121
  ], ExpenseProposalHeaderInputDTO.prototype, "deadline", 2);
806
- __decorateClass$a([
1122
+ __decorateClass$j([
807
1123
  graphql.Field(() => String, {
808
1124
  description: "\u0424\u043E\u043D\u0434 \u0441\u043F\u0438\u0441\u0430\u043D\u0438\u044F \u2014 \u043F\u043E\u0434\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0441\u0435\u0440\u0432\u0435\u0440\u043E\u043C \u0438\u0437 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u043E\u0432 \u0448\u0430\u0441\u0441\u0438 \u0440\u0430\u0441\u0445\u043E\u0434\u043E\u0432, \u043F\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044C \u043D\u0435 \u043D\u0443\u0436\u043D\u043E",
809
1125
  nullable: true
@@ -811,56 +1127,56 @@ __decorateClass$a([
811
1127
  classValidator.IsOptional(),
812
1128
  classValidator.IsString()
813
1129
  ], ExpenseProposalHeaderInputDTO.prototype, "fund_name", 2);
814
- ExpenseProposalHeaderInputDTO = __decorateClass$a([
1130
+ ExpenseProposalHeaderInputDTO = __decorateClass$j([
815
1131
  graphql.InputType("ExpenseProposalHeaderInput")
816
1132
  ], ExpenseProposalHeaderInputDTO);
817
1133
  let BaseExpenseProposalStatementGenerateMetaDocumentInputDTO = class {
818
1134
  };
819
- __decorateClass$a([
1135
+ __decorateClass$j([
820
1136
  graphql.Field(() => String, { description: "\u0425\u0435\u0448 \u0441\u043C\u0435\u0442\u044B \u0440\u0430\u0441\u0445\u043E\u0434\u0430 (\u0434\u0435\u0442\u0435\u0440\u043C\u0438\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439)" }),
821
1137
  classValidator.IsString(),
822
1138
  classValidator.IsNotEmpty()
823
1139
  ], BaseExpenseProposalStatementGenerateMetaDocumentInputDTO.prototype, "proposal_hash", 2);
824
- __decorateClass$a([
1140
+ __decorateClass$j([
825
1141
  graphql.Field(() => ExpenseProposalHeaderInputDTO, { description: "\u0428\u0430\u043F\u043A\u0430 \u0421\u0417" }),
826
1142
  classValidator.ValidateNested(),
827
1143
  classTransformer.Type(() => ExpenseProposalHeaderInputDTO)
828
1144
  ], BaseExpenseProposalStatementGenerateMetaDocumentInputDTO.prototype, "proposal", 2);
829
- __decorateClass$a([
1145
+ __decorateClass$j([
830
1146
  graphql.Field(() => [ExpenseProposalItemInputDTO], { description: "\u041F\u043E\u0437\u0438\u0446\u0438\u0438 \u0440\u0430\u0441\u0445\u043E\u0434\u0430" }),
831
1147
  classValidator.IsArray(),
832
1148
  classValidator.ArrayMinSize(1),
833
1149
  classValidator.ValidateNested({ each: true }),
834
1150
  classTransformer.Type(() => ExpenseProposalItemInputDTO)
835
1151
  ], BaseExpenseProposalStatementGenerateMetaDocumentInputDTO.prototype, "items", 2);
836
- BaseExpenseProposalStatementGenerateMetaDocumentInputDTO = __decorateClass$a([
1152
+ BaseExpenseProposalStatementGenerateMetaDocumentInputDTO = __decorateClass$j([
837
1153
  graphql.InputType("BaseExpenseProposalStatementGenerateMetaDocumentInput")
838
1154
  ], BaseExpenseProposalStatementGenerateMetaDocumentInputDTO);
839
1155
  let BaseExpenseProposalStatementSignedMetaDocumentInputDTO = class {
840
1156
  };
841
- __decorateClass$a([
1157
+ __decorateClass$j([
842
1158
  graphql.Field(() => String, { description: "\u0425\u0435\u0448 \u0441\u043C\u0435\u0442\u044B \u0440\u0430\u0441\u0445\u043E\u0434\u0430 (\u0434\u0435\u0442\u0435\u0440\u043C\u0438\u043D\u0438\u0440\u043E\u0432\u0430\u043D\u043D\u044B\u0439)" }),
843
1159
  classValidator.IsString(),
844
1160
  classValidator.IsNotEmpty()
845
1161
  ], BaseExpenseProposalStatementSignedMetaDocumentInputDTO.prototype, "proposal_hash", 2);
846
- __decorateClass$a([
1162
+ __decorateClass$j([
847
1163
  graphql.Field(() => ExpenseProposalHeaderInputDTO, { description: "\u0428\u0430\u043F\u043A\u0430 \u0421\u0417" }),
848
1164
  classValidator.ValidateNested(),
849
1165
  classTransformer.Type(() => ExpenseProposalHeaderInputDTO)
850
1166
  ], BaseExpenseProposalStatementSignedMetaDocumentInputDTO.prototype, "proposal", 2);
851
- __decorateClass$a([
1167
+ __decorateClass$j([
852
1168
  graphql.Field(() => [ExpenseProposalSignedItemInputDTO], { description: "\u041F\u0443\u0431\u043B\u0438\u0447\u043D\u044B\u0435 \u043F\u043E\u0437\u0438\u0446\u0438\u0438 \u0440\u0430\u0441\u0445\u043E\u0434\u0430 (\u0431\u0435\u0437 \u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u043E\u0432)" }),
853
1169
  classValidator.IsArray(),
854
1170
  classValidator.ArrayMinSize(1),
855
1171
  classValidator.ValidateNested({ each: true }),
856
1172
  classTransformer.Type(() => ExpenseProposalSignedItemInputDTO)
857
1173
  ], BaseExpenseProposalStatementSignedMetaDocumentInputDTO.prototype, "items", 2);
858
- __decorateClass$a([
1174
+ __decorateClass$j([
859
1175
  graphql.Field(() => String, { description: "\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u043F\u0440\u0438\u0432\u0430\u0442\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 off-chain (\u0440\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B/\u0438\u043C\u044F/\u043D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435)" }),
860
1176
  classValidator.IsString(),
861
1177
  classValidator.IsNotEmpty()
862
1178
  ], BaseExpenseProposalStatementSignedMetaDocumentInputDTO.prototype, "doc_data_hash", 2);
863
- BaseExpenseProposalStatementSignedMetaDocumentInputDTO = __decorateClass$a([
1179
+ BaseExpenseProposalStatementSignedMetaDocumentInputDTO = __decorateClass$j([
864
1180
  graphql.InputType("BaseExpenseProposalStatementSignedMetaDocumentInput")
865
1181
  ], BaseExpenseProposalStatementSignedMetaDocumentInputDTO);
866
1182
  exports.ExpenseProposalStatementGenerateDocumentInputDTO = class ExpenseProposalStatementGenerateDocumentInputDTO extends graphql.IntersectionType(
@@ -868,7 +1184,7 @@ exports.ExpenseProposalStatementGenerateDocumentInputDTO = class ExpenseProposal
868
1184
  graphql.OmitType(exports.GenerateMetaDocumentInputDTO, ["registry_id"])
869
1185
  ) {
870
1186
  };
871
- exports.ExpenseProposalStatementGenerateDocumentInputDTO = __decorateClass$a([
1187
+ exports.ExpenseProposalStatementGenerateDocumentInputDTO = __decorateClass$j([
872
1188
  graphql.InputType("ExpenseProposalStatementGenerateDocumentInput")
873
1189
  ], exports.ExpenseProposalStatementGenerateDocumentInputDTO);
874
1190
  exports.ExpenseProposalStatementSignedMetaDocumentInputDTO = class ExpenseProposalStatementSignedMetaDocumentInputDTO extends graphql.IntersectionType(
@@ -876,29 +1192,29 @@ exports.ExpenseProposalStatementSignedMetaDocumentInputDTO = class ExpensePropos
876
1192
  exports.MetaDocumentInputDTO
877
1193
  ) {
878
1194
  };
879
- exports.ExpenseProposalStatementSignedMetaDocumentInputDTO = __decorateClass$a([
1195
+ exports.ExpenseProposalStatementSignedMetaDocumentInputDTO = __decorateClass$j([
880
1196
  graphql.InputType("ExpenseProposalStatementSignedMetaDocumentInput")
881
1197
  ], exports.ExpenseProposalStatementSignedMetaDocumentInputDTO);
882
1198
  exports.ExpenseProposalStatementSignedDocumentInputDTO = class ExpenseProposalStatementSignedDocumentInputDTO extends exports.SignedDigitalDocumentInputDTO {
883
1199
  };
884
- __decorateClass$a([
1200
+ __decorateClass$j([
885
1201
  graphql.Field(() => exports.ExpenseProposalStatementSignedMetaDocumentInputDTO, {
886
1202
  description: "\u041C\u0435\u0442\u0430\u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u0421\u0417-\u0437\u0430\u044F\u0432\u043B\u0435\u043D\u0438\u044F"
887
1203
  })
888
1204
  ], exports.ExpenseProposalStatementSignedDocumentInputDTO.prototype, "meta", 2);
889
- exports.ExpenseProposalStatementSignedDocumentInputDTO = __decorateClass$a([
1205
+ exports.ExpenseProposalStatementSignedDocumentInputDTO = __decorateClass$j([
890
1206
  graphql.InputType("ExpenseProposalStatementSignedDocumentInput")
891
1207
  ], exports.ExpenseProposalStatementSignedDocumentInputDTO);
892
1208
 
893
- var __defProp$9 = Object.defineProperty;
894
- var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
895
- var __decorateClass$9 = (decorators, target, key, kind) => {
896
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
1209
+ var __defProp$i = Object.defineProperty;
1210
+ var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
1211
+ var __decorateClass$i = (decorators, target, key, kind) => {
1212
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
897
1213
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
898
1214
  if (decorator = decorators[i])
899
1215
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
900
1216
  if (kind && result)
901
- __defProp$9(target, key, result);
1217
+ __defProp$i(target, key, result);
902
1218
  return result;
903
1219
  };
904
1220
  var CandidateStatus = /* @__PURE__ */ ((CandidateStatus2) => {
@@ -912,63 +1228,63 @@ graphql.registerEnumType(CandidateStatus, {
912
1228
  });
913
1229
  exports.CandidateOutputDTO = class CandidateOutputDTO {
914
1230
  };
915
- __decorateClass$9([
1231
+ __decorateClass$i([
916
1232
  graphql.Field(() => String)
917
1233
  ], exports.CandidateOutputDTO.prototype, "username", 2);
918
- __decorateClass$9([
1234
+ __decorateClass$i([
919
1235
  graphql.Field(() => String, { nullable: true })
920
1236
  ], exports.CandidateOutputDTO.prototype, "username_display_name", 2);
921
- __decorateClass$9([
1237
+ __decorateClass$i([
922
1238
  graphql.Field(() => String)
923
1239
  ], exports.CandidateOutputDTO.prototype, "coopname", 2);
924
- __decorateClass$9([
1240
+ __decorateClass$i([
925
1241
  graphql.Field(() => String, { nullable: true })
926
1242
  ], exports.CandidateOutputDTO.prototype, "braname", 2);
927
- __decorateClass$9([
1243
+ __decorateClass$i([
928
1244
  graphql.Field(() => CandidateStatus)
929
1245
  ], exports.CandidateOutputDTO.prototype, "status", 2);
930
- __decorateClass$9([
1246
+ __decorateClass$i([
931
1247
  graphql.Field(() => String)
932
1248
  ], exports.CandidateOutputDTO.prototype, "type", 2);
933
- __decorateClass$9([
1249
+ __decorateClass$i([
934
1250
  graphql.Field(() => Date)
935
1251
  ], exports.CandidateOutputDTO.prototype, "created_at", 2);
936
- __decorateClass$9([
1252
+ __decorateClass$i([
937
1253
  graphql.Field(() => Date, { nullable: true })
938
1254
  ], exports.CandidateOutputDTO.prototype, "registered_at", 2);
939
- __decorateClass$9([
1255
+ __decorateClass$i([
940
1256
  graphql.Field(() => String, { nullable: true })
941
1257
  ], exports.CandidateOutputDTO.prototype, "referer", 2);
942
- __decorateClass$9([
1258
+ __decorateClass$i([
943
1259
  graphql.Field(() => String, { nullable: true })
944
1260
  ], exports.CandidateOutputDTO.prototype, "referer_display_name", 2);
945
- __decorateClass$9([
1261
+ __decorateClass$i([
946
1262
  graphql.Field(() => String)
947
1263
  ], exports.CandidateOutputDTO.prototype, "public_key", 2);
948
- __decorateClass$9([
1264
+ __decorateClass$i([
949
1265
  graphql.Field(() => String, { nullable: true })
950
1266
  ], exports.CandidateOutputDTO.prototype, "program_key", 2);
951
- exports.CandidateOutputDTO = __decorateClass$9([
1267
+ exports.CandidateOutputDTO = __decorateClass$i([
952
1268
  graphql.ObjectType("Candidate")
953
1269
  ], exports.CandidateOutputDTO);
954
1270
 
955
- var __defProp$8 = Object.defineProperty;
956
- var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
957
- var __decorateClass$8 = (decorators, target, key, kind) => {
958
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
1271
+ var __defProp$h = Object.defineProperty;
1272
+ var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
1273
+ var __decorateClass$h = (decorators, target, key, kind) => {
1274
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
959
1275
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
960
1276
  if (decorator = decorators[i])
961
1277
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
962
1278
  if (kind && result)
963
- __defProp$8(target, key, result);
1279
+ __defProp$h(target, key, result);
964
1280
  return result;
965
1281
  };
966
1282
  exports.CandidateFilterInputDTO = class CandidateFilterInputDTO {
967
1283
  };
968
- __decorateClass$8([
1284
+ __decorateClass$h([
969
1285
  graphql.Field(() => String, { nullable: true })
970
1286
  ], exports.CandidateFilterInputDTO.prototype, "referer", 2);
971
- exports.CandidateFilterInputDTO = __decorateClass$8([
1287
+ exports.CandidateFilterInputDTO = __decorateClass$h([
972
1288
  graphql.InputType("CandidateFilterInput")
973
1289
  ], exports.CandidateFilterInputDTO);
974
1290
 
@@ -1023,23 +1339,6 @@ function isExtensionAvailable(availability, isMainnet) {
1023
1339
  }
1024
1340
  }
1025
1341
 
1026
- let entities;
1027
- function registerExtensionEntities(list) {
1028
- if (entities) {
1029
- throw new Error(
1030
- // i18n-ignore: ошибка сборки приложения при старте, до пайщика не доходит
1031
- "\u0421\u043E\u0441\u0442\u0430\u0432 \u0442\u0430\u0431\u043B\u0438\u0446 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u0439 \u0443\u0436\u0435 \u043E\u0431\u044A\u044F\u0432\u043B\u0435\u043D: registerExtensionEntities() \u0432\u044B\u0437\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u043E\u0434\u0438\u043D \u0440\u0430\u0437 \u043F\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435"
1032
- );
1033
- }
1034
- entities = [...list];
1035
- }
1036
- function extensionEntities() {
1037
- return entities ?? [];
1038
- }
1039
- function resetExtensionEntities() {
1040
- entities = void 0;
1041
- }
1042
-
1043
1342
  let migrations;
1044
1343
  function registerExtensionDatabaseMigrations(list) {
1045
1344
  if (migrations) {
@@ -1057,32 +1356,59 @@ function resetExtensionDatabaseMigrations() {
1057
1356
  migrations = void 0;
1058
1357
  }
1059
1358
 
1060
- var __defProp$7 = Object.defineProperty;
1061
- var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
1062
- var __decorateClass$7 = (decorators, target, key, kind) => {
1063
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
1359
+ async function attachOne(records, related, property, keys) {
1360
+ if (records.length === 0)
1361
+ return;
1362
+ const pairs = Object.entries(keys);
1363
+ const read = (record, field) => record[field];
1364
+ const where = {};
1365
+ for (const [relatedField, ownField] of pairs) {
1366
+ const values = [...new Set(records.map((record) => read(record, ownField)).filter((value) => value !== null && value !== void 0))];
1367
+ if (values.length === 0)
1368
+ return;
1369
+ where[relatedField] = transaction.oneOf(values);
1370
+ }
1371
+ const found = await related.find(where);
1372
+ const signature = (record, side) => pairs.map((pair) => String(read(record, pair[side]))).join("\0");
1373
+ const index = /* @__PURE__ */ new Map();
1374
+ for (const candidate of found) {
1375
+ const key = signature(candidate, 0);
1376
+ if (!index.has(key))
1377
+ index.set(key, candidate);
1378
+ }
1379
+ for (const record of records) {
1380
+ const match = index.get(signature(record, 1));
1381
+ if (match)
1382
+ record[property] = match;
1383
+ }
1384
+ }
1385
+
1386
+ var __defProp$g = Object.defineProperty;
1387
+ var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
1388
+ var __decorateClass$g = (decorators, target, key, kind) => {
1389
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
1064
1390
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
1065
1391
  if (decorator = decorators[i])
1066
1392
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1067
1393
  if (kind && result)
1068
- __defProp$7(target, key, result);
1394
+ __defProp$g(target, key, result);
1069
1395
  return result;
1070
1396
  };
1071
1397
  const SORT_FIELD_PATTERN = /^([A-Za-z_][A-Za-z0-9_]*(:(asc|desc))?)?$/i;
1072
1398
  exports.PaginationInputDTO = class PaginationInputDTO {
1073
1399
  };
1074
- __decorateClass$7([
1400
+ __decorateClass$g([
1075
1401
  graphql.Field(() => graphql.Int, { description: "\u041D\u043E\u043C\u0435\u0440 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B", defaultValue: 1 })
1076
1402
  ], exports.PaginationInputDTO.prototype, "page", 2);
1077
- __decorateClass$7([
1403
+ __decorateClass$g([
1078
1404
  graphql.Field(() => graphql.Int, { description: "\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435", defaultValue: 10 })
1079
1405
  ], exports.PaginationInputDTO.prototype, "limit", 2);
1080
- __decorateClass$7([
1406
+ __decorateClass$g([
1081
1407
  graphql.Field(() => String, { nullable: true, description: '\u041A\u043B\u044E\u0447 \u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0438 (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, "name")' }),
1082
1408
  classValidator.IsOptional(),
1083
1409
  classValidator.Matches(SORT_FIELD_PATTERN, { message: validationMessage("kit.pagination.invalidSortField") })
1084
1410
  ], exports.PaginationInputDTO.prototype, "sortBy", 2);
1085
- __decorateClass$7([
1411
+ __decorateClass$g([
1086
1412
  graphql.Field(() => String, {
1087
1413
  description: '\u041D\u0430\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0438 ("ASC" \u0438\u043B\u0438 "DESC")',
1088
1414
  defaultValue: "ASC"
@@ -1090,7 +1416,7 @@ __decorateClass$7([
1090
1416
  classValidator.IsOptional(),
1091
1417
  classValidator.IsIn(["ASC", "DESC"], { message: validationMessage("kit.pagination.invalidSortOrder") })
1092
1418
  ], exports.PaginationInputDTO.prototype, "sortOrder", 2);
1093
- exports.PaginationInputDTO = __decorateClass$7([
1419
+ exports.PaginationInputDTO = __decorateClass$g([
1094
1420
  graphql.InputType("PaginationInput")
1095
1421
  ], exports.PaginationInputDTO);
1096
1422
  class PaginationResult {
@@ -1098,19 +1424,19 @@ class PaginationResult {
1098
1424
  function createPaginationResult(ItemType, name) {
1099
1425
  let PaginationResult2 = class {
1100
1426
  };
1101
- __decorateClass$7([
1427
+ __decorateClass$g([
1102
1428
  graphql.Field(() => [ItemType], { description: "\u042D\u043B\u0435\u043C\u0435\u043D\u0442\u044B \u0442\u0435\u043A\u0443\u0449\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B" })
1103
1429
  ], PaginationResult2.prototype, "items", 2);
1104
- __decorateClass$7([
1430
+ __decorateClass$g([
1105
1431
  graphql.Field(() => graphql.Int, { description: "\u041E\u0431\u0449\u0435\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432" })
1106
1432
  ], PaginationResult2.prototype, "totalCount", 2);
1107
- __decorateClass$7([
1433
+ __decorateClass$g([
1108
1434
  graphql.Field(() => graphql.Int, { description: "\u041E\u0431\u0449\u0435\u0435 \u043A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0441\u0442\u0440\u0430\u043D\u0438\u0446" })
1109
1435
  ], PaginationResult2.prototype, "totalPages", 2);
1110
- __decorateClass$7([
1436
+ __decorateClass$g([
1111
1437
  graphql.Field(() => graphql.Int, { description: "\u0422\u0435\u043A\u0443\u0449\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430" })
1112
1438
  ], PaginationResult2.prototype, "currentPage", 2);
1113
- PaginationResult2 = __decorateClass$7([
1439
+ PaginationResult2 = __decorateClass$g([
1114
1440
  graphql.ObjectType(`${name}PaginationResult`, { isAbstract: true })
1115
1441
  ], PaginationResult2);
1116
1442
  return PaginationResult2;
@@ -1187,51 +1513,710 @@ function paginationInputToOffset(options) {
1187
1513
  };
1188
1514
  }
1189
1515
 
1190
- var __defProp$6 = Object.defineProperty;
1191
- var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
1192
- var __decorateClass$6 = (decorators, target, key, kind) => {
1193
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
1516
+ var __defProp$f = Object.defineProperty;
1517
+ var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
1518
+ var __decorateClass$f = (decorators, target, key, kind) => {
1519
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
1194
1520
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
1195
1521
  if (decorator = decorators[i])
1196
1522
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1197
1523
  if (kind && result)
1198
- __defProp$6(target, key, result);
1524
+ __defProp$f(target, key, result);
1199
1525
  return result;
1200
1526
  };
1201
- exports.TransactionDTO = class TransactionDTO {
1527
+ exports.Ledger2AccountDTO = class Ledger2AccountDTO {
1202
1528
  };
1203
- __decorateClass$6([
1204
- graphql.Field(() => graphqlTypeJson.GraphQLJSON, { description: "\u0411\u043B\u043E\u043A\u0447\u0435\u0439\u043D, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043B\u0441\u044F", nullable: true })
1205
- ], exports.TransactionDTO.prototype, "chain", 2);
1206
- __decorateClass$6([
1207
- graphql.Field(() => graphqlTypeJson.GraphQLJSON, { description: "\u0417\u0430\u043F\u0440\u043E\u0441 \u043D\u0430 \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438", nullable: true })
1208
- ], exports.TransactionDTO.prototype, "request", 2);
1209
- __decorateClass$6([
1210
- graphql.Field(() => graphqlTypeJson.GraphQLJSON, { description: "\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u043D\u044B\u0439 \u0437\u0430\u043F\u0440\u043E\u0441 \u043D\u0430 \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438", nullable: true })
1211
- ], exports.TransactionDTO.prototype, "resolved", 2);
1212
- __decorateClass$6([
1213
- graphql.Field(() => graphqlTypeJson.GraphQLJSON, {
1214
- description: "\u041E\u0442\u0432\u0435\u0442 \u043E\u0442 API \u043F\u043E\u0441\u043B\u0435 \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0438 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438 (\u0435\u0441\u043B\u0438 \u0431\u044B\u043B \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D \u0431\u0440\u043E\u0434\u043A\u0430\u0441\u0442)",
1215
- nullable: true
1216
- })
1217
- ], exports.TransactionDTO.prototype, "response", 2);
1218
- __decorateClass$6([
1219
- graphql.Field(() => graphqlTypeJson.GraphQLJSON, { description: "\u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043C\u044B\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438", nullable: true })
1220
- ], exports.TransactionDTO.prototype, "returns", 2);
1221
- __decorateClass$6([
1222
- graphql.Field(() => graphqlTypeJson.GraphQLJSON, { description: "\u0420\u0435\u0432\u0438\u0437\u0438\u0438 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438, \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u043D\u044B\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u043C\u0438 \u0432 ESR \u0444\u043E\u0440\u043C\u0430\u0442\u0435", nullable: true })
1223
- ], exports.TransactionDTO.prototype, "revisions", 2);
1224
- __decorateClass$6([
1225
- graphql.Field(() => graphqlTypeJson.GraphQLJSON, { description: "\u041F\u043E\u0434\u043F\u0438\u0441\u0438 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438", nullable: true })
1226
- ], exports.TransactionDTO.prototype, "signatures", 2);
1227
- __decorateClass$6([
1228
- graphql.Field(() => graphqlTypeJson.GraphQLJSON, { description: "\u0410\u0432\u0442\u043E\u0440\u0438\u0437\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0442", nullable: true })
1229
- ], exports.TransactionDTO.prototype, "signer", 2);
1230
- __decorateClass$6([
1231
- graphql.Field(() => graphqlTypeJson.GraphQLJSON, { description: "\u0418\u0442\u043E\u0433\u043E\u0432\u0430\u044F \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u044F", nullable: true })
1232
- ], exports.TransactionDTO.prototype, "transaction", 2);
1233
- exports.TransactionDTO = __decorateClass$6([
1234
- graphql.ObjectType("Transaction")
1529
+ __decorateClass$f([
1530
+ graphql.Field(() => graphql.Int, { description: "ID \u0441\u0447\u0451\u0442\u0430 (\xD71000 offset): 51000/80000/86000/..." })
1531
+ ], exports.Ledger2AccountDTO.prototype, "id", 2);
1532
+ __decorateClass$f([
1533
+ graphql.Field(() => String, { description: "\u0420\u0443\u0441\u0441\u043A\u043E\u0435 \u043D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0441\u0447\u0451\u0442\u0430 \u0438\u0437 \u043F\u043B\u0430\u043D\u0430" })
1534
+ ], exports.Ledger2AccountDTO.prototype, "name", 2);
1535
+ __decorateClass$f([
1536
+ graphql.Field(() => String, { description: '\u0421\u0430\u043B\u044C\u0434\u043E (EOSIO asset: "7000.0000 RUB")' })
1537
+ ], exports.Ledger2AccountDTO.prototype, "balance", 2);
1538
+ __decorateClass$f([
1539
+ graphql.Field(() => String, { description: "\u0414\u0435\u0431\u0435\u0442\u043E\u0432\u044B\u0439 \u043E\u0431\u043E\u0440\u043E\u0442" })
1540
+ ], exports.Ledger2AccountDTO.prototype, "debitBalance", 2);
1541
+ __decorateClass$f([
1542
+ graphql.Field(() => String, { description: "\u041A\u0440\u0435\u0434\u0438\u0442\u043E\u0432\u044B\u0439 \u043E\u0431\u043E\u0440\u043E\u0442" })
1543
+ ], exports.Ledger2AccountDTO.prototype, "creditBalance", 2);
1544
+ __decorateClass$f([
1545
+ graphql.Field(() => graphql.Int, { description: "0 = active (\u0434\u0435\u0431\u0435\u0442\u043E\u0432\u044B\u0439), 1 = passive (\u043A\u0440\u0435\u0434\u0438\u0442\u043E\u0432\u044B\u0439)" })
1546
+ ], exports.Ledger2AccountDTO.prototype, "accountType", 2);
1547
+ exports.Ledger2AccountDTO = __decorateClass$f([
1548
+ graphql.ObjectType("Ledger2Account")
1549
+ ], exports.Ledger2AccountDTO);
1550
+
1551
+ var __defProp$e = Object.defineProperty;
1552
+ var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
1553
+ var __decorateClass$e = (decorators, target, key, kind) => {
1554
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
1555
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1556
+ if (decorator = decorators[i])
1557
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1558
+ if (kind && result)
1559
+ __defProp$e(target, key, result);
1560
+ return result;
1561
+ };
1562
+ exports.Ledger2WalletDTO = class Ledger2WalletDTO {
1563
+ };
1564
+ __decorateClass$e([
1565
+ graphql.Field(() => String, { description: "eosio::name-\u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430 (w.<contract>.<waltype>)" })
1566
+ ], exports.Ledger2WalletDTO.prototype, "id", 2);
1567
+ __decorateClass$e([
1568
+ graphql.Field(() => String, { description: "\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430" })
1569
+ ], exports.Ledger2WalletDTO.prototype, "name", 2);
1570
+ __decorateClass$e([
1571
+ graphql.Field(() => String, { description: "\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0439 \u0431\u0430\u043B\u0430\u043D\u0441" })
1572
+ ], exports.Ledger2WalletDTO.prototype, "available", 2);
1573
+ exports.Ledger2WalletDTO = __decorateClass$e([
1574
+ graphql.ObjectType("Ledger2Wallet")
1575
+ ], exports.Ledger2WalletDTO);
1576
+
1577
+ var __defProp$d = Object.defineProperty;
1578
+ var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
1579
+ var __decorateClass$d = (decorators, target, key, kind) => {
1580
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
1581
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1582
+ if (decorator = decorators[i])
1583
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1584
+ if (kind && result)
1585
+ __defProp$d(target, key, result);
1586
+ return result;
1587
+ };
1588
+ exports.Ledger2OperationDTO = class Ledger2OperationDTO {
1589
+ };
1590
+ __decorateClass$d([
1591
+ graphql.Field(() => String, {
1592
+ description: "global_sequence \u0431\u043B\u043E\u043A\u0447\u0435\u0439\u043D\u0430 (\u0441\u0442\u0440\u043E\u043A\u0430 \u2014 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u0434\u043E 2^53 overflow)"
1593
+ })
1594
+ ], exports.Ledger2OperationDTO.prototype, "globalSequence", 2);
1595
+ __decorateClass$d([
1596
+ graphql.Field(() => graphql.Int)
1597
+ ], exports.Ledger2OperationDTO.prototype, "blockNum", 2);
1598
+ __decorateClass$d([
1599
+ graphql.Field(() => String)
1600
+ ], exports.Ledger2OperationDTO.prototype, "coopname", 2);
1601
+ __decorateClass$d([
1602
+ graphql.Field(() => String, {
1603
+ description: "apply | walletop | debit | credit"
1604
+ })
1605
+ ], exports.Ledger2OperationDTO.prototype, "action", 2);
1606
+ __decorateClass$d([
1607
+ graphql.Field(() => String, {
1608
+ nullable: true,
1609
+ description: "\u0414\u043B\u044F apply: OPERATION_REGISTRY code (o.cap.lend / o.wal.depcpl / ...)"
1610
+ })
1611
+ ], exports.Ledger2OperationDTO.prototype, "operationCode", 2);
1612
+ __decorateClass$d([
1613
+ graphql.Field(() => String, { nullable: true, description: "process_hash (32-hex)" })
1614
+ ], exports.Ledger2OperationDTO.prototype, "processHash", 2);
1615
+ __decorateClass$d([
1616
+ graphql.Field(() => String, { nullable: true })
1617
+ ], exports.Ledger2OperationDTO.prototype, "username", 2);
1618
+ __decorateClass$d([
1619
+ graphql.Field(() => graphql.Int, { nullable: true, description: "ID \u0441\u0447\u0451\u0442\u0430/\u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430 (\xD71000)" })
1620
+ ], exports.Ledger2OperationDTO.prototype, "accountId", 2);
1621
+ __decorateClass$d([
1622
+ graphql.Field(() => String, { nullable: true, description: "walletop: wallet_from (eosio::name w.<contract>.<waltype>)" })
1623
+ ], exports.Ledger2OperationDTO.prototype, "walletFrom", 2);
1624
+ __decorateClass$d([
1625
+ graphql.Field(() => String, { nullable: true, description: "walletop: wallet_to (eosio::name w.<contract>.<waltype>)" })
1626
+ ], exports.Ledger2OperationDTO.prototype, "walletTo", 2);
1627
+ __decorateClass$d([
1628
+ graphql.Field(() => String, { nullable: true, description: 'Asset "100.0000 RUB"' })
1629
+ ], exports.Ledger2OperationDTO.prototype, "quantity", 2);
1630
+ __decorateClass$d([
1631
+ graphql.Field(() => String, { nullable: true })
1632
+ ], exports.Ledger2OperationDTO.prototype, "memo", 2);
1633
+ __decorateClass$d([
1634
+ graphql.Field(() => String, {
1635
+ nullable: true,
1636
+ description: "global_sequence \u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u0433\u043E apply (parser2: transaction_id + action_ordinal=this.creator_action_ordinal) \u2014 \u0434\u043B\u044F \u0442\u043E\u0447\u0435\u0447\u043D\u043E\u0433\u043E cross-link \u043D\u0430 \u043A\u043E\u043D\u043A\u0440\u0435\u0442\u043D\u0443\u044E \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u044E."
1637
+ })
1638
+ ], exports.Ledger2OperationDTO.prototype, "parentApplyGlobalSequence", 2);
1639
+ __decorateClass$d([
1640
+ graphql.Field(() => Date)
1641
+ ], exports.Ledger2OperationDTO.prototype, "createdAt", 2);
1642
+ exports.Ledger2OperationDTO = __decorateClass$d([
1643
+ graphql.ObjectType("Ledger2Operation")
1644
+ ], exports.Ledger2OperationDTO);
1645
+ exports.Ledger2HistoryResponseDTO = class Ledger2HistoryResponseDTO {
1646
+ };
1647
+ __decorateClass$d([
1648
+ graphql.Field(() => [exports.Ledger2OperationDTO])
1649
+ ], exports.Ledger2HistoryResponseDTO.prototype, "items", 2);
1650
+ __decorateClass$d([
1651
+ graphql.Field(() => graphql.Int)
1652
+ ], exports.Ledger2HistoryResponseDTO.prototype, "totalCount", 2);
1653
+ __decorateClass$d([
1654
+ graphql.Field(() => graphql.Int)
1655
+ ], exports.Ledger2HistoryResponseDTO.prototype, "totalPages", 2);
1656
+ __decorateClass$d([
1657
+ graphql.Field(() => graphql.Int)
1658
+ ], exports.Ledger2HistoryResponseDTO.prototype, "currentPage", 2);
1659
+ exports.Ledger2HistoryResponseDTO = __decorateClass$d([
1660
+ graphql.ObjectType("Ledger2HistoryResponse")
1661
+ ], exports.Ledger2HistoryResponseDTO);
1662
+
1663
+ var __defProp$c = Object.defineProperty;
1664
+ var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
1665
+ var __decorateClass$c = (decorators, target, key, kind) => {
1666
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
1667
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1668
+ if (decorator = decorators[i])
1669
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1670
+ if (kind && result)
1671
+ __defProp$c(target, key, result);
1672
+ return result;
1673
+ };
1674
+ exports.Ledger2PostingDTO = class Ledger2PostingDTO {
1675
+ };
1676
+ __decorateClass$c([
1677
+ graphql.Field(() => String, { description: "\u0421\u0442\u0430\u0431\u0438\u043B\u044C\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0434\u043B\u044F UI: debitSeq_creditSeq" })
1678
+ ], exports.Ledger2PostingDTO.prototype, "key", 2);
1679
+ __decorateClass$c([
1680
+ graphql.Field(() => graphql.Int)
1681
+ ], exports.Ledger2PostingDTO.prototype, "blockNum", 2);
1682
+ __decorateClass$c([
1683
+ graphql.Field(() => String, { nullable: true, description: "process_hash (32-hex)" })
1684
+ ], exports.Ledger2PostingDTO.prototype, "processHash", 2);
1685
+ __decorateClass$c([
1686
+ graphql.Field(() => String, {
1687
+ nullable: true,
1688
+ description: "OPERATION_REGISTRY \u043A\u043E\u0434 \u0438\u0437 parent apply (`o.cap.lend` / `o.wal.depcpl` / ...)"
1689
+ })
1690
+ ], exports.Ledger2PostingDTO.prototype, "operationCode", 2);
1691
+ __decorateClass$c([
1692
+ graphql.Field(() => String, {
1693
+ nullable: true,
1694
+ description: "global_sequence parent apply (\u0434\u043B\u044F cross-link \u0432 \u0440\u0435\u0435\u0441\u0442\u0440 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0439)"
1695
+ })
1696
+ ], exports.Ledger2PostingDTO.prototype, "parentApplyGlobalSequence", 2);
1697
+ __decorateClass$c([
1698
+ graphql.Field(() => String, { nullable: true, description: "global_sequence debit-action" })
1699
+ ], exports.Ledger2PostingDTO.prototype, "debitGlobalSequence", 2);
1700
+ __decorateClass$c([
1701
+ graphql.Field(() => graphql.Int, { nullable: true, description: "id \u0431\u0443\u0445.\u0441\u0447\u0451\u0442\u0430 debit (\xD71000)" })
1702
+ ], exports.Ledger2PostingDTO.prototype, "debitAccountId", 2);
1703
+ __decorateClass$c([
1704
+ graphql.Field(() => String, { nullable: true, description: "global_sequence credit-action" })
1705
+ ], exports.Ledger2PostingDTO.prototype, "creditGlobalSequence", 2);
1706
+ __decorateClass$c([
1707
+ graphql.Field(() => graphql.Int, { nullable: true, description: "id \u0431\u0443\u0445.\u0441\u0447\u0451\u0442\u0430 credit (\xD71000)" })
1708
+ ], exports.Ledger2PostingDTO.prototype, "creditAccountId", 2);
1709
+ __decorateClass$c([
1710
+ graphql.Field(() => String, { nullable: true, description: 'Asset "100.0000 RUB"' })
1711
+ ], exports.Ledger2PostingDTO.prototype, "quantity", 2);
1712
+ __decorateClass$c([
1713
+ graphql.Field(() => String, { nullable: true })
1714
+ ], exports.Ledger2PostingDTO.prototype, "memo", 2);
1715
+ __decorateClass$c([
1716
+ graphql.Field(() => String, { nullable: true })
1717
+ ], exports.Ledger2PostingDTO.prototype, "username", 2);
1718
+ __decorateClass$c([
1719
+ graphql.Field(() => Date)
1720
+ ], exports.Ledger2PostingDTO.prototype, "createdAt", 2);
1721
+ exports.Ledger2PostingDTO = __decorateClass$c([
1722
+ graphql.ObjectType("Ledger2Posting")
1723
+ ], exports.Ledger2PostingDTO);
1724
+ exports.Ledger2PostingsResponseDTO = class Ledger2PostingsResponseDTO {
1725
+ };
1726
+ __decorateClass$c([
1727
+ graphql.Field(() => [exports.Ledger2PostingDTO])
1728
+ ], exports.Ledger2PostingsResponseDTO.prototype, "items", 2);
1729
+ __decorateClass$c([
1730
+ graphql.Field(() => graphql.Int)
1731
+ ], exports.Ledger2PostingsResponseDTO.prototype, "totalCount", 2);
1732
+ __decorateClass$c([
1733
+ graphql.Field(() => graphql.Int)
1734
+ ], exports.Ledger2PostingsResponseDTO.prototype, "totalPages", 2);
1735
+ __decorateClass$c([
1736
+ graphql.Field(() => graphql.Int)
1737
+ ], exports.Ledger2PostingsResponseDTO.prototype, "currentPage", 2);
1738
+ exports.Ledger2PostingsResponseDTO = __decorateClass$c([
1739
+ graphql.ObjectType("Ledger2PostingsResponse")
1740
+ ], exports.Ledger2PostingsResponseDTO);
1741
+
1742
+ var __defProp$b = Object.defineProperty;
1743
+ var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
1744
+ var __decorateClass$b = (decorators, target, key, kind) => {
1745
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
1746
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1747
+ if (decorator = decorators[i])
1748
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1749
+ if (kind && result)
1750
+ __defProp$b(target, key, result);
1751
+ return result;
1752
+ };
1753
+ exports.GetLedger2HistoryInputDTO = class GetLedger2HistoryInputDTO {
1754
+ };
1755
+ __decorateClass$b([
1756
+ graphql.Field(() => String),
1757
+ classValidator.IsString()
1758
+ ], exports.GetLedger2HistoryInputDTO.prototype, "coopname", 2);
1759
+ __decorateClass$b([
1760
+ graphql.Field(() => graphql.Int, { nullable: true, description: "\u0411\u0443\u0445.\u0441\u0447\u0451\u0442 (\xD71000): 51000/80000/86000 \u2014 \u0434\u043B\u044F debit/credit \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439." }),
1761
+ classValidator.IsOptional(),
1762
+ classValidator.IsInt()
1763
+ ], exports.GetLedger2HistoryInputDTO.prototype, "accountId", 2);
1764
+ __decorateClass$b([
1765
+ graphql.Field(() => String, {
1766
+ nullable: true,
1767
+ description: "eosio::name \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0430 (`w.<contract>.<waltype>`) \u2014 \u0434\u043B\u044F walletop \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439."
1768
+ }),
1769
+ classValidator.IsOptional(),
1770
+ classValidator.IsString(),
1771
+ classValidator.MaxLength(13)
1772
+ ], exports.GetLedger2HistoryInputDTO.prototype, "walletName", 2);
1773
+ __decorateClass$b([
1774
+ graphql.Field(() => [String], {
1775
+ nullable: true,
1776
+ description: "\u0418\u043C\u0435\u043D\u0430 blockchain-\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439: apply | walletop | debit | credit"
1777
+ }),
1778
+ classValidator.IsOptional(),
1779
+ classValidator.IsArray(),
1780
+ classValidator.IsString({ each: true })
1781
+ ], exports.GetLedger2HistoryInputDTO.prototype, "actionNames", 2);
1782
+ __decorateClass$b([
1783
+ graphql.Field(() => [String], {
1784
+ nullable: true,
1785
+ description: "OPERATION_REGISTRY \u043A\u043E\u0434\u044B: o.cap.lend, o.wal.depcpl, o.mig.minshr \u0438 \u0442.\u0434."
1786
+ }),
1787
+ classValidator.IsOptional(),
1788
+ classValidator.IsArray(),
1789
+ classValidator.IsString({ each: true })
1790
+ ], exports.GetLedger2HistoryInputDTO.prototype, "operationCodes", 2);
1791
+ __decorateClass$b([
1792
+ graphql.Field(() => String, { nullable: true }),
1793
+ classValidator.IsOptional(),
1794
+ classValidator.IsString(),
1795
+ classValidator.MaxLength(64)
1796
+ ], exports.GetLedger2HistoryInputDTO.prototype, "username", 2);
1797
+ __decorateClass$b([
1798
+ graphql.Field(() => String, { nullable: true, description: "process_hash (hex-64) \u0434\u043B\u044F \u0432\u044B\u0431\u043E\u0440\u043A\u0438 \u0432\u0441\u0435\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u043E\u0434\u043D\u043E\u0439 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438" }),
1799
+ classValidator.IsOptional(),
1800
+ classValidator.IsString(),
1801
+ classValidator.MaxLength(66),
1802
+ classValidator.Matches(/^[0-9a-fA-F]{64}$/, {
1803
+ message: validationMessage("ledger2.getLedger2HistoryInput.processHashInvalidFormat")
1804
+ })
1805
+ ], exports.GetLedger2HistoryInputDTO.prototype, "processHash", 2);
1806
+ __decorateClass$b([
1807
+ graphql.Field(() => String, {
1808
+ nullable: true,
1809
+ description: "global_sequence \u0440\u043E\u0434\u0438\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u0433\u043E apply: \u0432\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0442\u043E\u043B\u044C\u043A\u043E inline-\u0441\u0438\u0431\u0441\u043E\u0432 (walletop/debit/credit) \u044D\u0442\u043E\u0433\u043E apply \u0447\u0435\u0440\u0435\u0437 \u0442\u043E\u0447\u0435\u0447\u043D\u0443\u044E \u0441\u0432\u044F\u0437\u044C parser2 (transaction_id + creator_action_ordinal=apply.action_ordinal)."
1810
+ }),
1811
+ classValidator.IsOptional(),
1812
+ classValidator.IsString(),
1813
+ classValidator.MaxLength(24)
1814
+ ], exports.GetLedger2HistoryInputDTO.prototype, "parentApplyGlobalSequence", 2);
1815
+ __decorateClass$b([
1816
+ graphql.Field(() => String, {
1817
+ nullable: true,
1818
+ description: "\u2116 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 = apply.global_sequence. \u0422\u043E\u0447\u0435\u0447\u043D\u0430\u044F \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044F \u043E\u0434\u043D\u043E\u0439 apply-\u0433\u0440\u0443\u043F\u043F\u044B (apply + walletop/debit/credit)."
1819
+ }),
1820
+ classValidator.IsOptional(),
1821
+ classValidator.IsString(),
1822
+ classValidator.MaxLength(24)
1823
+ ], exports.GetLedger2HistoryInputDTO.prototype, "applyGlobalSequence", 2);
1824
+ __decorateClass$b([
1825
+ graphql.Field(() => String, {
1826
+ nullable: true,
1827
+ description: "\u2116 \u0434\u0432\u0438\u0436\u0435\u043D\u0438\u044F \u043F\u043E \u043A\u043E\u0448\u0435\u043B\u044C\u043A\u0443 = walletop.global_sequence. \u0423\u043D\u0438\u043A\u0430\u043B\u0435\u043D."
1828
+ }),
1829
+ classValidator.IsOptional(),
1830
+ classValidator.IsString(),
1831
+ classValidator.MaxLength(24)
1832
+ ], exports.GetLedger2HistoryInputDTO.prototype, "walletopGlobalSequence", 2);
1833
+ __decorateClass$b([
1834
+ graphql.Field(() => Date, { nullable: true }),
1835
+ classValidator.IsOptional(),
1836
+ classValidator.IsDate(),
1837
+ classTransformer.Type(() => Date)
1838
+ ], exports.GetLedger2HistoryInputDTO.prototype, "dateFrom", 2);
1839
+ __decorateClass$b([
1840
+ graphql.Field(() => Date, { nullable: true }),
1841
+ classValidator.IsOptional(),
1842
+ classValidator.IsDate(),
1843
+ classTransformer.Type(() => Date)
1844
+ ], exports.GetLedger2HistoryInputDTO.prototype, "dateTo", 2);
1845
+ __decorateClass$b([
1846
+ graphql.Field(() => graphql.Int, { nullable: true, defaultValue: 1 }),
1847
+ classValidator.IsOptional(),
1848
+ classValidator.IsInt(),
1849
+ classValidator.Min(1)
1850
+ ], exports.GetLedger2HistoryInputDTO.prototype, "page", 2);
1851
+ __decorateClass$b([
1852
+ graphql.Field(() => graphql.Int, { nullable: true, defaultValue: 50 }),
1853
+ classValidator.IsOptional(),
1854
+ classValidator.IsInt(),
1855
+ classValidator.Min(1),
1856
+ classValidator.Max(500)
1857
+ ], exports.GetLedger2HistoryInputDTO.prototype, "limit", 2);
1858
+ __decorateClass$b([
1859
+ graphql.Field(() => String, { nullable: true, defaultValue: "DESC" }),
1860
+ classValidator.IsOptional(),
1861
+ classValidator.IsIn(["ASC", "DESC"])
1862
+ ], exports.GetLedger2HistoryInputDTO.prototype, "sortOrder", 2);
1863
+ exports.GetLedger2HistoryInputDTO = __decorateClass$b([
1864
+ graphql.InputType("GetLedger2HistoryInput")
1865
+ ], exports.GetLedger2HistoryInputDTO);
1866
+
1867
+ var __defProp$a = Object.defineProperty;
1868
+ var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
1869
+ var __decorateClass$a = (decorators, target, key, kind) => {
1870
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
1871
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1872
+ if (decorator = decorators[i])
1873
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1874
+ if (kind && result)
1875
+ __defProp$a(target, key, result);
1876
+ return result;
1877
+ };
1878
+ exports.GetLedger2PostingsInputDTO = class GetLedger2PostingsInputDTO {
1879
+ };
1880
+ __decorateClass$a([
1881
+ graphql.Field(() => String),
1882
+ classValidator.IsString()
1883
+ ], exports.GetLedger2PostingsInputDTO.prototype, "coopname", 2);
1884
+ __decorateClass$a([
1885
+ graphql.Field(() => graphql.Int, {
1886
+ nullable: true,
1887
+ description: "\u0411\u0443\u0445.\u0441\u0447\u0451\u0442 (\xD71000) \u2014 \u043F\u043E\u043F\u0430\u0434\u0430\u043D\u0438\u0435 \u0432 debit \u0418\u041B\u0418 credit \u043D\u043E\u0433\u0435 \u043F\u0440\u043E\u0432\u043E\u0434\u043A\u0438."
1888
+ }),
1889
+ classValidator.IsOptional(),
1890
+ classValidator.IsInt()
1891
+ ], exports.GetLedger2PostingsInputDTO.prototype, "accountId", 2);
1892
+ __decorateClass$a([
1893
+ graphql.Field(() => String, { nullable: true }),
1894
+ classValidator.IsOptional(),
1895
+ classValidator.IsString(),
1896
+ classValidator.MaxLength(64)
1897
+ ], exports.GetLedger2PostingsInputDTO.prototype, "username", 2);
1898
+ __decorateClass$a([
1899
+ graphql.Field(() => String, { nullable: true, description: "process_hash \u0434\u043B\u044F \u0432\u044B\u0431\u043E\u0440\u043A\u0438 \u0432\u0441\u0435\u0445 \u043F\u0440\u043E\u0432\u043E\u0434\u043E\u043A \u043E\u0434\u043D\u043E\u0439 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438" }),
1900
+ classValidator.IsOptional(),
1901
+ classValidator.IsString(),
1902
+ classValidator.MaxLength(66)
1903
+ ], exports.GetLedger2PostingsInputDTO.prototype, "processHash", 2);
1904
+ __decorateClass$a([
1905
+ graphql.Field(() => String, {
1906
+ nullable: true,
1907
+ description: "\u2116 \u043F\u0440\u043E\u0432\u043E\u0434\u043A\u0438 = debit.global_sequence (unique). \u041F\u0430\u0440\u043D\u044B\u0439 credit \u043F\u043E\u0434\u0442\u044F\u043D\u0435\u0442\u0441\u044F \u0430\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u0438."
1908
+ }),
1909
+ classValidator.IsOptional(),
1910
+ classValidator.IsString(),
1911
+ classValidator.MaxLength(24)
1912
+ ], exports.GetLedger2PostingsInputDTO.prototype, "debitGlobalSequence", 2);
1913
+ __decorateClass$a([
1914
+ graphql.Field(() => String, {
1915
+ nullable: true,
1916
+ description: "\u2116 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 = apply.global_sequence. \u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043F\u0440\u043E\u0432\u043E\u0434\u043A\u0438 \u0440\u043E\u0432\u043D\u043E \u044D\u0442\u043E\u0439 apply-\u0433\u0440\u0443\u043F\u043F\u044B."
1917
+ }),
1918
+ classValidator.IsOptional(),
1919
+ classValidator.IsString(),
1920
+ classValidator.MaxLength(24)
1921
+ ], exports.GetLedger2PostingsInputDTO.prototype, "applyGlobalSequence", 2);
1922
+ __decorateClass$a([
1923
+ graphql.Field(() => Date, { nullable: true }),
1924
+ classValidator.IsOptional(),
1925
+ classValidator.IsDate(),
1926
+ classTransformer.Type(() => Date)
1927
+ ], exports.GetLedger2PostingsInputDTO.prototype, "dateFrom", 2);
1928
+ __decorateClass$a([
1929
+ graphql.Field(() => Date, { nullable: true }),
1930
+ classValidator.IsOptional(),
1931
+ classValidator.IsDate(),
1932
+ classTransformer.Type(() => Date)
1933
+ ], exports.GetLedger2PostingsInputDTO.prototype, "dateTo", 2);
1934
+ __decorateClass$a([
1935
+ graphql.Field(() => graphql.Int, { nullable: true, defaultValue: 1 }),
1936
+ classValidator.IsOptional(),
1937
+ classValidator.IsInt(),
1938
+ classValidator.Min(1)
1939
+ ], exports.GetLedger2PostingsInputDTO.prototype, "page", 2);
1940
+ __decorateClass$a([
1941
+ graphql.Field(() => graphql.Int, { nullable: true, defaultValue: 50 }),
1942
+ classValidator.IsOptional(),
1943
+ classValidator.IsInt(),
1944
+ classValidator.Min(1),
1945
+ classValidator.Max(500)
1946
+ ], exports.GetLedger2PostingsInputDTO.prototype, "limit", 2);
1947
+ __decorateClass$a([
1948
+ graphql.Field(() => String, { nullable: true, defaultValue: "DESC" }),
1949
+ classValidator.IsOptional(),
1950
+ classValidator.IsIn(["ASC", "DESC"])
1951
+ ], exports.GetLedger2PostingsInputDTO.prototype, "sortOrder", 2);
1952
+ exports.GetLedger2PostingsInputDTO = __decorateClass$a([
1953
+ graphql.InputType("GetLedger2PostingsInput")
1954
+ ], exports.GetLedger2PostingsInputDTO);
1955
+
1956
+ var __defProp$9 = Object.defineProperty;
1957
+ var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
1958
+ var __decorateClass$9 = (decorators, target, key, kind) => {
1959
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
1960
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1961
+ if (decorator = decorators[i])
1962
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1963
+ if (kind && result)
1964
+ __defProp$9(target, key, result);
1965
+ return result;
1966
+ };
1967
+ exports.ProcessesFilterInput = class ProcessesFilterInput {
1968
+ };
1969
+ __decorateClass$9([
1970
+ graphql.Field(() => String)
1971
+ ], exports.ProcessesFilterInput.prototype, "coopname", 2);
1972
+ __decorateClass$9([
1973
+ graphql.Field(() => String, { nullable: true })
1974
+ ], exports.ProcessesFilterInput.prototype, "processType", 2);
1975
+ __decorateClass$9([
1976
+ graphql.Field(() => String, { nullable: true })
1977
+ ], exports.ProcessesFilterInput.prototype, "username", 2);
1978
+ __decorateClass$9([
1979
+ graphql.Field(() => String, { nullable: true, description: "\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0430 \u2014 \u0442\u043E\u0447\u0435\u0447\u043D\u0430\u044F \u0430\u0434\u0440\u0435\u0441\u0430\u0446\u0438\u044F \u043E\u0434\u043D\u043E\u0433\u043E \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0430 \u043F\u043E \u0435\u0433\u043E \u0445\u044D\u0448\u0443" })
1980
+ ], exports.ProcessesFilterInput.prototype, "processHash", 2);
1981
+ __decorateClass$9([
1982
+ graphql.Field(() => graphql.Int, { nullable: true })
1983
+ ], exports.ProcessesFilterInput.prototype, "fromBlock", 2);
1984
+ __decorateClass$9([
1985
+ graphql.Field(() => graphql.Int, { nullable: true })
1986
+ ], exports.ProcessesFilterInput.prototype, "toBlock", 2);
1987
+ exports.ProcessesFilterInput = __decorateClass$9([
1988
+ graphql.InputType("ProcessesFilter")
1989
+ ], exports.ProcessesFilterInput);
1990
+
1991
+ var __defProp$8 = Object.defineProperty;
1992
+ var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
1993
+ var __decorateClass$8 = (decorators, target, key, kind) => {
1994
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
1995
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1996
+ if (decorator = decorators[i])
1997
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1998
+ if (kind && result)
1999
+ __defProp$8(target, key, result);
2000
+ return result;
2001
+ };
2002
+ exports.ProcessSummaryDTO = class ProcessSummaryDTO {
2003
+ // actionCount/deltaCount/documentCount удалены: N+1 counters на каждой
2004
+ // странице listProcesses были запросы 300+ на request. UI читает
2005
+ // getProcess(hash) при раскрытии — там счётчики выводимы из массивов.
2006
+ };
2007
+ __decorateClass$8([
2008
+ graphql.Field(() => String)
2009
+ ], exports.ProcessSummaryDTO.prototype, "processType", 2);
2010
+ __decorateClass$8([
2011
+ graphql.Field(() => String)
2012
+ ], exports.ProcessSummaryDTO.prototype, "processHash", 2);
2013
+ __decorateClass$8([
2014
+ graphql.Field(() => String)
2015
+ ], exports.ProcessSummaryDTO.prototype, "coopname", 2);
2016
+ __decorateClass$8([
2017
+ graphql.Field(() => String, { nullable: true })
2018
+ ], exports.ProcessSummaryDTO.prototype, "username", 2);
2019
+ __decorateClass$8([
2020
+ graphql.Field(() => Date)
2021
+ ], exports.ProcessSummaryDTO.prototype, "firstSeenAt", 2);
2022
+ __decorateClass$8([
2023
+ graphql.Field(() => Date)
2024
+ ], exports.ProcessSummaryDTO.prototype, "lastSeenAt", 2);
2025
+ __decorateClass$8([
2026
+ graphql.Field(() => String, { nullable: true, description: "\u0421\u0443\u043C\u043C\u0430 \u0433\u043B\u0430\u0432\u043D\u043E\u0439 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0430 \u2014 \u043D\u0430\u0438\u0431\u043E\u043B\u044C\u0448\u0430\u044F \u0441\u0440\u0435\u0434\u0438 \u0435\u0433\u043E \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0439" })
2027
+ ], exports.ProcessSummaryDTO.prototype, "amount", 2);
2028
+ __decorateClass$8([
2029
+ graphql.Field(() => String, { nullable: true, description: "\u041D\u0430\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0433\u043B\u0430\u0432\u043D\u043E\u0439 \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438 \u043F\u0440\u043E\u0446\u0435\u0441\u0441\u0430" })
2030
+ ], exports.ProcessSummaryDTO.prototype, "memo", 2);
2031
+ exports.ProcessSummaryDTO = __decorateClass$8([
2032
+ graphql.ObjectType("ProcessSummary")
2033
+ ], exports.ProcessSummaryDTO);
2034
+ const PaginatedProcessSummary = createPaginationResult(exports.ProcessSummaryDTO, "ProcessSummary");
2035
+
2036
+ var __defProp$7 = Object.defineProperty;
2037
+ var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
2038
+ var __decorateClass$7 = (decorators, target, key, kind) => {
2039
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
2040
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
2041
+ if (decorator = decorators[i])
2042
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2043
+ if (kind && result)
2044
+ __defProp$7(target, key, result);
2045
+ return result;
2046
+ };
2047
+ exports.ProcessActionDTO = class ProcessActionDTO {
2048
+ };
2049
+ __decorateClass$7([
2050
+ graphql.Field(() => String)
2051
+ ], exports.ProcessActionDTO.prototype, "id", 2);
2052
+ __decorateClass$7([
2053
+ graphql.Field(() => String)
2054
+ ], exports.ProcessActionDTO.prototype, "account", 2);
2055
+ __decorateClass$7([
2056
+ graphql.Field(() => String)
2057
+ ], exports.ProcessActionDTO.prototype, "name", 2);
2058
+ __decorateClass$7([
2059
+ graphql.Field(() => GraphQLJSON__default, { nullable: true })
2060
+ ], exports.ProcessActionDTO.prototype, "data", 2);
2061
+ __decorateClass$7([
2062
+ graphql.Field(() => Number)
2063
+ ], exports.ProcessActionDTO.prototype, "block_num", 2);
2064
+ __decorateClass$7([
2065
+ graphql.Field(() => String)
2066
+ ], exports.ProcessActionDTO.prototype, "block_id", 2);
2067
+ __decorateClass$7([
2068
+ graphql.Field(() => String)
2069
+ ], exports.ProcessActionDTO.prototype, "global_sequence", 2);
2070
+ __decorateClass$7([
2071
+ graphql.Field(() => String)
2072
+ ], exports.ProcessActionDTO.prototype, "transaction_id", 2);
2073
+ __decorateClass$7([
2074
+ graphql.Field(() => Date)
2075
+ ], exports.ProcessActionDTO.prototype, "created_at", 2);
2076
+ exports.ProcessActionDTO = __decorateClass$7([
2077
+ graphql.ObjectType("ProcessAction")
2078
+ ], exports.ProcessActionDTO);
2079
+ exports.ProcessDeltaDTO = class ProcessDeltaDTO {
2080
+ };
2081
+ __decorateClass$7([
2082
+ graphql.Field(() => String)
2083
+ ], exports.ProcessDeltaDTO.prototype, "id", 2);
2084
+ __decorateClass$7([
2085
+ graphql.Field(() => String)
2086
+ ], exports.ProcessDeltaDTO.prototype, "code", 2);
2087
+ __decorateClass$7([
2088
+ graphql.Field(() => String)
2089
+ ], exports.ProcessDeltaDTO.prototype, "scope", 2);
2090
+ __decorateClass$7([
2091
+ graphql.Field(() => String)
2092
+ ], exports.ProcessDeltaDTO.prototype, "table", 2);
2093
+ __decorateClass$7([
2094
+ graphql.Field(() => String)
2095
+ ], exports.ProcessDeltaDTO.prototype, "primary_key", 2);
2096
+ __decorateClass$7([
2097
+ graphql.Field(() => Boolean)
2098
+ ], exports.ProcessDeltaDTO.prototype, "present", 2);
2099
+ __decorateClass$7([
2100
+ graphql.Field(() => GraphQLJSON__default, { nullable: true })
2101
+ ], exports.ProcessDeltaDTO.prototype, "value", 2);
2102
+ __decorateClass$7([
2103
+ graphql.Field(() => Number)
2104
+ ], exports.ProcessDeltaDTO.prototype, "block_num", 2);
2105
+ __decorateClass$7([
2106
+ graphql.Field(() => Date)
2107
+ ], exports.ProcessDeltaDTO.prototype, "created_at", 2);
2108
+ exports.ProcessDeltaDTO = __decorateClass$7([
2109
+ graphql.ObjectType("ProcessDelta")
2110
+ ], exports.ProcessDeltaDTO);
2111
+ exports.ProcessDocumentSourceDTO = class ProcessDocumentSourceDTO {
2112
+ };
2113
+ __decorateClass$7([
2114
+ graphql.Field(() => String)
2115
+ ], exports.ProcessDocumentSourceDTO.prototype, "code", 2);
2116
+ __decorateClass$7([
2117
+ graphql.Field(() => String)
2118
+ ], exports.ProcessDocumentSourceDTO.prototype, "table", 2);
2119
+ __decorateClass$7([
2120
+ graphql.Field(() => String)
2121
+ ], exports.ProcessDocumentSourceDTO.prototype, "field", 2);
2122
+ __decorateClass$7([
2123
+ graphql.Field(() => String)
2124
+ ], exports.ProcessDocumentSourceDTO.prototype, "primary_key", 2);
2125
+ exports.ProcessDocumentSourceDTO = __decorateClass$7([
2126
+ graphql.ObjectType("ProcessDocumentSource")
2127
+ ], exports.ProcessDocumentSourceDTO);
2128
+ exports.ProcessDocumentDTO = class ProcessDocumentDTO {
2129
+ };
2130
+ __decorateClass$7([
2131
+ graphql.Field(() => String)
2132
+ ], exports.ProcessDocumentDTO.prototype, "hash", 2);
2133
+ __decorateClass$7([
2134
+ graphql.Field(() => exports.ProcessDocumentSourceDTO)
2135
+ ], exports.ProcessDocumentDTO.prototype, "source", 2);
2136
+ __decorateClass$7([
2137
+ graphql.Field(() => GraphQLJSON__default)
2138
+ ], exports.ProcessDocumentDTO.prototype, "document", 2);
2139
+ __decorateClass$7([
2140
+ graphql.Field(() => GraphQLJSON__default, { nullable: true })
2141
+ ], exports.ProcessDocumentDTO.prototype, "raw", 2);
2142
+ exports.ProcessDocumentDTO = __decorateClass$7([
2143
+ graphql.ObjectType("ProcessDocument")
2144
+ ], exports.ProcessDocumentDTO);
2145
+ exports.ProcessViewDTO = class ProcessViewDTO {
2146
+ };
2147
+ __decorateClass$7([
2148
+ graphql.Field(() => String)
2149
+ ], exports.ProcessViewDTO.prototype, "process_type", 2);
2150
+ __decorateClass$7([
2151
+ graphql.Field(() => String)
2152
+ ], exports.ProcessViewDTO.prototype, "process_hash", 2);
2153
+ __decorateClass$7([
2154
+ graphql.Field(() => String)
2155
+ ], exports.ProcessViewDTO.prototype, "coopname", 2);
2156
+ __decorateClass$7([
2157
+ graphql.Field(() => Date)
2158
+ ], exports.ProcessViewDTO.prototype, "first_seen_at", 2);
2159
+ __decorateClass$7([
2160
+ graphql.Field(() => Date)
2161
+ ], exports.ProcessViewDTO.prototype, "last_seen_at", 2);
2162
+ __decorateClass$7([
2163
+ graphql.Field(() => [exports.ProcessActionDTO])
2164
+ ], exports.ProcessViewDTO.prototype, "actions", 2);
2165
+ __decorateClass$7([
2166
+ graphql.Field(() => [exports.ProcessDeltaDTO])
2167
+ ], exports.ProcessViewDTO.prototype, "delta_history", 2);
2168
+ __decorateClass$7([
2169
+ graphql.Field(() => [exports.ProcessDocumentDTO])
2170
+ ], exports.ProcessViewDTO.prototype, "documents", 2);
2171
+ exports.ProcessViewDTO = __decorateClass$7([
2172
+ graphql.ObjectType("ProcessView")
2173
+ ], exports.ProcessViewDTO);
2174
+
2175
+ var __defProp$6 = Object.defineProperty;
2176
+ var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
2177
+ var __decorateClass$6 = (decorators, target, key, kind) => {
2178
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
2179
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
2180
+ if (decorator = decorators[i])
2181
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
2182
+ if (kind && result)
2183
+ __defProp$6(target, key, result);
2184
+ return result;
2185
+ };
2186
+ exports.TransactionDTO = class TransactionDTO {
2187
+ };
2188
+ __decorateClass$6([
2189
+ graphql.Field(() => GraphQLJSON.GraphQLJSON, { description: "\u0411\u043B\u043E\u043A\u0447\u0435\u0439\u043D, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043B\u0441\u044F", nullable: true })
2190
+ ], exports.TransactionDTO.prototype, "chain", 2);
2191
+ __decorateClass$6([
2192
+ graphql.Field(() => GraphQLJSON.GraphQLJSON, { description: "\u0417\u0430\u043F\u0440\u043E\u0441 \u043D\u0430 \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438", nullable: true })
2193
+ ], exports.TransactionDTO.prototype, "request", 2);
2194
+ __decorateClass$6([
2195
+ graphql.Field(() => GraphQLJSON.GraphQLJSON, { description: "\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u043D\u044B\u0439 \u0437\u0430\u043F\u0440\u043E\u0441 \u043D\u0430 \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0438\u0435 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438", nullable: true })
2196
+ ], exports.TransactionDTO.prototype, "resolved", 2);
2197
+ __decorateClass$6([
2198
+ graphql.Field(() => GraphQLJSON.GraphQLJSON, {
2199
+ description: "\u041E\u0442\u0432\u0435\u0442 \u043E\u0442 API \u043F\u043E\u0441\u043B\u0435 \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0438 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438 (\u0435\u0441\u043B\u0438 \u0431\u044B\u043B \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D \u0431\u0440\u043E\u0434\u043A\u0430\u0441\u0442)",
2200
+ nullable: true
2201
+ })
2202
+ ], exports.TransactionDTO.prototype, "response", 2);
2203
+ __decorateClass$6([
2204
+ graphql.Field(() => GraphQLJSON.GraphQLJSON, { description: "\u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043C\u044B\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u044F \u043F\u043E\u0441\u043B\u0435 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u044F \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438", nullable: true })
2205
+ ], exports.TransactionDTO.prototype, "returns", 2);
2206
+ __decorateClass$6([
2207
+ graphql.Field(() => GraphQLJSON.GraphQLJSON, { description: "\u0420\u0435\u0432\u0438\u0437\u0438\u0438 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438, \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u043D\u044B\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u0438\u044F\u043C\u0438 \u0432 ESR \u0444\u043E\u0440\u043C\u0430\u0442\u0435", nullable: true })
2208
+ ], exports.TransactionDTO.prototype, "revisions", 2);
2209
+ __decorateClass$6([
2210
+ graphql.Field(() => GraphQLJSON.GraphQLJSON, { description: "\u041F\u043E\u0434\u043F\u0438\u0441\u0438 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438", nullable: true })
2211
+ ], exports.TransactionDTO.prototype, "signatures", 2);
2212
+ __decorateClass$6([
2213
+ graphql.Field(() => GraphQLJSON.GraphQLJSON, { description: "\u0410\u0432\u0442\u043E\u0440\u0438\u0437\u043E\u0432\u0430\u043D\u043D\u044B\u0439 \u043F\u043E\u0434\u043F\u0438\u0441\u0430\u043D\u0442", nullable: true })
2214
+ ], exports.TransactionDTO.prototype, "signer", 2);
2215
+ __decorateClass$6([
2216
+ graphql.Field(() => GraphQLJSON.GraphQLJSON, { description: "\u0418\u0442\u043E\u0433\u043E\u0432\u0430\u044F \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u044F", nullable: true })
2217
+ ], exports.TransactionDTO.prototype, "transaction", 2);
2218
+ exports.TransactionDTO = __decorateClass$6([
2219
+ graphql.ObjectType("Transaction")
1235
2220
  ], exports.TransactionDTO);
1236
2221
 
1237
2222
  var ExtensionConfigSuppliedBy = /* @__PURE__ */ ((ExtensionConfigSuppliedBy2) => {
@@ -1337,7 +2322,7 @@ __decorateClass$5([
1337
2322
  classValidator.IsString()
1338
2323
  ], exports.GeneratedDocumentDTO.prototype, "hash", 2);
1339
2324
  __decorateClass$5([
1340
- graphql.Field(() => graphqlTypeJson.GraphQLJSON, { description: "\u041C\u0435\u0442\u0430\u0434\u0430\u043D\u043D\u044B\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" })
2325
+ graphql.Field(() => GraphQLJSON.GraphQLJSON, { description: "\u041C\u0435\u0442\u0430\u0434\u0430\u043D\u043D\u044B\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430" })
1341
2326
  ], exports.GeneratedDocumentDTO.prototype, "meta", 2);
1342
2327
  __decorateClass$5([
1343
2328
  graphql.Field(() => String, { description: "\u0411\u0438\u043D\u0430\u0440\u043D\u043E\u0435 \u0441\u043E\u0434\u0435\u0440\u0436\u0438\u043C\u043E\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 (base64)" }),
@@ -1427,7 +2412,7 @@ __decorateClass$2([
1427
2412
  classValidator.IsString()
1428
2413
  ], exports.SignatureInfoDTO.prototype, "signed_hash", 2);
1429
2414
  __decorateClass$2([
1430
- graphql.Field(() => graphqlTypeJson.GraphQLJSON)
2415
+ graphql.Field(() => GraphQLJSON.GraphQLJSON)
1431
2416
  ], exports.SignatureInfoDTO.prototype, "meta", 2);
1432
2417
  __decorateClass$2([
1433
2418
  graphql.Field(() => Boolean, { nullable: true })
@@ -1462,7 +2447,7 @@ __decorateClass$2([
1462
2447
  classValidator.IsString()
1463
2448
  ], exports.SignedDigitalDocumentDTO.prototype, "meta_hash", 2);
1464
2449
  __decorateClass$2([
1465
- graphql.Field(() => graphqlTypeJson.GraphQLJSON)
2450
+ graphql.Field(() => GraphQLJSON.GraphQLJSON)
1466
2451
  ], exports.SignedDigitalDocumentDTO.prototype, "meta", 2);
1467
2452
  __decorateClass$2([
1468
2453
  graphql.Field(() => [exports.SignatureInfoDTO]),
@@ -2090,72 +3075,6 @@ function sanitizeUserText(value) {
2090
3075
  return cooptypes._Common.Text.sanitizeEditorMarkdown(value);
2091
3076
  }
2092
3077
 
2093
- function resolveSortColumn(repository, sortBy, fallback) {
2094
- if (!sortBy)
2095
- return fallback;
2096
- const isKnownColumn = repository.metadata.columns.some(
2097
- (column) => column.propertyName === sortBy || column.databaseName === sortBy
2098
- );
2099
- return isKnownColumn ? sortBy : fallback;
2100
- }
2101
-
2102
- class LocalChangesCollector {
2103
- constructor(isWatched, publish) {
2104
- this.isWatched = isWatched;
2105
- this.publish = publish;
2106
- this.pending = /* @__PURE__ */ new WeakMap();
2107
- }
2108
- afterInsert(event) {
2109
- this.collect(event.metadata, event.queryRunner, event.entity);
2110
- }
2111
- afterUpdate(event) {
2112
- this.collect(event.metadata, event.queryRunner, { ...event.databaseEntity ?? {}, ...event.entity ?? {} });
2113
- }
2114
- afterRemove(event) {
2115
- const row = event.databaseEntity ?? event.entity;
2116
- this.collect(event.metadata, event.queryRunner, row, event.entityId);
2117
- }
2118
- afterTransactionCommit(event) {
2119
- const changes = this.pending.get(event.queryRunner);
2120
- if (!changes)
2121
- return;
2122
- this.pending.delete(event.queryRunner);
2123
- changes.forEach((c) => void this.publish(c.table, c.primary_key, c.row));
2124
- }
2125
- afterTransactionRollback(event) {
2126
- this.pending.delete(event.queryRunner);
2127
- }
2128
- collect(metadata, queryRunner, row, entityId) {
2129
- const table = metadata.tableName;
2130
- if (!this.isWatched(table))
2131
- return;
2132
- const change = { table, primary_key: primaryKeyOf(metadata, row, entityId), row };
2133
- if (queryRunner?.isTransactionActive) {
2134
- const list = this.pending.get(queryRunner) ?? [];
2135
- list.push(change);
2136
- this.pending.set(queryRunner, list);
2137
- return;
2138
- }
2139
- void this.publish(change.table, change.primary_key, change.row);
2140
- }
2141
- }
2142
- function primaryKeyOf(metadata, row, entityId) {
2143
- if (row) {
2144
- const ids = metadata.primaryColumns.map((c) => c.getEntityValue(row)).filter((v) => v !== void 0 && v !== null);
2145
- if (ids.length)
2146
- return ids.map(String).join(":");
2147
- }
2148
- if (entityId !== void 0 && entityId !== null) {
2149
- return typeof entityId === "object" ? Object.values(entityId).map(String).join(":") : String(entityId);
2150
- }
2151
- return "";
2152
- }
2153
-
2154
- const numericColumnTransformer = {
2155
- to: (value) => value,
2156
- from: (value) => value === null || value === void 0 ? value : Number(value)
2157
- };
2158
-
2159
3078
  function SafeMarkup(validationOptions) {
2160
3079
  return function(object, propertyName) {
2161
3080
  classValidator.registerDecorator({
@@ -2172,6 +3091,15 @@ function SafeMarkup(validationOptions) {
2172
3091
  };
2173
3092
  }
2174
3093
 
3094
+ function pickDefined(source, keys) {
3095
+ const picked = {};
3096
+ for (const key of keys) {
3097
+ if (source[key] !== void 0)
3098
+ picked[key] = source[key];
3099
+ }
3100
+ return picked;
3101
+ }
3102
+
2175
3103
  class HttpApiError extends common.HttpException {
2176
3104
  constructor(statusCode, message, isOperational = true, stack, subcode) {
2177
3105
  super(message, statusCode);
@@ -2228,11 +3156,37 @@ function rethrowChainError(error) {
2228
3156
  throw DomainError.badRequest(code ?? "CHAIN_ASSERT", { message: text });
2229
3157
  }
2230
3158
 
3159
+ exports.KYSELY = transaction.KYSELY;
3160
+ exports.MAIN_DATABASE = transaction.MAIN_DATABASE;
3161
+ exports.SqlBuilder = transaction.SqlBuilder;
3162
+ exports.TableStore = transaction.TableStore;
3163
+ exports.affectedCount = transaction.affectedCount;
3164
+ exports.bindNamed = transaction.bindNamed;
3165
+ exports.camelRow = transaction.camelRow;
3166
+ exports.configureLocalChangePublisher = transaction.configureLocalChangePublisher;
3167
+ exports.contains = transaction.contains;
3168
+ exports.ilike = transaction.ilike;
3169
+ exports.inTransaction = transaction.inTransaction;
3170
+ exports.isNull = transaction.isNull;
3171
+ exports.lessOrEqual = transaction.lessOrEqual;
3172
+ exports.lessThan = transaction.lessThan;
3173
+ exports.moreOrEqual = transaction.moreOrEqual;
3174
+ exports.moreThan = transaction.moreThan;
3175
+ exports.notEqual = transaction.notEqual;
3176
+ exports.notNull = transaction.notNull;
3177
+ exports.oneOf = transaction.oneOf;
3178
+ exports.pendingLocalChanges = transaction.pendingLocalChanges;
3179
+ exports.rawQuery = transaction.rawQuery;
3180
+ exports.snakeRow = transaction.snakeRow;
3181
+ exports.sortColumn = transaction.sortColumn;
3182
+ exports.sortDirection = transaction.sortDirection;
3183
+ exports.within = transaction.within;
3184
+ exports.APP_RIGHTS = APP_RIGHTS;
2231
3185
  exports.AmountFormatterUtils = AmountFormatterUtils;
2232
3186
  exports.AssetUtils = AssetUtils;
2233
- exports.AuthRoles = AuthRoles;
2234
3187
  exports.BucketRegistry = BucketRegistry;
2235
3188
  exports.CandidateStatus = CandidateStatus;
3189
+ exports.CouncilField = CouncilField;
2236
3190
  exports.CurrencyValidationUtil = CurrencyValidationUtil;
2237
3191
  exports.CurrentUser = CurrentUser;
2238
3192
  exports.DEFAULT_DOCUMENT_VERSION = DEFAULT_DOCUMENT_VERSION;
@@ -2246,23 +3200,28 @@ exports.EXTENSION_SECRET_UNSET = EXTENSION_SECRET_UNSET;
2246
3200
  exports.ExtensionAvailability = ExtensionAvailability;
2247
3201
  exports.ExtensionConfigSuppliedBy = ExtensionConfigSuppliedBy;
2248
3202
  exports.ExtensionDomainEntity = ExtensionDomainEntity;
3203
+ exports.GRANTED_SCOPE_KEY = GRANTED_SCOPE_KEY;
3204
+ exports.GrantedScope = GrantedScope;
2249
3205
  exports.HttpApiError = HttpApiError;
2250
3206
  exports.InjectBucket = InjectBucket;
2251
3207
  exports.LOG_EXTENSION_REPOSITORY = LOG_EXTENSION_REPOSITORY;
2252
3208
  exports.LangType = LangType;
2253
- exports.LocalChangesCollector = LocalChangesCollector;
2254
3209
  exports.LogExtensionDomainEntity = LogExtensionDomainEntity;
2255
3210
  exports.ONBOARDING_EXPIRY_DAYS = ONBOARDING_EXPIRY_DAYS;
2256
3211
  exports.ONBOARDING_EXPIRY_MS = ONBOARDING_EXPIRY_MS;
2257
3212
  exports.OptionalCurrentUser = OptionalCurrentUser;
3213
+ exports.PaginatedProcessSummary = PaginatedProcessSummary;
2258
3214
  exports.PaginationResult = PaginationResult;
2259
3215
  exports.PaginationUtils = PaginationUtils;
2260
3216
  exports.QuantityUtils = QuantityUtils;
2261
- exports.ROLES_ANY_STATUS_KEY = ROLES_ANY_STATUS_KEY;
2262
- exports.ROLES_DENY_SELF_KEY = ROLES_DENY_SELF_KEY;
3217
+ exports.RIGHT_METADATA_KEY = RIGHT_METADATA_KEY;
3218
+ exports.RequireRight = RequireRight;
3219
+ exports.SCOPE_DENIALS = SCOPE_DENIALS;
3220
+ exports.SELF = SELF;
2263
3221
  exports.SORT_FIELD_PATTERN = SORT_FIELD_PATTERN;
2264
3222
  exports.SafeMarkup = SafeMarkup;
2265
3223
  exports.UseBucket = UseBucket;
3224
+ exports.attachOne = attachOne;
2266
3225
  exports.bucketProvidersFor = bucketProvidersFor;
2267
3226
  exports.bucketTokenFor = bucketTokenFor;
2268
3227
  exports.buildPaginationResult = buildPaginationResult;
@@ -2271,13 +3230,18 @@ exports.chainRefusalOf = chainRefusalOf;
2271
3230
  exports.chainTextDigest = chainTextDigest;
2272
3231
  exports.checkPaymentAmount = checkPaymentAmount;
2273
3232
  exports.checkPaymentSymbol = checkPaymentSymbol;
3233
+ exports.checkRight = checkRight;
3234
+ exports.checkRightScope = checkRightScope;
2274
3235
  exports.computeOnboardingExpiresAt = computeOnboardingExpiresAt;
2275
3236
  exports.configureExtensionAuth = configureExtensionAuth;
2276
3237
  exports.configurePlatformSettings = configurePlatformSettings;
3238
+ exports.councilRolesOf = councilRolesOf;
2277
3239
  exports.createPaginationResult = createPaginationResult;
3240
+ exports.desktopGrants = desktopGrants;
3241
+ exports.desktopGrantsOf = desktopGrantsOf;
2278
3242
  exports.domainErrorMessage = domainErrorMessage;
3243
+ exports.expandRights = expandRights;
2279
3244
  exports.extensionDatabaseMigrations = extensionDatabaseMigrations;
2280
- exports.extensionEntities = extensionEntities;
2281
3245
  exports.generateHashFromString = generateHashFromString;
2282
3246
  exports.generateRandomHash = generateRandomHash;
2283
3247
  exports.generateUniqueHash = generateUniqueHash;
@@ -2287,21 +3251,27 @@ exports.hasServerSecret = hasServerSecret;
2287
3251
  exports.isChainTextDigest = isChainTextDigest;
2288
3252
  exports.isChainTextOf = isChainTextOf;
2289
3253
  exports.isExtensionAvailable = isExtensionAvailable;
3254
+ exports.memberRolesOf = memberRolesOf;
2290
3255
  exports.mergeSecretConfig = mergeSecretConfig;
2291
- exports.numericColumnTransformer = numericColumnTransformer;
2292
3256
  exports.paginationInputToOffset = paginationInputToOffset;
2293
3257
  exports.parseChainAssert = parseChainAssert;
3258
+ exports.pickDefined = pickDefined;
2294
3259
  exports.platformSettings = platformSettings;
2295
3260
  exports.providerSuppliedPaths = providerSuppliedPaths;
2296
3261
  exports.redactSecretConfig = redactSecretConfig;
2297
3262
  exports.registerExtensionDatabaseMigrations = registerExtensionDatabaseMigrations;
2298
- exports.registerExtensionEntities = registerExtensionEntities;
2299
3263
  exports.resetExtensionDatabaseMigrations = resetExtensionDatabaseMigrations;
2300
- exports.resetExtensionEntities = resetExtensionEntities;
2301
3264
  exports.resolveChainText = resolveChainText;
2302
- exports.resolveSortColumn = resolveSortColumn;
2303
3265
  exports.rethrowChainError = rethrowChainError;
3266
+ exports.rightConditions = rightConditions;
3267
+ exports.rightGrants = rightGrants;
3268
+ exports.rightMatches = rightMatches;
3269
+ exports.rightsByRole = rightsByRole;
3270
+ exports.rightsHeld = rightsHeld;
2304
3271
  exports.sanitizeUserText = sanitizeUserText;
3272
+ exports.scopeConditions = scopeConditions;
3273
+ exports.scopeOfRight = scopeOfRight;
3274
+ exports.scopesMatched = scopesMatched;
2305
3275
  exports.validationMessage = validationMessage;
2306
3276
  exports.verifySignedDocumentAgainstStoredDraft = verifySignedDocumentAgainstStoredDraft;
2307
3277
  exports.waitForEvent = waitForEvent;