@coopenomics/innercoop 2026.8.18-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,326 @@
1
+ 'use strict';
2
+
3
+ class InnerFileStorageError extends Error {
4
+ constructor(message, options) {
5
+ super(message, options);
6
+ this.name = new.target.name;
7
+ }
8
+ }
9
+ class InnerFileStorageObjectNotFoundError extends InnerFileStorageError {
10
+ }
11
+ class InnerFileStorageObjectTooLargeError extends InnerFileStorageError {
12
+ }
13
+ class InnerFileStorageMimeRejectedError extends InnerFileStorageError {
14
+ }
15
+ class InnerFileStorageMetadataValidationError extends InnerFileStorageError {
16
+ }
17
+ class InnerFileStorageBackendUnavailableError extends InnerFileStorageError {
18
+ }
19
+ class InnerFileStorageBucketNotConfiguredError extends InnerFileStorageError {
20
+ }
21
+ const FILE_STORAGE_PORT = Symbol.for("Innercoop.CorePort.FileStorage");
22
+
23
+ const LEDGER2_HISTORY_PORT = Symbol.for("Innercoop.CorePort.Ledger2History");
24
+
25
+ const LOGGER_PORT = Symbol.for("Innercoop.CorePort.Logger");
26
+
27
+ const MESSAGE_CHANNEL_PORT = Symbol.for("Innercoop.CorePort.MessageChannel");
28
+
29
+ const COOPERATIVE_VARS_PORT = Symbol.for("Innercoop.CorePort.CooperativeVars");
30
+
31
+ const DOCUMENT_PORT = Symbol.for("Innercoop.CorePort.Document");
32
+
33
+ var InnerAccountType = /* @__PURE__ */ ((InnerAccountType2) => {
34
+ InnerAccountType2["individual"] = "individual";
35
+ InnerAccountType2["entrepreneur"] = "entrepreneur";
36
+ InnerAccountType2["organization"] = "organization";
37
+ return InnerAccountType2;
38
+ })(InnerAccountType || {});
39
+ var InnerOrganizationType = /* @__PURE__ */ ((InnerOrganizationType2) => {
40
+ InnerOrganizationType2["COOP"] = "coop";
41
+ InnerOrganizationType2["PRODCOOP"] = "prodcoop";
42
+ InnerOrganizationType2["OOO"] = "ooo";
43
+ InnerOrganizationType2["OAO"] = "oao";
44
+ InnerOrganizationType2["ZAO"] = "zao";
45
+ InnerOrganizationType2["PAO"] = "pao";
46
+ InnerOrganizationType2["AO"] = "ao";
47
+ return InnerOrganizationType2;
48
+ })(InnerOrganizationType || {});
49
+ const ACCOUNT_PORT = Symbol.for("Innercoop.CorePort.Account");
50
+
51
+ const NOTIFICATION_PORT = Symbol.for("Innercoop.CorePort.Notification");
52
+
53
+ var ExtendedMeetStatus = /* @__PURE__ */ ((ExtendedMeetStatus2) => {
54
+ ExtendedMeetStatus2["NONE"] = "none";
55
+ ExtendedMeetStatus2["CREATED"] = "created";
56
+ ExtendedMeetStatus2["AUTHORIZED"] = "authorized";
57
+ ExtendedMeetStatus2["PRECLOSED"] = "preclosed";
58
+ ExtendedMeetStatus2["CLOSED"] = "closed";
59
+ ExtendedMeetStatus2["WAITING_FOR_OPENING"] = "waitingForOpening";
60
+ ExtendedMeetStatus2["VOTING_IN_PROGRESS"] = "votingInProgress";
61
+ ExtendedMeetStatus2["EXPIRED_NO_QUORUM"] = "expiredNoQuorum";
62
+ ExtendedMeetStatus2["VOTING_COMPLETED"] = "votingCompleted";
63
+ ExtendedMeetStatus2["ONRESTART"] = "onrestart";
64
+ return ExtendedMeetStatus2;
65
+ })(ExtendedMeetStatus || {});
66
+ const MEET_PORT = Symbol.for("Innercoop.CorePort.Meet");
67
+
68
+ var DecisionEventType = /* @__PURE__ */ ((DecisionEventType2) => {
69
+ DecisionEventType2["SOVIET_DECISION"] = "soviet_decision";
70
+ DecisionEventType2["MEET_DECISION"] = "meet_decision";
71
+ return DecisionEventType2;
72
+ })(DecisionEventType || {});
73
+
74
+ const DECISION_TRACKING_PORT = Symbol.for("Innercoop.CorePort.DecisionTracking");
75
+
76
+ var __defProp = Object.defineProperty;
77
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
78
+ var __publicField = (obj, key, value) => {
79
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
80
+ return value;
81
+ };
82
+ class DecisionTrackedEvent {
83
+ constructor(result) {
84
+ this.result = result;
85
+ }
86
+ }
87
+ __publicField(DecisionTrackedEvent, "eventName", "decision.tracked");
88
+
89
+ const FREE_DECISION_PORT = Symbol.for("Innercoop.CorePort.FreeDecision");
90
+
91
+ var PaymentStatus = /* @__PURE__ */ ((PaymentStatus2) => {
92
+ PaymentStatus2["AWAITING_AUTHORIZATION"] = "awaiting_authorization";
93
+ PaymentStatus2["PENDING"] = "pending";
94
+ PaymentStatus2["PROCESSING"] = "processing";
95
+ PaymentStatus2["PAID"] = "paid";
96
+ PaymentStatus2["COMPLETED"] = "completed";
97
+ PaymentStatus2["FAILED"] = "failed";
98
+ PaymentStatus2["EXPIRED"] = "expired";
99
+ PaymentStatus2["CANCELLED"] = "cancelled";
100
+ PaymentStatus2["REFUNDED"] = "refunded";
101
+ return PaymentStatus2;
102
+ })(PaymentStatus || {});
103
+ var PaymentType = /* @__PURE__ */ ((PaymentType2) => {
104
+ PaymentType2["REGISTRATION"] = "registration";
105
+ PaymentType2["DEPOSIT"] = "deposit";
106
+ PaymentType2["WITHDRAWAL"] = "withdrawal";
107
+ PaymentType2["PAYMENT"] = "payment";
108
+ PaymentType2["REGISTRATION_REFUND"] = "registration_refund";
109
+ PaymentType2["MEMBERSHIP_EXIT"] = "membership_exit";
110
+ PaymentType2["EXPENSE"] = "expense";
111
+ PaymentType2["EXPENSE_RETURN"] = "expense_return";
112
+ PaymentType2["EXPENSE_OVERSPEND"] = "expense_overspend";
113
+ PaymentType2["AID"] = "aid";
114
+ PaymentType2["TAX"] = "tax";
115
+ return PaymentType2;
116
+ })(PaymentType || {});
117
+ const VAT_EXEMPT_NOTE = "\u041D\u0414\u0421 \u043D\u0435 \u043E\u0431\u043B\u0430\u0433\u0430\u0435\u0442\u0441\u044F.";
118
+ var PaymentDirection = /* @__PURE__ */ ((PaymentDirection2) => {
119
+ PaymentDirection2["INCOMING"] = "incoming";
120
+ PaymentDirection2["OUTGOING"] = "outgoing";
121
+ return PaymentDirection2;
122
+ })(PaymentDirection || {});
123
+ const PAYMENT_PORT = Symbol.for("Innercoop.CorePort.Payment");
124
+
125
+ const PAYMENT_PROVIDER_REGISTRY_PORT = Symbol.for("Innercoop.CorePort.PaymentProviderRegistry");
126
+ const PAYMENT_POLLING_STATE_PORT = Symbol.for("Innercoop.CorePort.PaymentPollingState");
127
+ const PAYMENT_NOTICE_LOG_PORT = Symbol.for("Innercoop.CorePort.PaymentNoticeLog");
128
+
129
+ const PAYMENT_METHOD_PORT = Symbol.for("Innercoop.CorePort.PaymentMethod");
130
+
131
+ const PAYMENT_DESK_PORT = Symbol.for("Innercoop.CorePort.PaymentDesk");
132
+
133
+ var ProgramType = /* @__PURE__ */ ((ProgramType2) => {
134
+ ProgramType2["MAIN"] = "main";
135
+ ProgramType2["MARKETPLACE"] = "marketplace";
136
+ ProgramType2["GENERATOR"] = "generator";
137
+ ProgramType2["BLAGOROST"] = "blagorost";
138
+ return ProgramType2;
139
+ })(ProgramType || {});
140
+ const PROGRAM_ID_BY_TYPE = {
141
+ ["main" /* MAIN */]: "1",
142
+ ["marketplace" /* MARKETPLACE */]: "2",
143
+ ["generator" /* GENERATOR */]: "3",
144
+ ["blagorost" /* BLAGOROST */]: "4"
145
+ };
146
+ const PROGRAM_TYPE_BY_ID = {
147
+ "1": "main" /* MAIN */,
148
+ "2": "marketplace" /* MARKETPLACE */,
149
+ "3": "generator" /* GENERATOR */,
150
+ "4": "blagorost" /* BLAGOROST */
151
+ };
152
+ function getProgramType(programId) {
153
+ return PROGRAM_TYPE_BY_ID[programId] ?? "main" /* MAIN */;
154
+ }
155
+ function getProgramId(programType) {
156
+ return PROGRAM_ID_BY_TYPE[programType] ?? "1";
157
+ }
158
+
159
+ const PARTICIPANT_REGISTERED_EVENT = "participant.registered";
160
+
161
+ const PROGRAM_WALLET_PORT = Symbol.for("Innercoop.CorePort.ProgramWallet");
162
+ const USER_WALLET_PORT = Symbol.for("Innercoop.CorePort.UserWallet");
163
+
164
+ const PROGRAM_AGREEMENT_PORT = Symbol.for("Innercoop.CorePort.ProgramAgreement");
165
+
166
+ var InnerKeyPermission = /* @__PURE__ */ ((InnerKeyPermission2) => {
167
+ InnerKeyPermission2["ACTIVE"] = "active";
168
+ return InnerKeyPermission2;
169
+ })(InnerKeyPermission || {});
170
+ const VAULT_PORT = Symbol.for("Innercoop.CorePort.Vault");
171
+
172
+ const ONBOARDING_STEP_REGISTRY_PORT = Symbol.for("Innercoop.CorePort.OnboardingStepRegistry");
173
+ const ONBOARDING_COMPLETED_EVENT = "onboarding.completed";
174
+
175
+ const BRANCH_PORT = Symbol.for("Innercoop.CorePort.Branch");
176
+
177
+ var ProgramKey = /* @__PURE__ */ ((ProgramKey2) => {
178
+ ProgramKey2["GENERATION"] = "GENERATION";
179
+ ProgramKey2["CAPITALIZATION"] = "CAPITALIZATION";
180
+ ProgramKey2["MARKETPLACE"] = "MARKETPLACE";
181
+ ProgramKey2["UNDEFINED"] = "UNDEFINED";
182
+ return ProgramKey2;
183
+ })(ProgramKey || {});
184
+ const REGISTRATION_REGISTRY_PORT = Symbol.for("Innercoop.CorePort.RegistrationRegistry");
185
+
186
+ const CHAIN_PORT = Symbol.for("Innercoop.CorePort.Chain");
187
+
188
+ const CHAIN_RESOURCES_PORT = Symbol.for("Innercoop.CorePort.ChainResources");
189
+
190
+ const EXTENSION_CONFIG_PORT = Symbol.for("Innercoop.CorePort.ExtensionConfig");
191
+
192
+ const EXTENSION_DATABASE_PORT = Symbol.for("Innercoop.CorePort.ExtensionDatabase");
193
+
194
+ const REALTIME_CHANNEL_PORT = Symbol.for("Innercoop.CorePort.RealtimeChannel");
195
+
196
+ const COUNCIL_PORT = Symbol.for("Innercoop.CorePort.Council");
197
+
198
+ const USER_DIRECTORY_PORT = Symbol.for("Innercoop.CorePort.UserDirectory");
199
+
200
+ const CANDIDATE_PORT = Symbol.for("Innercoop.CorePort.Candidate");
201
+
202
+ const USER_CERTIFICATE_PORT = Symbol.for("Innercoop.CorePort.UserCertificate");
203
+
204
+ const AGREEMENT_CATALOG_PORT = Symbol.for("Innercoop.CorePort.AgreementCatalog");
205
+
206
+ const MUTATION_LOG_PORT = Symbol.for("Innercoop.CorePort.MutationLog");
207
+
208
+ const SECRET_CIPHER_PORT = Symbol.for("Innercoop.CorePort.SecretCipher");
209
+
210
+ const INTEGRATION_SETTINGS_PORT = Symbol.for("Innercoop.CorePort.IntegrationSettings");
211
+
212
+ var MonoAccountStatus = /* @__PURE__ */ ((MonoAccountStatus2) => {
213
+ MonoAccountStatus2["Created"] = "created";
214
+ MonoAccountStatus2["Joined"] = "joined";
215
+ MonoAccountStatus2["Payed"] = "payed";
216
+ MonoAccountStatus2["Registered"] = "registered";
217
+ MonoAccountStatus2["Active"] = "active";
218
+ MonoAccountStatus2["Failed"] = "failed";
219
+ MonoAccountStatus2["Refunding"] = "refunding";
220
+ MonoAccountStatus2["Refunded"] = "refunded";
221
+ MonoAccountStatus2["Blocked"] = "blocked";
222
+ return MonoAccountStatus2;
223
+ })(MonoAccountStatus || {});
224
+
225
+ function isEligibleForParticipantMassNotification(account) {
226
+ const p = account.provider_account;
227
+ if (!p) {
228
+ return false;
229
+ }
230
+ if (!p.is_registered || !p.has_account) {
231
+ return false;
232
+ }
233
+ const status = p.status;
234
+ if (status === MonoAccountStatus.Failed || status === MonoAccountStatus.Refunded || status === MonoAccountStatus.Blocked) {
235
+ return false;
236
+ }
237
+ return status === MonoAccountStatus.Active || status === MonoAccountStatus.Registered;
238
+ }
239
+ function isEligibleForActiveCoopCalendarBroadcast(account) {
240
+ const p = account.provider_account;
241
+ if (!p) {
242
+ return false;
243
+ }
244
+ if (!p.is_registered || !p.has_account) {
245
+ return false;
246
+ }
247
+ const status = p.status;
248
+ if (status === MonoAccountStatus.Failed || status === MonoAccountStatus.Refunded || status === MonoAccountStatus.Blocked) {
249
+ return false;
250
+ }
251
+ return status === MonoAccountStatus.Active;
252
+ }
253
+
254
+ const USER_DATA_PORT = Symbol.for("Innercoop.CorePort.UserData");
255
+
256
+ const ORGANIZATION_PORT = Symbol.for("Innercoop.CorePort.Organization");
257
+ const INDIVIDUAL_PORT = Symbol.for("Innercoop.CorePort.Individual");
258
+
259
+ exports.ACCOUNT_PORT = ACCOUNT_PORT;
260
+ exports.AGREEMENT_CATALOG_PORT = AGREEMENT_CATALOG_PORT;
261
+ exports.BRANCH_PORT = BRANCH_PORT;
262
+ exports.CANDIDATE_PORT = CANDIDATE_PORT;
263
+ exports.CHAIN_PORT = CHAIN_PORT;
264
+ exports.CHAIN_RESOURCES_PORT = CHAIN_RESOURCES_PORT;
265
+ exports.COOPERATIVE_VARS_PORT = COOPERATIVE_VARS_PORT;
266
+ exports.COUNCIL_PORT = COUNCIL_PORT;
267
+ exports.DECISION_TRACKING_PORT = DECISION_TRACKING_PORT;
268
+ exports.DOCUMENT_PORT = DOCUMENT_PORT;
269
+ exports.DecisionEventType = DecisionEventType;
270
+ exports.DecisionTrackedEvent = DecisionTrackedEvent;
271
+ exports.EXTENSION_CONFIG_PORT = EXTENSION_CONFIG_PORT;
272
+ exports.EXTENSION_DATABASE_PORT = EXTENSION_DATABASE_PORT;
273
+ exports.ExtendedMeetStatus = ExtendedMeetStatus;
274
+ exports.FILE_STORAGE_PORT = FILE_STORAGE_PORT;
275
+ exports.FREE_DECISION_PORT = FREE_DECISION_PORT;
276
+ exports.INDIVIDUAL_PORT = INDIVIDUAL_PORT;
277
+ exports.INTEGRATION_SETTINGS_PORT = INTEGRATION_SETTINGS_PORT;
278
+ exports.InnerAccountType = InnerAccountType;
279
+ exports.InnerFileStorageBackendUnavailableError = InnerFileStorageBackendUnavailableError;
280
+ exports.InnerFileStorageBucketNotConfiguredError = InnerFileStorageBucketNotConfiguredError;
281
+ exports.InnerFileStorageError = InnerFileStorageError;
282
+ exports.InnerFileStorageMetadataValidationError = InnerFileStorageMetadataValidationError;
283
+ exports.InnerFileStorageMimeRejectedError = InnerFileStorageMimeRejectedError;
284
+ exports.InnerFileStorageObjectNotFoundError = InnerFileStorageObjectNotFoundError;
285
+ exports.InnerFileStorageObjectTooLargeError = InnerFileStorageObjectTooLargeError;
286
+ exports.InnerKeyPermission = InnerKeyPermission;
287
+ exports.InnerOrganizationType = InnerOrganizationType;
288
+ exports.LEDGER2_HISTORY_PORT = LEDGER2_HISTORY_PORT;
289
+ exports.LOGGER_PORT = LOGGER_PORT;
290
+ exports.MEET_PORT = MEET_PORT;
291
+ exports.MESSAGE_CHANNEL_PORT = MESSAGE_CHANNEL_PORT;
292
+ exports.MUTATION_LOG_PORT = MUTATION_LOG_PORT;
293
+ exports.MonoAccountStatus = MonoAccountStatus;
294
+ exports.NOTIFICATION_PORT = NOTIFICATION_PORT;
295
+ exports.ONBOARDING_COMPLETED_EVENT = ONBOARDING_COMPLETED_EVENT;
296
+ exports.ONBOARDING_STEP_REGISTRY_PORT = ONBOARDING_STEP_REGISTRY_PORT;
297
+ exports.ORGANIZATION_PORT = ORGANIZATION_PORT;
298
+ exports.PARTICIPANT_REGISTERED_EVENT = PARTICIPANT_REGISTERED_EVENT;
299
+ exports.PAYMENT_DESK_PORT = PAYMENT_DESK_PORT;
300
+ exports.PAYMENT_METHOD_PORT = PAYMENT_METHOD_PORT;
301
+ exports.PAYMENT_NOTICE_LOG_PORT = PAYMENT_NOTICE_LOG_PORT;
302
+ exports.PAYMENT_POLLING_STATE_PORT = PAYMENT_POLLING_STATE_PORT;
303
+ exports.PAYMENT_PORT = PAYMENT_PORT;
304
+ exports.PAYMENT_PROVIDER_REGISTRY_PORT = PAYMENT_PROVIDER_REGISTRY_PORT;
305
+ exports.PROGRAM_AGREEMENT_PORT = PROGRAM_AGREEMENT_PORT;
306
+ exports.PROGRAM_ID_BY_TYPE = PROGRAM_ID_BY_TYPE;
307
+ exports.PROGRAM_TYPE_BY_ID = PROGRAM_TYPE_BY_ID;
308
+ exports.PROGRAM_WALLET_PORT = PROGRAM_WALLET_PORT;
309
+ exports.PaymentDirection = PaymentDirection;
310
+ exports.PaymentStatus = PaymentStatus;
311
+ exports.PaymentType = PaymentType;
312
+ exports.ProgramKey = ProgramKey;
313
+ exports.ProgramType = ProgramType;
314
+ exports.REALTIME_CHANNEL_PORT = REALTIME_CHANNEL_PORT;
315
+ exports.REGISTRATION_REGISTRY_PORT = REGISTRATION_REGISTRY_PORT;
316
+ exports.SECRET_CIPHER_PORT = SECRET_CIPHER_PORT;
317
+ exports.USER_CERTIFICATE_PORT = USER_CERTIFICATE_PORT;
318
+ exports.USER_DATA_PORT = USER_DATA_PORT;
319
+ exports.USER_DIRECTORY_PORT = USER_DIRECTORY_PORT;
320
+ exports.USER_WALLET_PORT = USER_WALLET_PORT;
321
+ exports.VAT_EXEMPT_NOTE = VAT_EXEMPT_NOTE;
322
+ exports.VAULT_PORT = VAULT_PORT;
323
+ exports.getProgramId = getProgramId;
324
+ exports.getProgramType = getProgramType;
325
+ exports.isEligibleForActiveCoopCalendarBroadcast = isEligibleForActiveCoopCalendarBroadcast;
326
+ exports.isEligibleForParticipantMassNotification = isEligibleForParticipantMassNotification;