@stamhoofd/models 2.119.0 → 2.120.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/factories/AddressFactory.d.ts.map +1 -0
- package/dist/factories/AddressFactory.js +38 -0
- package/dist/factories/AddressFactory.js.map +1 -0
- package/dist/factories/BalanceItemFactory.d.ts +29 -0
- package/dist/factories/BalanceItemFactory.d.ts.map +1 -0
- package/dist/factories/BalanceItemFactory.js +56 -0
- package/dist/factories/BalanceItemFactory.js.map +1 -0
- package/dist/factories/DocumentTemplateFactory.d.ts +22 -0
- package/dist/factories/DocumentTemplateFactory.d.ts.map +1 -0
- package/dist/factories/DocumentTemplateFactory.js +145 -0
- package/dist/factories/DocumentTemplateFactory.js.map +1 -0
- package/dist/factories/EmailTemplateFactory.d.ts +18 -0
- package/dist/factories/EmailTemplateFactory.d.ts.map +1 -0
- package/dist/factories/EmailTemplateFactory.js +39 -0
- package/dist/factories/EmailTemplateFactory.js.map +1 -0
- package/dist/factories/EmergencyContactFactory.d.ts.map +1 -0
- package/dist/factories/EmergencyContactFactory.js +38 -0
- package/dist/factories/EmergencyContactFactory.js.map +1 -0
- package/dist/factories/EventFactory.d.ts +19 -0
- package/dist/factories/EventFactory.d.ts.map +1 -0
- package/dist/factories/EventFactory.js +31 -0
- package/dist/factories/EventFactory.js.map +1 -0
- package/dist/factories/EventNotificationFactory.d.ts +23 -0
- package/dist/factories/EventNotificationFactory.d.ts.map +1 -0
- package/dist/factories/EventNotificationFactory.js +40 -0
- package/dist/factories/EventNotificationFactory.js.map +1 -0
- package/dist/factories/EventNotificationTypeFactory.d.ts +12 -0
- package/dist/factories/EventNotificationTypeFactory.d.ts.map +1 -0
- package/dist/factories/EventNotificationTypeFactory.js +21 -0
- package/dist/factories/EventNotificationTypeFactory.js.map +1 -0
- package/dist/factories/GroupFactory.d.ts +27 -0
- package/dist/factories/GroupFactory.d.ts.map +1 -0
- package/dist/factories/GroupFactory.js +88 -0
- package/dist/factories/GroupFactory.js.map +1 -0
- package/dist/factories/MemberFactory.d.ts +26 -0
- package/dist/factories/MemberFactory.d.ts.map +1 -0
- package/dist/factories/MemberFactory.js +131 -0
- package/dist/factories/MemberFactory.js.map +1 -0
- package/dist/factories/MemberResponsibilityRecordFactory.d.ts +15 -0
- package/dist/factories/MemberResponsibilityRecordFactory.d.ts.map +1 -0
- package/dist/factories/MemberResponsibilityRecordFactory.js +30 -0
- package/dist/factories/MemberResponsibilityRecordFactory.js.map +1 -0
- package/dist/factories/OrganizationFactory.d.ts +20 -0
- package/dist/factories/OrganizationFactory.d.ts.map +1 -0
- package/dist/factories/OrganizationFactory.js +61 -0
- package/dist/factories/OrganizationFactory.js.map +1 -0
- package/dist/factories/OrganizationRegistrationPeriodFactory.d.ts +13 -0
- package/dist/factories/OrganizationRegistrationPeriodFactory.d.ts.map +1 -0
- package/dist/factories/OrganizationRegistrationPeriodFactory.js +16 -0
- package/dist/factories/OrganizationRegistrationPeriodFactory.js.map +1 -0
- package/dist/factories/OrganizationTagFactory.d.ts.map +1 -0
- package/dist/factories/OrganizationTagFactory.js +19 -0
- package/dist/factories/OrganizationTagFactory.js.map +1 -0
- package/dist/factories/ParentFactory.d.ts.map +1 -0
- package/dist/factories/ParentFactory.js +39 -0
- package/dist/factories/ParentFactory.js.map +1 -0
- package/dist/factories/PlatformEventTypeFactory.d.ts.map +1 -0
- package/dist/factories/PlatformEventTypeFactory.js +23 -0
- package/dist/factories/PlatformEventTypeFactory.js.map +1 -0
- package/dist/factories/PlatformResponsibilityFactory.d.ts.map +1 -0
- package/dist/factories/PlatformResponsibilityFactory.js +21 -0
- package/dist/factories/PlatformResponsibilityFactory.js.map +1 -0
- package/dist/factories/RecordAnswerFactory.d.ts +18 -0
- package/dist/factories/RecordAnswerFactory.d.ts.map +1 -0
- package/dist/factories/RecordAnswerFactory.js +91 -0
- package/dist/factories/RecordAnswerFactory.js.map +1 -0
- package/dist/factories/RecordCategoryFactory.d.ts +11 -0
- package/dist/factories/RecordCategoryFactory.d.ts.map +1 -0
- package/dist/factories/RecordCategoryFactory.js +19 -0
- package/dist/factories/RecordCategoryFactory.js.map +1 -0
- package/dist/factories/RecordFactory.d.ts.map +1 -0
- package/dist/factories/RecordFactory.js +16 -0
- package/dist/factories/RecordFactory.js.map +1 -0
- package/dist/factories/RegisterCodeFactory.d.ts.map +1 -0
- package/dist/factories/RegisterCodeFactory.js +14 -0
- package/dist/factories/RegisterCodeFactory.js.map +1 -0
- package/dist/factories/RegistrationFactory.d.ts +21 -0
- package/dist/factories/RegistrationFactory.d.ts.map +1 -0
- package/dist/factories/RegistrationFactory.js +21 -0
- package/dist/factories/RegistrationFactory.js.map +1 -0
- package/dist/factories/RegistrationPeriodFactory.d.ts +16 -0
- package/dist/factories/RegistrationPeriodFactory.d.ts.map +1 -0
- package/dist/factories/RegistrationPeriodFactory.js +30 -0
- package/dist/factories/RegistrationPeriodFactory.js.map +1 -0
- package/dist/factories/STPackageFactory.d.ts +15 -0
- package/dist/factories/STPackageFactory.d.ts.map +1 -0
- package/dist/factories/STPackageFactory.js +34 -0
- package/dist/factories/STPackageFactory.js.map +1 -0
- package/dist/factories/UserFactory.d.ts +22 -0
- package/dist/factories/UserFactory.d.ts.map +1 -0
- package/dist/factories/UserFactory.js +63 -0
- package/dist/factories/UserFactory.js.map +1 -0
- package/dist/factories/WebshopFactory.d.ts +17 -0
- package/dist/factories/WebshopFactory.d.ts.map +1 -0
- package/dist/factories/WebshopFactory.js +35 -0
- package/dist/factories/WebshopFactory.js.map +1 -0
- package/dist/factories/index.d.ts.map +1 -0
- package/dist/factories/index.js +27 -0
- package/dist/factories/index.js.map +1 -0
- package/dist/helpers/DNSValidator.d.ts +6 -0
- package/dist/helpers/DNSValidator.d.ts.map +1 -0
- package/dist/helpers/DNSValidator.js +142 -0
- package/dist/helpers/DNSValidator.js.map +1 -0
- package/dist/helpers/EmailBuilder.d.ts +88 -0
- package/dist/helpers/EmailBuilder.d.ts.map +1 -0
- package/dist/helpers/EmailBuilder.js +603 -0
- package/dist/helpers/EmailBuilder.js.map +1 -0
- package/dist/helpers/Handlebars.d.ts.map +1 -0
- package/dist/helpers/Handlebars.js +244 -0
- package/dist/helpers/Handlebars.js.map +1 -0
- package/dist/helpers/MemberMerger.d.ts.map +1 -0
- package/dist/helpers/MemberMerger.js +364 -0
- package/dist/helpers/MemberMerger.js.map +1 -0
- package/dist/helpers/RateLimiter.d.ts.map +1 -0
- package/dist/helpers/RateLimiter.js +64 -0
- package/dist/helpers/RateLimiter.js.map +1 -0
- package/dist/helpers/WebshopCounter.d.ts +8 -0
- package/dist/helpers/WebshopCounter.d.ts.map +1 -0
- package/dist/helpers/WebshopCounter.js +46 -0
- package/dist/helpers/WebshopCounter.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/migrations/1605262045-import-postcodes.d.ts.map +1 -0
- package/dist/migrations/1605262045-import-postcodes.js +117 -0
- package/dist/migrations/1605262045-import-postcodes.js.map +1 -0
- package/dist/migrations/1605262046-import-postcodes-nl.d.ts.map +1 -0
- package/dist/migrations/1605262046-import-postcodes-nl.js +80 -0
- package/dist/migrations/1605262046-import-postcodes-nl.js.map +1 -0
- package/dist/migrations/1720080976-convert-charset-leads.d.ts +10 -0
- package/dist/migrations/1720080976-convert-charset-leads.d.ts.map +1 -0
- package/dist/migrations/1720080976-convert-charset-leads.js +41 -0
- package/dist/migrations/1720080976-convert-charset-leads.js.map +1 -0
- package/dist/models/AuditLog.d.ts.map +1 -0
- package/dist/models/AuditLog.js +94 -0
- package/dist/models/AuditLog.js.map +1 -0
- package/dist/models/BalanceItem.d.ts +218 -0
- package/dist/models/BalanceItem.d.ts.map +1 -0
- package/dist/models/BalanceItem.js +626 -0
- package/dist/models/BalanceItem.js.map +1 -0
- package/dist/models/BalanceItemPayment.d.ts +24 -0
- package/dist/models/BalanceItemPayment.d.ts.map +1 -0
- package/dist/models/BalanceItemPayment.js +65 -0
- package/dist/models/BalanceItemPayment.js.map +1 -0
- package/dist/models/BuckarooPayment.d.ts.map +1 -0
- package/dist/models/BuckarooPayment.js +24 -0
- package/dist/models/BuckarooPayment.js.map +1 -0
- package/dist/models/CachedBalance.d.ts +51 -0
- package/dist/models/CachedBalance.d.ts.map +1 -0
- package/dist/models/CachedBalance.js +390 -0
- package/dist/models/CachedBalance.js.map +1 -0
- package/dist/models/Document.d.ts +41 -0
- package/dist/models/Document.d.ts.map +1 -0
- package/dist/models/Document.js +251 -0
- package/dist/models/Document.js.map +1 -0
- package/dist/models/DocumentTemplate.d.ts +56 -0
- package/dist/models/DocumentTemplate.d.ts.map +1 -0
- package/dist/models/DocumentTemplate.js +719 -0
- package/dist/models/DocumentTemplate.js.map +1 -0
- package/dist/models/Email.d.ts +141 -0
- package/dist/models/Email.d.ts.map +1 -0
- package/dist/models/Email.js +1341 -0
- package/dist/models/Email.js.map +1 -0
- package/dist/models/EmailRecipient.d.ts.map +1 -0
- package/dist/models/EmailRecipient.js +194 -0
- package/dist/models/EmailRecipient.js.map +1 -0
- package/dist/models/EmailTemplate.d.ts +24 -0
- package/dist/models/EmailTemplate.d.ts.map +1 -0
- package/dist/models/EmailTemplate.js +79 -0
- package/dist/models/EmailTemplate.js.map +1 -0
- package/dist/models/EmailVerificationCode.d.ts +61 -0
- package/dist/models/EmailVerificationCode.d.ts.map +1 -0
- package/dist/models/EmailVerificationCode.js +339 -0
- package/dist/models/EmailVerificationCode.js.map +1 -0
- package/dist/models/Event.d.ts.map +1 -0
- package/dist/models/Event.js +132 -0
- package/dist/models/Event.js.map +1 -0
- package/dist/models/EventNotification.d.ts +32 -0
- package/dist/models/EventNotification.d.ts.map +1 -0
- package/dist/models/EventNotification.js +98 -0
- package/dist/models/EventNotification.js.map +1 -0
- package/dist/models/Group.d.ts +46 -0
- package/dist/models/Group.d.ts.map +1 -0
- package/dist/models/Group.js +213 -0
- package/dist/models/Group.js.map +1 -0
- package/dist/models/Image.d.ts +17 -0
- package/dist/models/Image.d.ts.map +1 -0
- package/dist/models/Image.js +169 -0
- package/dist/models/Image.js.map +1 -0
- package/dist/models/Invoice.d.ts.map +1 -0
- package/dist/models/Invoice.js +186 -0
- package/dist/models/Invoice.js.map +1 -0
- package/dist/models/InvoicedBalanceItem.d.ts +66 -0
- package/dist/models/InvoicedBalanceItem.d.ts.map +1 -0
- package/dist/models/InvoicedBalanceItem.js +130 -0
- package/dist/models/InvoicedBalanceItem.js.map +1 -0
- package/dist/models/Member.d.ts +114 -0
- package/dist/models/Member.d.ts.map +1 -0
- package/dist/models/Member.js +415 -0
- package/dist/models/Member.js.map +1 -0
- package/dist/models/MemberPlatformMembership.d.ts +48 -0
- package/dist/models/MemberPlatformMembership.d.ts.map +1 -0
- package/dist/models/MemberPlatformMembership.js +377 -0
- package/dist/models/MemberPlatformMembership.js.map +1 -0
- package/dist/models/MemberResponsibilityRecord.d.ts +17 -0
- package/dist/models/MemberResponsibilityRecord.d.ts.map +1 -0
- package/dist/models/MemberResponsibilityRecord.js +65 -0
- package/dist/models/MemberResponsibilityRecord.js.map +1 -0
- package/dist/models/MemberUser.d.ts.map +1 -0
- package/dist/models/MemberUser.js +22 -0
- package/dist/models/MemberUser.js.map +1 -0
- package/dist/models/MergedMember.d.ts +23 -0
- package/dist/models/MergedMember.d.ts.map +1 -0
- package/dist/models/MergedMember.js +123 -0
- package/dist/models/MergedMember.js.map +1 -0
- package/dist/models/MolliePayment.d.ts.map +1 -0
- package/dist/models/MolliePayment.js +24 -0
- package/dist/models/MolliePayment.js.map +1 -0
- package/dist/models/MollieToken.d.ts +45 -0
- package/dist/models/MollieToken.d.ts.map +1 -0
- package/dist/models/MollieToken.js +330 -0
- package/dist/models/MollieToken.js.map +1 -0
- package/dist/models/OneTimeToken.d.ts +38 -0
- package/dist/models/OneTimeToken.d.ts.map +1 -0
- package/dist/models/OneTimeToken.js +125 -0
- package/dist/models/OneTimeToken.js.map +1 -0
- package/dist/models/Order.d.ts +115 -0
- package/dist/models/Order.d.ts.map +1 -0
- package/dist/models/Order.js +908 -0
- package/dist/models/Order.js.map +1 -0
- package/dist/models/Organization.d.ts +128 -0
- package/dist/models/Organization.d.ts.map +1 -0
- package/dist/models/Organization.js +846 -0
- package/dist/models/Organization.js.map +1 -0
- package/dist/models/OrganizationRegistrationPeriod.d.ts +22 -0
- package/dist/models/OrganizationRegistrationPeriod.d.ts.map +1 -0
- package/dist/models/OrganizationRegistrationPeriod.js +129 -0
- package/dist/models/OrganizationRegistrationPeriod.js.map +1 -0
- package/dist/models/PasswordToken.d.ts +31 -0
- package/dist/models/PasswordToken.d.ts.map +1 -0
- package/dist/models/PasswordToken.js +129 -0
- package/dist/models/PasswordToken.js.map +1 -0
- package/dist/models/PayconiqPayment.d.ts +24 -0
- package/dist/models/PayconiqPayment.d.ts.map +1 -0
- package/dist/models/PayconiqPayment.js +272 -0
- package/dist/models/PayconiqPayment.js.map +1 -0
- package/dist/models/Payment.d.ts +120 -0
- package/dist/models/Payment.d.ts.map +1 -0
- package/dist/models/Payment.js +289 -0
- package/dist/models/Payment.js.map +1 -0
- package/dist/models/Platform.d.ts.map +1 -0
- package/dist/models/Platform.js +178 -0
- package/dist/models/Platform.js.map +1 -0
- package/dist/models/RegisterCode.d.ts.map +1 -0
- package/dist/models/RegisterCode.js +76 -0
- package/dist/models/RegisterCode.js.map +1 -0
- package/dist/models/Registration.d.ts +85 -0
- package/dist/models/Registration.d.ts.map +1 -0
- package/dist/models/Registration.js +190 -0
- package/dist/models/Registration.js.map +1 -0
- package/dist/models/RegistrationPeriod.d.ts.map +1 -0
- package/dist/models/RegistrationPeriod.js +140 -0
- package/dist/models/RegistrationPeriod.js.map +1 -0
- package/dist/models/STCredit.d.ts.map +1 -0
- package/dist/models/STCredit.js +61 -0
- package/dist/models/STCredit.js.map +1 -0
- package/dist/models/STInvoice.d.ts +37 -0
- package/dist/models/STInvoice.d.ts.map +1 -0
- package/dist/models/STInvoice.js +139 -0
- package/dist/models/STInvoice.js.map +1 -0
- package/dist/models/STPackage.d.ts.map +1 -0
- package/dist/models/STPackage.js +276 -0
- package/dist/models/STPackage.js.map +1 -0
- package/dist/models/STPendingInvoice.d.ts +26 -0
- package/dist/models/STPendingInvoice.d.ts.map +1 -0
- package/dist/models/STPendingInvoice.js +68 -0
- package/dist/models/STPendingInvoice.js.map +1 -0
- package/dist/models/StripeAccount.d.ts.map +1 -0
- package/dist/models/StripeAccount.js +81 -0
- package/dist/models/StripeAccount.js.map +1 -0
- package/dist/models/StripeCheckoutSession.d.ts.map +1 -0
- package/dist/models/StripeCheckoutSession.js +35 -0
- package/dist/models/StripeCheckoutSession.js.map +1 -0
- package/dist/models/StripePaymentIntent.d.ts.map +1 -0
- package/dist/models/StripePaymentIntent.js +35 -0
- package/dist/models/StripePaymentIntent.js.map +1 -0
- package/dist/models/Ticket.d.ts +65 -0
- package/dist/models/Ticket.d.ts.map +1 -0
- package/dist/models/Ticket.js +157 -0
- package/dist/models/Ticket.js.map +1 -0
- package/dist/models/Token.d.ts +48 -0
- package/dist/models/Token.d.ts.map +1 -0
- package/dist/models/Token.js +208 -0
- package/dist/models/Token.js.map +1 -0
- package/dist/models/UitpasClientCredential.d.ts.map +1 -0
- package/dist/models/UitpasClientCredential.js +62 -0
- package/dist/models/UitpasClientCredential.js.map +1 -0
- package/dist/models/UsedRegisterCode.d.ts.map +1 -0
- package/dist/models/UsedRegisterCode.js +58 -0
- package/dist/models/UsedRegisterCode.js.map +1 -0
- package/dist/models/User.d.ts +76 -0
- package/dist/models/User.d.ts.map +1 -0
- package/dist/models/User.js +484 -0
- package/dist/models/User.js.map +1 -0
- package/dist/models/UserPermissions.d.ts +16 -0
- package/dist/models/UserPermissions.d.ts.map +1 -0
- package/dist/models/UserPermissions.js +56 -0
- package/dist/models/UserPermissions.js.map +1 -0
- package/dist/models/Webshop.d.ts +45 -0
- package/dist/models/Webshop.d.ts.map +1 -0
- package/dist/models/Webshop.js +187 -0
- package/dist/models/Webshop.js.map +1 -0
- package/dist/models/WebshopDiscountCode.d.ts.map +1 -0
- package/dist/models/WebshopDiscountCode.js +89 -0
- package/dist/models/WebshopDiscountCode.js.map +1 -0
- package/dist/models/WebshopUitpasNumber.d.ts.map +1 -0
- package/dist/models/WebshopUitpasNumber.js +91 -0
- package/dist/models/WebshopUitpasNumber.js.map +1 -0
- package/dist/models/_relations.d.ts +8 -0
- package/dist/models/_relations.d.ts.map +1 -0
- package/dist/models/_relations.js +110 -0
- package/dist/models/_relations.js.map +1 -0
- package/dist/models/addresses/City.d.ts +15 -0
- package/dist/models/addresses/City.d.ts.map +1 -0
- package/dist/models/addresses/City.js +35 -0
- package/dist/models/addresses/City.js.map +1 -0
- package/dist/models/addresses/PostalCode.d.ts +21 -0
- package/dist/models/addresses/PostalCode.d.ts.map +1 -0
- package/dist/models/addresses/PostalCode.js +139 -0
- package/dist/models/addresses/PostalCode.js.map +1 -0
- package/dist/models/addresses/Province.d.ts +9 -0
- package/dist/models/addresses/Province.d.ts.map +1 -0
- package/dist/models/addresses/Province.js +24 -0
- package/dist/models/addresses/Province.js.map +1 -0
- package/dist/models/addresses/Street.d.ts.map +1 -0
- package/dist/models/addresses/Street.js +26 -0
- package/dist/models/addresses/Street.js.map +1 -0
- package/dist/models/index.d.ts +55 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +55 -0
- package/dist/models/index.js.map +1 -0
- package/dist/structures/OrganizationServerMetaData.d.ts.map +1 -0
- package/dist/structures/OrganizationServerMetaData.js +130 -0
- package/dist/structures/OrganizationServerMetaData.js.map +1 -0
- package/package.json +13 -10
- package/src/factories/AddressFactory.ts +3 -2
- package/src/factories/BalanceItemFactory.ts +2 -1
- package/src/factories/DocumentTemplateFactory.ts +2 -1
- package/src/factories/EmailTemplateFactory.ts +3 -2
- package/src/factories/EmergencyContactFactory.ts +1 -1
- package/src/factories/EventFactory.ts +2 -2
- package/src/factories/EventNotificationFactory.ts +6 -4
- package/src/factories/EventNotificationTypeFactory.ts +2 -1
- package/src/factories/GroupFactory.ts +4 -3
- package/src/factories/MemberFactory.ts +6 -5
- package/src/factories/MemberResponsibilityRecordFactory.ts +3 -2
- package/src/factories/OrganizationFactory.ts +4 -2
- package/src/factories/OrganizationRegistrationPeriodFactory.ts +2 -2
- package/src/factories/ParentFactory.ts +1 -1
- package/src/factories/RecordAnswerFactory.ts +2 -1
- package/src/factories/RecordCategoryFactory.ts +4 -2
- package/src/factories/RegistrationFactory.ts +5 -4
- package/src/factories/RegistrationPeriodFactory.ts +2 -1
- package/src/factories/STPackageFactory.ts +1 -1
- package/src/factories/UserFactory.ts +3 -2
- package/src/factories/WebshopFactory.ts +3 -2
- package/src/helpers/DNSValidator.ts +2 -1
- package/src/helpers/EmailBuilder.ts +13 -4
- package/src/helpers/Handlebars.ts +3 -3
- package/src/helpers/MemberMerger.test.ts +1 -1
- package/src/helpers/MemberMerger.ts +5 -4
- package/src/helpers/WebshopCounter.ts +1 -1
- package/src/migrations/1605262045-import-postcodes.ts +1 -1
- package/src/migrations/1605262046-import-postcodes-nl.ts +2 -2
- package/src/migrations/1720080976-convert-charset-leads.ts +53 -0
- package/src/models/AuditLog.ts +2 -1
- package/src/models/BalanceItem.ts +4 -3
- package/src/models/BalanceItemPayment.ts +9 -6
- package/src/models/CachedBalance.test.ts +331 -0
- package/src/models/CachedBalance.ts +3 -2
- package/src/models/Document.ts +2 -2
- package/src/models/DocumentTemplate.ts +5 -3
- package/src/models/Email.test.ts +32 -31
- package/src/models/Email.ts +7 -4
- package/src/models/EmailTemplate.ts +2 -1
- package/src/models/EmailVerificationCode.ts +7 -5
- package/src/models/EventNotification.ts +3 -2
- package/src/models/Group.ts +5 -15
- package/src/models/Image.ts +2 -1
- package/src/models/InvoicedBalanceItem.ts +9 -8
- package/src/models/Member.ts +8 -4
- package/src/models/MemberPlatformMembership.ts +1 -1
- package/src/models/MemberResponsibilityRecord.ts +2 -1
- package/src/models/MergedMember.ts +1 -1
- package/src/models/MollieToken.ts +3 -3
- package/src/models/OneTimeToken.ts +1 -1
- package/src/models/Order.ts +17 -9
- package/src/models/Organization.ts +39 -11
- package/src/models/OrganizationRegistrationPeriod.ts +2 -2
- package/src/models/PasswordToken.ts +7 -5
- package/src/models/PayconiqPayment.ts +6 -3
- package/src/models/Payment.ts +8 -5
- package/src/models/Registration.ts +9 -97
- package/src/models/STInvoice.ts +1 -4
- package/src/models/STPackage.ts +1 -1
- package/src/models/STPendingInvoice.ts +5 -4
- package/src/models/Ticket.ts +11 -9
- package/src/models/Token.test.ts +2 -2
- package/src/models/Token.ts +6 -6
- package/src/models/User.ts +7 -8
- package/src/models/UserPermissions.ts +7 -6
- package/src/models/Webshop.ts +5 -5
- package/src/models/_relations.ts +133 -0
- package/src/models/addresses/City.ts +1 -1
- package/src/models/addresses/PostalCode.test.ts +1 -1
- package/src/models/addresses/PostalCode.ts +1 -1
- package/src/models/addresses/Province.ts +1 -1
- package/src/models/index.ts +22 -20
- package/src/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -0
- package/dist/src/factories/AddressFactory.d.ts.map +0 -1
- package/dist/src/factories/AddressFactory.js +0 -42
- package/dist/src/factories/AddressFactory.js.map +0 -1
- package/dist/src/factories/BalanceItemFactory.d.ts +0 -28
- package/dist/src/factories/BalanceItemFactory.d.ts.map +0 -1
- package/dist/src/factories/BalanceItemFactory.js +0 -60
- package/dist/src/factories/BalanceItemFactory.js.map +0 -1
- package/dist/src/factories/DocumentTemplateFactory.d.ts +0 -21
- package/dist/src/factories/DocumentTemplateFactory.d.ts.map +0 -1
- package/dist/src/factories/DocumentTemplateFactory.js +0 -149
- package/dist/src/factories/DocumentTemplateFactory.js.map +0 -1
- package/dist/src/factories/EmailTemplateFactory.d.ts +0 -18
- package/dist/src/factories/EmailTemplateFactory.d.ts.map +0 -1
- package/dist/src/factories/EmailTemplateFactory.js +0 -43
- package/dist/src/factories/EmailTemplateFactory.js.map +0 -1
- package/dist/src/factories/EmergencyContactFactory.d.ts.map +0 -1
- package/dist/src/factories/EmergencyContactFactory.js +0 -42
- package/dist/src/factories/EmergencyContactFactory.js.map +0 -1
- package/dist/src/factories/EventFactory.d.ts +0 -19
- package/dist/src/factories/EventFactory.d.ts.map +0 -1
- package/dist/src/factories/EventFactory.js +0 -35
- package/dist/src/factories/EventFactory.js.map +0 -1
- package/dist/src/factories/EventNotificationFactory.d.ts +0 -21
- package/dist/src/factories/EventNotificationFactory.d.ts.map +0 -1
- package/dist/src/factories/EventNotificationFactory.js +0 -44
- package/dist/src/factories/EventNotificationFactory.js.map +0 -1
- package/dist/src/factories/EventNotificationTypeFactory.d.ts +0 -11
- package/dist/src/factories/EventNotificationTypeFactory.d.ts.map +0 -1
- package/dist/src/factories/EventNotificationTypeFactory.js +0 -25
- package/dist/src/factories/EventNotificationTypeFactory.js.map +0 -1
- package/dist/src/factories/GroupFactory.d.ts +0 -26
- package/dist/src/factories/GroupFactory.d.ts.map +0 -1
- package/dist/src/factories/GroupFactory.js +0 -92
- package/dist/src/factories/GroupFactory.js.map +0 -1
- package/dist/src/factories/MemberFactory.d.ts +0 -26
- package/dist/src/factories/MemberFactory.d.ts.map +0 -1
- package/dist/src/factories/MemberFactory.js +0 -135
- package/dist/src/factories/MemberFactory.js.map +0 -1
- package/dist/src/factories/MemberResponsibilityRecordFactory.d.ts +0 -14
- package/dist/src/factories/MemberResponsibilityRecordFactory.d.ts.map +0 -1
- package/dist/src/factories/MemberResponsibilityRecordFactory.js +0 -34
- package/dist/src/factories/MemberResponsibilityRecordFactory.js.map +0 -1
- package/dist/src/factories/OrganizationFactory.d.ts +0 -19
- package/dist/src/factories/OrganizationFactory.d.ts.map +0 -1
- package/dist/src/factories/OrganizationFactory.js +0 -64
- package/dist/src/factories/OrganizationFactory.js.map +0 -1
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.d.ts +0 -13
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.d.ts.map +0 -1
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.js +0 -20
- package/dist/src/factories/OrganizationRegistrationPeriodFactory.js.map +0 -1
- package/dist/src/factories/OrganizationTagFactory.d.ts.map +0 -1
- package/dist/src/factories/OrganizationTagFactory.js +0 -23
- package/dist/src/factories/OrganizationTagFactory.js.map +0 -1
- package/dist/src/factories/ParentFactory.d.ts.map +0 -1
- package/dist/src/factories/ParentFactory.js +0 -43
- package/dist/src/factories/ParentFactory.js.map +0 -1
- package/dist/src/factories/PlatformEventTypeFactory.d.ts.map +0 -1
- package/dist/src/factories/PlatformEventTypeFactory.js +0 -27
- package/dist/src/factories/PlatformEventTypeFactory.js.map +0 -1
- package/dist/src/factories/PlatformResponsibilityFactory.d.ts.map +0 -1
- package/dist/src/factories/PlatformResponsibilityFactory.js +0 -25
- package/dist/src/factories/PlatformResponsibilityFactory.js.map +0 -1
- package/dist/src/factories/RecordAnswerFactory.d.ts +0 -17
- package/dist/src/factories/RecordAnswerFactory.d.ts.map +0 -1
- package/dist/src/factories/RecordAnswerFactory.js +0 -95
- package/dist/src/factories/RecordAnswerFactory.js.map +0 -1
- package/dist/src/factories/RecordCategoryFactory.d.ts +0 -11
- package/dist/src/factories/RecordCategoryFactory.d.ts.map +0 -1
- package/dist/src/factories/RecordCategoryFactory.js +0 -23
- package/dist/src/factories/RecordCategoryFactory.js.map +0 -1
- package/dist/src/factories/RecordFactory.d.ts.map +0 -1
- package/dist/src/factories/RecordFactory.js +0 -21
- package/dist/src/factories/RecordFactory.js.map +0 -1
- package/dist/src/factories/RegisterCodeFactory.d.ts.map +0 -1
- package/dist/src/factories/RegisterCodeFactory.js +0 -18
- package/dist/src/factories/RegisterCodeFactory.js.map +0 -1
- package/dist/src/factories/RegistrationFactory.d.ts +0 -21
- package/dist/src/factories/RegistrationFactory.d.ts.map +0 -1
- package/dist/src/factories/RegistrationFactory.js +0 -25
- package/dist/src/factories/RegistrationFactory.js.map +0 -1
- package/dist/src/factories/RegistrationPeriodFactory.d.ts +0 -15
- package/dist/src/factories/RegistrationPeriodFactory.d.ts.map +0 -1
- package/dist/src/factories/RegistrationPeriodFactory.js +0 -34
- package/dist/src/factories/RegistrationPeriodFactory.js.map +0 -1
- package/dist/src/factories/STPackageFactory.d.ts +0 -15
- package/dist/src/factories/STPackageFactory.d.ts.map +0 -1
- package/dist/src/factories/STPackageFactory.js +0 -38
- package/dist/src/factories/STPackageFactory.js.map +0 -1
- package/dist/src/factories/UserFactory.d.ts +0 -22
- package/dist/src/factories/UserFactory.d.ts.map +0 -1
- package/dist/src/factories/UserFactory.js +0 -67
- package/dist/src/factories/UserFactory.js.map +0 -1
- package/dist/src/factories/WebshopFactory.d.ts +0 -16
- package/dist/src/factories/WebshopFactory.d.ts.map +0 -1
- package/dist/src/factories/WebshopFactory.js +0 -39
- package/dist/src/factories/WebshopFactory.js.map +0 -1
- package/dist/src/factories/index.d.ts.map +0 -1
- package/dist/src/factories/index.js +0 -30
- package/dist/src/factories/index.js.map +0 -1
- package/dist/src/helpers/DNSValidator.d.ts +0 -6
- package/dist/src/helpers/DNSValidator.d.ts.map +0 -1
- package/dist/src/helpers/DNSValidator.js +0 -145
- package/dist/src/helpers/DNSValidator.js.map +0 -1
- package/dist/src/helpers/EmailBuilder.d.ts +0 -83
- package/dist/src/helpers/EmailBuilder.d.ts.map +0 -1
- package/dist/src/helpers/EmailBuilder.js +0 -646
- package/dist/src/helpers/EmailBuilder.js.map +0 -1
- package/dist/src/helpers/Handlebars.d.ts.map +0 -1
- package/dist/src/helpers/Handlebars.js +0 -248
- package/dist/src/helpers/Handlebars.js.map +0 -1
- package/dist/src/helpers/MemberMerger.d.ts.map +0 -1
- package/dist/src/helpers/MemberMerger.js +0 -371
- package/dist/src/helpers/MemberMerger.js.map +0 -1
- package/dist/src/helpers/MemberMerger.test.d.ts +0 -2
- package/dist/src/helpers/MemberMerger.test.d.ts.map +0 -1
- package/dist/src/helpers/MemberMerger.test.js +0 -644
- package/dist/src/helpers/MemberMerger.test.js.map +0 -1
- package/dist/src/helpers/RateLimiter.d.ts.map +0 -1
- package/dist/src/helpers/RateLimiter.js +0 -69
- package/dist/src/helpers/RateLimiter.js.map +0 -1
- package/dist/src/helpers/WebshopCounter.d.ts +0 -8
- package/dist/src/helpers/WebshopCounter.d.ts.map +0 -1
- package/dist/src/helpers/WebshopCounter.js +0 -50
- package/dist/src/helpers/WebshopCounter.js.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -14
- package/dist/src/index.js.map +0 -1
- package/dist/src/migrations/1605262045-import-postcodes.js +0 -121
- package/dist/src/migrations/1605262046-import-postcodes-nl.js +0 -83
- package/dist/src/models/AuditLog.d.ts.map +0 -1
- package/dist/src/models/AuditLog.js +0 -98
- package/dist/src/models/AuditLog.js.map +0 -1
- package/dist/src/models/BalanceItem.d.ts +0 -217
- package/dist/src/models/BalanceItem.d.ts.map +0 -1
- package/dist/src/models/BalanceItem.js +0 -630
- package/dist/src/models/BalanceItem.js.map +0 -1
- package/dist/src/models/BalanceItemPayment.d.ts +0 -23
- package/dist/src/models/BalanceItemPayment.d.ts.map +0 -1
- package/dist/src/models/BalanceItemPayment.js +0 -70
- package/dist/src/models/BalanceItemPayment.js.map +0 -1
- package/dist/src/models/BuckarooPayment.d.ts.map +0 -1
- package/dist/src/models/BuckarooPayment.js +0 -28
- package/dist/src/models/BuckarooPayment.js.map +0 -1
- package/dist/src/models/CachedBalance.d.ts +0 -50
- package/dist/src/models/CachedBalance.d.ts.map +0 -1
- package/dist/src/models/CachedBalance.js +0 -394
- package/dist/src/models/CachedBalance.js.map +0 -1
- package/dist/src/models/Document.d.ts +0 -41
- package/dist/src/models/Document.d.ts.map +0 -1
- package/dist/src/models/Document.js +0 -255
- package/dist/src/models/Document.js.map +0 -1
- package/dist/src/models/DocumentTemplate.d.ts +0 -55
- package/dist/src/models/DocumentTemplate.d.ts.map +0 -1
- package/dist/src/models/DocumentTemplate.js +0 -723
- package/dist/src/models/DocumentTemplate.js.map +0 -1
- package/dist/src/models/DocumentTemplate.test.d.ts +0 -2
- package/dist/src/models/DocumentTemplate.test.d.ts.map +0 -1
- package/dist/src/models/DocumentTemplate.test.js +0 -57
- package/dist/src/models/DocumentTemplate.test.js.map +0 -1
- package/dist/src/models/Email.d.ts +0 -140
- package/dist/src/models/Email.d.ts.map +0 -1
- package/dist/src/models/Email.js +0 -1345
- package/dist/src/models/Email.js.map +0 -1
- package/dist/src/models/Email.test.d.ts +0 -2
- package/dist/src/models/Email.test.d.ts.map +0 -1
- package/dist/src/models/Email.test.js +0 -1036
- package/dist/src/models/Email.test.js.map +0 -1
- package/dist/src/models/EmailRecipient.d.ts.map +0 -1
- package/dist/src/models/EmailRecipient.js +0 -198
- package/dist/src/models/EmailRecipient.js.map +0 -1
- package/dist/src/models/EmailTemplate.d.ts +0 -23
- package/dist/src/models/EmailTemplate.d.ts.map +0 -1
- package/dist/src/models/EmailTemplate.js +0 -83
- package/dist/src/models/EmailTemplate.js.map +0 -1
- package/dist/src/models/EmailVerificationCode.d.ts +0 -59
- package/dist/src/models/EmailVerificationCode.d.ts.map +0 -1
- package/dist/src/models/EmailVerificationCode.js +0 -343
- package/dist/src/models/EmailVerificationCode.js.map +0 -1
- package/dist/src/models/Event.d.ts.map +0 -1
- package/dist/src/models/Event.js +0 -136
- package/dist/src/models/Event.js.map +0 -1
- package/dist/src/models/EventNotification.d.ts +0 -31
- package/dist/src/models/EventNotification.d.ts.map +0 -1
- package/dist/src/models/EventNotification.js +0 -102
- package/dist/src/models/EventNotification.js.map +0 -1
- package/dist/src/models/Group.d.ts +0 -45
- package/dist/src/models/Group.d.ts.map +0 -1
- package/dist/src/models/Group.js +0 -228
- package/dist/src/models/Group.js.map +0 -1
- package/dist/src/models/Image.d.ts +0 -16
- package/dist/src/models/Image.d.ts.map +0 -1
- package/dist/src/models/Image.js +0 -173
- package/dist/src/models/Image.js.map +0 -1
- package/dist/src/models/Invoice.d.ts.map +0 -1
- package/dist/src/models/Invoice.js +0 -190
- package/dist/src/models/Invoice.js.map +0 -1
- package/dist/src/models/InvoicedBalanceItem.d.ts +0 -66
- package/dist/src/models/InvoicedBalanceItem.d.ts.map +0 -1
- package/dist/src/models/InvoicedBalanceItem.js +0 -136
- package/dist/src/models/InvoicedBalanceItem.js.map +0 -1
- package/dist/src/models/Member.d.ts +0 -112
- package/dist/src/models/Member.d.ts.map +0 -1
- package/dist/src/models/Member.js +0 -415
- package/dist/src/models/Member.js.map +0 -1
- package/dist/src/models/MemberPlatformMembership.d.ts +0 -48
- package/dist/src/models/MemberPlatformMembership.d.ts.map +0 -1
- package/dist/src/models/MemberPlatformMembership.js +0 -381
- package/dist/src/models/MemberPlatformMembership.js.map +0 -1
- package/dist/src/models/MemberResponsibilityRecord.d.ts +0 -16
- package/dist/src/models/MemberResponsibilityRecord.d.ts.map +0 -1
- package/dist/src/models/MemberResponsibilityRecord.js +0 -69
- package/dist/src/models/MemberResponsibilityRecord.js.map +0 -1
- package/dist/src/models/MemberUser.d.ts.map +0 -1
- package/dist/src/models/MemberUser.js +0 -26
- package/dist/src/models/MemberUser.js.map +0 -1
- package/dist/src/models/MergedMember.d.ts +0 -23
- package/dist/src/models/MergedMember.d.ts.map +0 -1
- package/dist/src/models/MergedMember.js +0 -127
- package/dist/src/models/MergedMember.js.map +0 -1
- package/dist/src/models/MolliePayment.d.ts.map +0 -1
- package/dist/src/models/MolliePayment.js +0 -28
- package/dist/src/models/MolliePayment.js.map +0 -1
- package/dist/src/models/MollieToken.d.ts +0 -45
- package/dist/src/models/MollieToken.d.ts.map +0 -1
- package/dist/src/models/MollieToken.js +0 -334
- package/dist/src/models/MollieToken.js.map +0 -1
- package/dist/src/models/OneTimeToken.d.ts +0 -38
- package/dist/src/models/OneTimeToken.d.ts.map +0 -1
- package/dist/src/models/OneTimeToken.js +0 -129
- package/dist/src/models/OneTimeToken.js.map +0 -1
- package/dist/src/models/Order.d.ts +0 -112
- package/dist/src/models/Order.d.ts.map +0 -1
- package/dist/src/models/Order.js +0 -906
- package/dist/src/models/Order.js.map +0 -1
- package/dist/src/models/Organization.d.ts +0 -120
- package/dist/src/models/Organization.d.ts.map +0 -1
- package/dist/src/models/Organization.js +0 -828
- package/dist/src/models/Organization.js.map +0 -1
- package/dist/src/models/OrganizationRegistrationPeriod.d.ts +0 -22
- package/dist/src/models/OrganizationRegistrationPeriod.d.ts.map +0 -1
- package/dist/src/models/OrganizationRegistrationPeriod.js +0 -133
- package/dist/src/models/OrganizationRegistrationPeriod.js.map +0 -1
- package/dist/src/models/PasswordToken.d.ts +0 -30
- package/dist/src/models/PasswordToken.d.ts.map +0 -1
- package/dist/src/models/PasswordToken.js +0 -133
- package/dist/src/models/PasswordToken.js.map +0 -1
- package/dist/src/models/PayconiqPayment.d.ts +0 -22
- package/dist/src/models/PayconiqPayment.d.ts.map +0 -1
- package/dist/src/models/PayconiqPayment.js +0 -276
- package/dist/src/models/PayconiqPayment.js.map +0 -1
- package/dist/src/models/Payment.d.ts +0 -117
- package/dist/src/models/Payment.d.ts.map +0 -1
- package/dist/src/models/Payment.js +0 -293
- package/dist/src/models/Payment.js.map +0 -1
- package/dist/src/models/Platform.d.ts.map +0 -1
- package/dist/src/models/Platform.js +0 -182
- package/dist/src/models/Platform.js.map +0 -1
- package/dist/src/models/Platform.test.d.ts +0 -2
- package/dist/src/models/Platform.test.d.ts.map +0 -1
- package/dist/src/models/Platform.test.js +0 -90
- package/dist/src/models/Platform.test.js.map +0 -1
- package/dist/src/models/RegisterCode.d.ts.map +0 -1
- package/dist/src/models/RegisterCode.js +0 -80
- package/dist/src/models/RegisterCode.js.map +0 -1
- package/dist/src/models/Registration.d.ts +0 -93
- package/dist/src/models/Registration.d.ts.map +0 -1
- package/dist/src/models/Registration.js +0 -267
- package/dist/src/models/Registration.js.map +0 -1
- package/dist/src/models/RegistrationPeriod.d.ts.map +0 -1
- package/dist/src/models/RegistrationPeriod.js +0 -144
- package/dist/src/models/RegistrationPeriod.js.map +0 -1
- package/dist/src/models/STCredit.d.ts.map +0 -1
- package/dist/src/models/STCredit.js +0 -65
- package/dist/src/models/STCredit.js.map +0 -1
- package/dist/src/models/STInvoice.d.ts +0 -37
- package/dist/src/models/STInvoice.d.ts.map +0 -1
- package/dist/src/models/STInvoice.js +0 -145
- package/dist/src/models/STInvoice.js.map +0 -1
- package/dist/src/models/STPackage.d.ts.map +0 -1
- package/dist/src/models/STPackage.js +0 -280
- package/dist/src/models/STPackage.js.map +0 -1
- package/dist/src/models/STPendingInvoice.d.ts +0 -26
- package/dist/src/models/STPendingInvoice.d.ts.map +0 -1
- package/dist/src/models/STPendingInvoice.js +0 -73
- package/dist/src/models/STPendingInvoice.js.map +0 -1
- package/dist/src/models/StripeAccount.d.ts.map +0 -1
- package/dist/src/models/StripeAccount.js +0 -85
- package/dist/src/models/StripeAccount.js.map +0 -1
- package/dist/src/models/StripeCheckoutSession.d.ts.map +0 -1
- package/dist/src/models/StripeCheckoutSession.js +0 -39
- package/dist/src/models/StripeCheckoutSession.js.map +0 -1
- package/dist/src/models/StripePaymentIntent.d.ts.map +0 -1
- package/dist/src/models/StripePaymentIntent.js +0 -39
- package/dist/src/models/StripePaymentIntent.js.map +0 -1
- package/dist/src/models/Ticket.d.ts +0 -63
- package/dist/src/models/Ticket.d.ts.map +0 -1
- package/dist/src/models/Ticket.js +0 -162
- package/dist/src/models/Ticket.js.map +0 -1
- package/dist/src/models/Token.d.ts +0 -48
- package/dist/src/models/Token.d.ts.map +0 -1
- package/dist/src/models/Token.js +0 -212
- package/dist/src/models/Token.js.map +0 -1
- package/dist/src/models/Token.test.d.ts +0 -2
- package/dist/src/models/Token.test.d.ts.map +0 -1
- package/dist/src/models/Token.test.js +0 -60
- package/dist/src/models/Token.test.js.map +0 -1
- package/dist/src/models/UitpasClientCredential.d.ts.map +0 -1
- package/dist/src/models/UitpasClientCredential.js +0 -66
- package/dist/src/models/UitpasClientCredential.js.map +0 -1
- package/dist/src/models/UsedRegisterCode.d.ts.map +0 -1
- package/dist/src/models/UsedRegisterCode.js +0 -62
- package/dist/src/models/UsedRegisterCode.js.map +0 -1
- package/dist/src/models/User.d.ts +0 -77
- package/dist/src/models/User.d.ts.map +0 -1
- package/dist/src/models/User.js +0 -490
- package/dist/src/models/User.js.map +0 -1
- package/dist/src/models/UserPermissions.d.ts +0 -16
- package/dist/src/models/UserPermissions.d.ts.map +0 -1
- package/dist/src/models/UserPermissions.js +0 -61
- package/dist/src/models/UserPermissions.js.map +0 -1
- package/dist/src/models/Webshop.d.ts +0 -45
- package/dist/src/models/Webshop.d.ts.map +0 -1
- package/dist/src/models/Webshop.js +0 -192
- package/dist/src/models/Webshop.js.map +0 -1
- package/dist/src/models/WebshopDiscountCode.d.ts.map +0 -1
- package/dist/src/models/WebshopDiscountCode.js +0 -93
- package/dist/src/models/WebshopDiscountCode.js.map +0 -1
- package/dist/src/models/WebshopUitpasNumber.d.ts.map +0 -1
- package/dist/src/models/WebshopUitpasNumber.js +0 -95
- package/dist/src/models/WebshopUitpasNumber.js.map +0 -1
- package/dist/src/models/addresses/City.d.ts +0 -15
- package/dist/src/models/addresses/City.d.ts.map +0 -1
- package/dist/src/models/addresses/City.js +0 -39
- package/dist/src/models/addresses/City.js.map +0 -1
- package/dist/src/models/addresses/PostalCode.d.ts +0 -21
- package/dist/src/models/addresses/PostalCode.d.ts.map +0 -1
- package/dist/src/models/addresses/PostalCode.js +0 -143
- package/dist/src/models/addresses/PostalCode.js.map +0 -1
- package/dist/src/models/addresses/PostalCode.test.d.ts +0 -2
- package/dist/src/models/addresses/PostalCode.test.d.ts.map +0 -1
- package/dist/src/models/addresses/PostalCode.test.js +0 -98
- package/dist/src/models/addresses/PostalCode.test.js.map +0 -1
- package/dist/src/models/addresses/Province.d.ts +0 -9
- package/dist/src/models/addresses/Province.d.ts.map +0 -1
- package/dist/src/models/addresses/Province.js +0 -28
- package/dist/src/models/addresses/Province.js.map +0 -1
- package/dist/src/models/addresses/Street.d.ts.map +0 -1
- package/dist/src/models/addresses/Street.js +0 -30
- package/dist/src/models/addresses/Street.js.map +0 -1
- package/dist/src/models/index.d.ts +0 -54
- package/dist/src/models/index.d.ts.map +0 -1
- package/dist/src/models/index.js +0 -69
- package/dist/src/models/index.js.map +0 -1
- package/dist/src/structures/OrganizationServerMetaData.d.ts.map +0 -1
- package/dist/src/structures/OrganizationServerMetaData.js +0 -135
- package/dist/src/structures/OrganizationServerMetaData.js.map +0 -1
- package/dist/tests/jest.global.setup.d.ts +0 -3
- package/dist/tests/jest.global.setup.d.ts.map +0 -1
- package/dist/tests/jest.global.setup.js +0 -33
- package/dist/tests/jest.global.setup.js.map +0 -1
- package/dist/tests/jest.setup.d.ts +0 -2
- package/dist/tests/jest.setup.d.ts.map +0 -1
- package/dist/tests/jest.setup.js +0 -32
- package/dist/tests/jest.setup.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- /package/dist/{src/assets → assets}/Metropolis-Black.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-BlackItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-Bold.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-BoldItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-ExtraBold.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-ExtraBoldItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-ExtraLight.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-ExtraLightItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-Light.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-LightItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-Medium.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-MediumItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-Regular.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-RegularItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-SemiBold.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-SemiBoldItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-Thin.woff2 +0 -0
- /package/dist/{src/assets → assets}/Metropolis-ThinItalic.woff2 +0 -0
- /package/dist/{src/assets → assets}/logo.png +0 -0
- /package/dist/{src/factories → factories}/AddressFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/EmergencyContactFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/OrganizationTagFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/ParentFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/PlatformEventTypeFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/PlatformResponsibilityFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/RecordFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/RegisterCodeFactory.d.ts +0 -0
- /package/dist/{src/factories → factories}/index.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/Handlebars.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/MemberMerger.d.ts +0 -0
- /package/dist/{src/helpers → helpers}/RateLimiter.d.ts +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/migrations → migrations}/1593773929-create-initial-tables.sql +0 -0
- /package/dist/{src/migrations → migrations}/1605261999-gemeenten-tmp.sql +0 -0
- /package/dist/{src/migrations → migrations}/1605262045-import-postcodes.d.ts +0 -0
- /package/dist/{src/migrations → migrations}/1605262046-import-postcodes-nl.d.ts +0 -0
- /package/dist/{src/migrations → migrations}/1605279038-drop-gemeenten-tmp.sql +0 -0
- /package/dist/{src/migrations → migrations}/1708607340-tickets-deleted-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1710459176-register-code-invoices.sql +0 -0
- /package/dist/{src/migrations → migrations}/1712158247-discount-codes.sql +0 -0
- /package/dist/{src/migrations → migrations}/1713178665-drop-invites.sql +0 -0
- /package/dist/{src/migrations → migrations}/1713178666-drop-keychain.sql +0 -0
- /package/dist/{src/migrations → migrations}/1713178667-drop-challenges.sql +0 -0
- /package/dist/{src/migrations → migrations}/1713178668-drop-user-keys.sql +0 -0
- /package/dist/{src/migrations → migrations}/1713178669-drop-organization-key.sql +0 -0
- /package/dist/{src/migrations → migrations}/1714985451-user-nullable-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1714985452-email-verification-code-nullable-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1714985453-user-organization-permissions.sql +0 -0
- /package/dist/{src/migrations → migrations}/1714985454-user-organization-permissions.sql +0 -0
- /package/dist/{src/migrations → migrations}/1715079362-platform.sql +0 -0
- /package/dist/{src/migrations → migrations}/1715181649-registrations-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1715181650-registrations-organization-id-fill.sql +0 -0
- /package/dist/{src/migrations → migrations}/1715181651-registrations-organization-id-drop-null.sql +0 -0
- /package/dist/{src/migrations → migrations}/1716117067-members-nullable-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719567581-registration-periods.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719567582-organization-registration-periods.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719567881-organization-periodId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719567882-groups-periodId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719567883-platform-periodId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719568079-default-period.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719568080-set-default-period-platform.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719568081-set-default-period-organizations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719568082-set-default-period-groups.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719580828-registrations-periodId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719580829-set-default-period-registrations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1719931362-groups-default-age-group-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1720080975-convert-charset.sql +0 -0
- /package/dist/{src/migrations → migrations}/1720080976-responsibilities.sql +0 -0
- /package/dist/{src/migrations → migrations}/1720088136-member-membership-types.sql +0 -0
- /package/dist/{src/migrations → migrations}/1720088137-member-membership-types-expire-date.sql +0 -0
- /package/dist/{src/migrations → migrations}/1720444931-organization-active.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721050380-email-table.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721050381-email-recipients-table.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721342679-responsibility-groupId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721342680-responsibility-groupId-foreign-key.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721400546-users-memberId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721639159-membership-deleted-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721639160-membership-generated.sql +0 -0
- /package/dist/{src/migrations → migrations}/1721841819-group-type.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722090482-events.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722269236-group-waitinglist-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722525785-balance-item-paying-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722525787-depending-balance-item.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722845608-registration-stock-reservations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722845609-group-stock-reservations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722852362-stripe-intents-account-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722852363-stripe-checkout-sessions-account-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722959111-allow-multiple-registrations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1722963554-registration-group-price-and-options.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723202125-member-number.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723202126-member-number-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723218160-balance-item-unit-price.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723218161-balance-item-amount.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723218162-balance-item-type.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723218163-balance-item-type-defaults.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723218164-balance-item-relations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723652795-payments-paying-user-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723652796-payments-paying-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723652797-payments-paying-organization-id-fk.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723652798-payments-customer.sql +0 -0
- /package/dist/{src/migrations → migrations}/1723736282-merged-members.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724076162-setup-steps.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724156666-member-indexes.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724156667-organization-tag-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724256125-membership-balance-item-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724256126-membership-balance-item-fk.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724258844-membershipOrganizationId.sql +0 -0
- /package/dist/{src/migrations → migrations}/1724258845-membershipOrganizationId-fk.sql +0 -0
- /package/dist/{src/migrations → migrations}/1726054851-balance-item-price-pending.sql +0 -0
- /package/dist/{src/migrations → migrations}/1726054852-cached-outstanding-balances.sql +0 -0
- /package/dist/{src/migrations → migrations}/1726668114-maximum-free-amount.sql +0 -0
- /package/dist/{src/migrations → migrations}/1726668115-free-amount.sql +0 -0
- /package/dist/{src/migrations → migrations}/1726668116-price-without-discount.sql +0 -0
- /package/dist/{src/migrations → migrations}/1727947041-registration-record-answers.sql +0 -0
- /package/dist/{src/migrations → migrations}/1729251385-order-extra-filter-columns.sql +0 -0
- /package/dist/{src/migrations → migrations}/1732285080-audit-logs.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733129611-clear-audit-logs.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733129612-audit-logs-source.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733317908-added-missing-organization-fk-on-registrations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733317909-paying-organization-id-registrations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733317910-paying-organization-id-fk.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733410641-audit-log-external-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733418667-desc-audit-log-primary-key.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733909398-balance-items-due-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733909399-recalculate-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1733994454-balance-item-price-open.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734084689-payment-type.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734084690-move-payment-column-order.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734084691-fill-payment-type-refunds.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734084692-fill-payment-type-reallocations.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734429094-registration-trial-until.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734429095-membership-trial-until.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734535120-registration-period-previous-period-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734535121-platform-previous-period-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734626607-cached-balance-amount-open.sql +0 -0
- /package/dist/{src/migrations → migrations}/1734698906-cached-balance-amount-paid.sql +0 -0
- /package/dist/{src/migrations → migrations}/1735573520-emails-email-type.sql +0 -0
- /package/dist/{src/migrations → migrations}/1735573521-email-recipients-email-type.sql +0 -0
- /package/dist/{src/migrations → migrations}/1735573522-emails-indexes.sql +0 -0
- /package/dist/{src/migrations → migrations}/1735982691-cached-balance-email-reminder-counts.sql +0 -0
- /package/dist/{src/migrations → migrations}/1736850097-audit-logs-meta.sql +0 -0
- /package/dist/{src/migrations → migrations}/1736947931-platform-server-config.sql +0 -0
- /package/dist/{src/migrations → migrations}/1738922428-membership-locked.sql +0 -0
- /package/dist/{src/migrations → migrations}/1739017508-event-notifications.sql +0 -0
- /package/dist/{src/migrations → migrations}/1739017509-event-notifications-link.sql +0 -0
- /package/dist/{src/migrations → migrations}/1739282590-event-notifications-submitted-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1741954610-event-notifications-accepted-record-answers.sql +0 -0
- /package/dist/{src/migrations → migrations}/1742579832-audit-log-longer-object-size.sql +0 -0
- /package/dist/{src/migrations → migrations}/1747913433-registration-discounts.sql +0 -0
- /package/dist/{src/migrations → migrations}/1747996262-balance-items-paid-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1747996263-balance-items-paid-at-fill.sql +0 -0
- /package/dist/{src/migrations → migrations}/1751633220-create-uitpas-client-credentials.sql +0 -0
- /package/dist/{src/migrations → migrations}/1751970372-create-webshop-uitpas-numbers.sql +0 -0
- /package/dist/{src/migrations → migrations}/1752655335-events-webshop-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1752678047-confirmation-email.sql +0 -0
- /package/dist/{src/migrations → migrations}/1753363434-service-fees.sql +0 -0
- /package/dist/{src/migrations → migrations}/1753430415-update-webshop-uitpasnumbers.sql +0 -0
- /package/dist/{src/migrations → migrations}/1755529026-email-sender-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1755789797-email-counts-errors.sql +0 -0
- /package/dist/{src/migrations → migrations}/1755789798-email-recipient-errors.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756115313-email-recipient-ids-and-errors.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756115314-email-recipient-email-optional.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756115315-email-recipients-count.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756115316-email-cached-counts.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756115317-email-deleted-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756293494-registration-period-next-period-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756293495-platform-next-period-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756387016-registration-period-custom-name.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756391212-email-recipients-duplicate.sql +0 -0
- /package/dist/{src/migrations → migrations}/1756821154-email-send-as-email.sql +0 -0
- /package/dist/{src/migrations → migrations}/1758034021-email-recipient-previous-error.sql +0 -0
- /package/dist/{src/migrations → migrations}/1760535508-update-cached-balances-object-id-unique-constraint.sql +0 -0
- /package/dist/{src/migrations → migrations}/1761750780-renamed-invoice-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1761750781-rename-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1761750782-invoices-add-organization-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1761750783-invoices-organization-id-fk.sql +0 -0
- /package/dist/{src/migrations → migrations}/1762521336-did-send-peppol.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216321-multiply-balance-item-payments.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216322-multiply-balance-items.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216323-bigint-cached-balances.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216324-multiply-cached-balances.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216325-multiply-member-platform-memberships.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216326-multiply-payments.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216327-multiply-register-codes.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216328-multiply-credits.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216329-multiply-orders.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216330-multiply-uitpas-numbers.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216331-balance-item-vat-percentages.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216332-balance-item-price-total.sql +0 -0
- /package/dist/{src/migrations → migrations}/1763216333-balance-item-price-total-fill.sql +0 -0
- /package/dist/{src/migrations → migrations}/1765895470-document-year.sql +0 -0
- /package/dist/{src/migrations → migrations}/1766150401-document-published-at.sql +0 -0
- /package/dist/{src/migrations → migrations}/1766410598-registration-end-date.sql +0 -0
- /package/dist/{src/migrations → migrations}/1769087807-invoices-table.sql +0 -0
- /package/dist/{src/migrations → migrations}/1769087808-invoiced-balance-items-table.sql +0 -0
- /package/dist/{src/migrations → migrations}/1769087809-payments-invoice-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1769621227-payments-rounding-amount.sql +0 -0
- /package/dist/{src/migrations → migrations}/1770917406-create-cached-balances-global-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1770917407-create-member-name-ordering-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1770917408-create-member-name-ordering-index-desc.sql +0 -0
- /package/dist/{src/migrations → migrations}/1770917409-create-member-age-ordering-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1770917410-create-member-age-ordering-index-desc.sql +0 -0
- /package/dist/{src/migrations → migrations}/1770917411-drop-duplicate-member-indexes.sql +0 -0
- /package/dist/{src/migrations → migrations}/1771510518-events-index-organization-id-start-date.sql +0 -0
- /package/dist/{src/migrations → migrations}/1771918307-membership-active-filter-index.sql +0 -0
- /package/dist/{src/migrations → migrations}/1772033555-balance-item-package-id.sql +0 -0
- /package/dist/{src/migrations → migrations}/1772033715-balance-item-start-end-date.sql +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Drenthe +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Flevoland +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Friesland +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Gelderland +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Groningen +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Limburg +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Noord-Brabant +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Noord-Holland +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Overrijsel +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Utrecht +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Zeeland +0 -0
- /package/dist/{src/migrations → migrations}/data/postcodes/nl/Zuid-Holland +0 -0
- /package/dist/{src/models → models}/AuditLog.d.ts +0 -0
- /package/dist/{src/models → models}/BuckarooPayment.d.ts +0 -0
- /package/dist/{src/models → models}/EmailRecipient.d.ts +0 -0
- /package/dist/{src/models → models}/Event.d.ts +0 -0
- /package/dist/{src/models → models}/Invoice.d.ts +0 -0
- /package/dist/{src/models → models}/MemberUser.d.ts +0 -0
- /package/dist/{src/models → models}/MolliePayment.d.ts +0 -0
- /package/dist/{src/models → models}/Platform.d.ts +0 -0
- /package/dist/{src/models → models}/RegisterCode.d.ts +0 -0
- /package/dist/{src/models → models}/RegistrationPeriod.d.ts +0 -0
- /package/dist/{src/models → models}/STCredit.d.ts +0 -0
- /package/dist/{src/models → models}/STPackage.d.ts +0 -0
- /package/dist/{src/models → models}/StripeAccount.d.ts +0 -0
- /package/dist/{src/models → models}/StripeCheckoutSession.d.ts +0 -0
- /package/dist/{src/models → models}/StripePaymentIntent.d.ts +0 -0
- /package/dist/{src/models → models}/UitpasClientCredential.d.ts +0 -0
- /package/dist/{src/models → models}/UsedRegisterCode.d.ts +0 -0
- /package/dist/{src/models → models}/WebshopDiscountCode.d.ts +0 -0
- /package/dist/{src/models → models}/WebshopUitpasNumber.d.ts +0 -0
- /package/dist/{src/models → models}/addresses/Street.d.ts +0 -0
- /package/dist/{src/structures → structures}/OrganizationServerMetaData.d.ts +0 -0
|
@@ -1,828 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Organization = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const simple_database_1 = require("@simonbackx/simple-database");
|
|
6
|
-
const simple_errors_1 = require("@simonbackx/simple-errors");
|
|
7
|
-
const backend_i18n_1 = require("@stamhoofd/backend-i18n");
|
|
8
|
-
const sql_1 = require("@stamhoofd/sql");
|
|
9
|
-
const structures_1 = require("@stamhoofd/structures");
|
|
10
|
-
const client_sesv2_1 = require("@aws-sdk/client-sesv2");
|
|
11
|
-
const uuid_1 = require("uuid");
|
|
12
|
-
const queues_1 = require("@stamhoofd/queues");
|
|
13
|
-
const utility_1 = require("@stamhoofd/utility");
|
|
14
|
-
const DNSValidator_js_1 = require("../helpers/DNSValidator.js");
|
|
15
|
-
const EmailBuilder_js_1 = require("../helpers/EmailBuilder.js");
|
|
16
|
-
const OrganizationServerMetaData_js_1 = require("../structures/OrganizationServerMetaData.js");
|
|
17
|
-
const index_js_1 = require("./index.js");
|
|
18
|
-
class Organization extends sql_1.QueryableModel {
|
|
19
|
-
static table = 'organizations';
|
|
20
|
-
// static cache = new ModelCache<Organization>();
|
|
21
|
-
id;
|
|
22
|
-
name;
|
|
23
|
-
/// URL to a website page or a Facebook page (including http)
|
|
24
|
-
website = null;
|
|
25
|
-
/// A custom domain name that is used to host the register application (should be unique)
|
|
26
|
-
// E.g. inschrijven.scoutswetteren.be
|
|
27
|
-
registerDomain = null;
|
|
28
|
-
// Unique representation of this organization from a string, that is used to provide the default domains
|
|
29
|
-
// in uri.stamhoofd.be
|
|
30
|
-
uri;
|
|
31
|
-
periodId;
|
|
32
|
-
/**
|
|
33
|
-
* Public meta data
|
|
34
|
-
*/
|
|
35
|
-
meta = structures_1.OrganizationMetaData.create({});
|
|
36
|
-
/**
|
|
37
|
-
* Data only accessible by the owners / users with special permissions
|
|
38
|
-
*/
|
|
39
|
-
privateMeta = structures_1.OrganizationPrivateMetaData.create({});
|
|
40
|
-
/**
|
|
41
|
-
* Data only accessible by the server
|
|
42
|
-
*/
|
|
43
|
-
serverMeta = OrganizationServerMetaData_js_1.OrganizationServerMetaData.create({});
|
|
44
|
-
address;
|
|
45
|
-
searchIndex;
|
|
46
|
-
createdAt;
|
|
47
|
-
updatedAt;
|
|
48
|
-
active = true;
|
|
49
|
-
/**
|
|
50
|
-
* Return default locale confiruation
|
|
51
|
-
*/
|
|
52
|
-
get i18n() {
|
|
53
|
-
return new backend_i18n_1.I18n(structures_1.Language.Dutch, this.address.country);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Makes sure empty name is replaced with organization name
|
|
57
|
-
*/
|
|
58
|
-
get mappedTransferSettings() {
|
|
59
|
-
return this.meta.transferSettings.fillMissing(structures_1.TransferSettings.create({ creditor: this.name }));
|
|
60
|
-
}
|
|
61
|
-
// Methods
|
|
62
|
-
static async getByURI(uri) {
|
|
63
|
-
const [rows] = await simple_database_1.Database.select(`SELECT ${this.getDefaultSelect()} FROM ${this.table} WHERE \`uri\` = ? LIMIT 1`, [uri]);
|
|
64
|
-
if (rows.length == 0) {
|
|
65
|
-
return undefined;
|
|
66
|
-
}
|
|
67
|
-
// Read member + address from first row
|
|
68
|
-
return this.fromRow(rows[0][this.table]);
|
|
69
|
-
}
|
|
70
|
-
// Methods
|
|
71
|
-
static async getByEmail(email) {
|
|
72
|
-
if (email.startsWith('noreply-')) {
|
|
73
|
-
// Trim
|
|
74
|
-
email = email.substring('noreply-'.length);
|
|
75
|
-
}
|
|
76
|
-
for (const domain of [
|
|
77
|
-
...Object.values(STAMHOOFD.domains.defaultBroadcastEmail ?? {}),
|
|
78
|
-
...Object.values(STAMHOOFD.domains.defaultTransactionalEmail ?? {}),
|
|
79
|
-
]) {
|
|
80
|
-
if (email.endsWith('@' + domain)) {
|
|
81
|
-
const uri = email.substring(0, email.length - ('@' + domain).length);
|
|
82
|
-
return await Organization.getByURI(uri);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
const at = email.indexOf('@');
|
|
86
|
-
const domain = email.substring(at + 1);
|
|
87
|
-
const [rows] = await simple_database_1.Database.select(`SELECT ${this.getDefaultSelect()} FROM ${this.table} WHERE privateMeta->"$.value.mailDomain" = ? LIMIT 1`, [domain]);
|
|
88
|
-
if (rows.length == 0) {
|
|
89
|
-
return undefined;
|
|
90
|
-
}
|
|
91
|
-
// Read member + address from first row
|
|
92
|
-
return this.fromRow(rows[0][this.table]);
|
|
93
|
-
}
|
|
94
|
-
// Methods
|
|
95
|
-
static async getByRegisterDomain(host) {
|
|
96
|
-
const [rows] = await simple_database_1.Database.select(`SELECT ${this.getDefaultSelect()} FROM ${this.table} WHERE \`registerDomain\` = ? LIMIT 1`, [host]);
|
|
97
|
-
if (rows.length == 0) {
|
|
98
|
-
return undefined;
|
|
99
|
-
}
|
|
100
|
-
// Read member + address from first row
|
|
101
|
-
return this.fromRow(rows[0][this.table]);
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Get an Organization by looking at the host of a request
|
|
105
|
-
* Format is 2331c59a-0cbe-4279-871c-ea9d0474cd54.api.stamhoofd.app
|
|
106
|
-
*/
|
|
107
|
-
static async fromApiHost(host, options) {
|
|
108
|
-
if (!host.endsWith('.' + STAMHOOFD.domains.api)) {
|
|
109
|
-
throw new simple_errors_1.SimpleError({
|
|
110
|
-
code: 'invalid_host',
|
|
111
|
-
message: 'Please specify the organization in the hostname',
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
const id = host.substring(0, host.length - STAMHOOFD.domains.api.length - 1);
|
|
115
|
-
const organization = await this.getByID(id);
|
|
116
|
-
if (!organization) {
|
|
117
|
-
throw new simple_errors_1.SimpleError({
|
|
118
|
-
code: 'invalid_organization',
|
|
119
|
-
message: 'No organization known for host ' + host,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
if (!organization.active && !options?.allowInactive) {
|
|
123
|
-
throw new simple_errors_1.SimpleError({
|
|
124
|
-
code: 'archived',
|
|
125
|
-
message: 'This organization is archived',
|
|
126
|
-
human: $t(`%x4`),
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
return organization;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Potentially includes a path
|
|
133
|
-
*/
|
|
134
|
-
getRegistrationHost(i18n) {
|
|
135
|
-
if (this.registerDomain) {
|
|
136
|
-
let d = this.registerDomain;
|
|
137
|
-
if (i18n && i18n.language !== this.i18n.language) {
|
|
138
|
-
d += '/' + i18n.language;
|
|
139
|
-
}
|
|
140
|
-
return d;
|
|
141
|
-
}
|
|
142
|
-
return this.getDefaultRegistrationHost(i18n);
|
|
143
|
-
}
|
|
144
|
-
getDefaultRegistrationHost(i18n) {
|
|
145
|
-
if (!STAMHOOFD.domains.registration) {
|
|
146
|
-
return STAMHOOFD.domains.dashboard + '/' + (i18n?.locale ?? this.i18n.locale) + '/' + (0, structures_1.appToUri)('registration') + '/' + this.uri;
|
|
147
|
-
}
|
|
148
|
-
let defaultDomain = STAMHOOFD.domains.registration[this.address.country] ?? STAMHOOFD.domains.registration[''];
|
|
149
|
-
if (i18n && i18n.language !== this.i18n.language) {
|
|
150
|
-
defaultDomain += '/' + i18n.language;
|
|
151
|
-
}
|
|
152
|
-
return this.uri + '.' + defaultDomain;
|
|
153
|
-
}
|
|
154
|
-
get registerUrl() {
|
|
155
|
-
return 'https://' + this.getRegistrationHost();
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* @deprecated
|
|
159
|
-
* use getRegistrationHost
|
|
160
|
-
*/
|
|
161
|
-
getHost(i18n) {
|
|
162
|
-
return this.getRegistrationHost(i18n);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* @deprecated
|
|
166
|
-
* Use getDefaultRegistrationHost
|
|
167
|
-
*/
|
|
168
|
-
getDefaultHost(i18n) {
|
|
169
|
-
return this.getDefaultRegistrationHost(i18n);
|
|
170
|
-
}
|
|
171
|
-
get marketingDomain() {
|
|
172
|
-
return STAMHOOFD.domains.marketing[this.address.country] ?? STAMHOOFD.domains.marketing[''];
|
|
173
|
-
}
|
|
174
|
-
getApiHost() {
|
|
175
|
-
const defaultDomain = STAMHOOFD.domains.api;
|
|
176
|
-
if (!defaultDomain) {
|
|
177
|
-
throw new Error('Missing hostname in environment');
|
|
178
|
-
}
|
|
179
|
-
return this.id + '.' + defaultDomain;
|
|
180
|
-
}
|
|
181
|
-
_cachedPeriod;
|
|
182
|
-
async getPeriod() {
|
|
183
|
-
if (this._cachedPeriod) {
|
|
184
|
-
return this._cachedPeriod;
|
|
185
|
-
}
|
|
186
|
-
const oPeriods = await index_js_1.OrganizationRegistrationPeriod.where({ periodId: this.periodId, organizationId: this.id }, { limit: 1 });
|
|
187
|
-
let oPeriod;
|
|
188
|
-
if (oPeriods.length == 0) {
|
|
189
|
-
// Automatically create a period
|
|
190
|
-
oPeriod = await queues_1.QueueHandler.schedule('create-missing-organization-period', async () => {
|
|
191
|
-
// Race condition check
|
|
192
|
-
const updatedPeriods = await index_js_1.OrganizationRegistrationPeriod.where({ periodId: this.periodId, organizationId: this.id }, { limit: 1 });
|
|
193
|
-
if (updatedPeriods.length) {
|
|
194
|
-
return updatedPeriods[0];
|
|
195
|
-
}
|
|
196
|
-
console.log('Automatically creating new organization registration period for organization ' + this.id + ' and period ' + this.periodId + ' - organization period is missing');
|
|
197
|
-
const created = new index_js_1.OrganizationRegistrationPeriod();
|
|
198
|
-
created.organizationId = this.id;
|
|
199
|
-
created.periodId = this.periodId;
|
|
200
|
-
await created.save();
|
|
201
|
-
return created;
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
oPeriod = oPeriods[0];
|
|
206
|
-
}
|
|
207
|
-
this._cachedPeriod = oPeriod;
|
|
208
|
-
return oPeriod;
|
|
209
|
-
}
|
|
210
|
-
getBaseStructure() {
|
|
211
|
-
return structures_1.Organization.create({
|
|
212
|
-
id: this.id,
|
|
213
|
-
active: this.active,
|
|
214
|
-
name: this.name,
|
|
215
|
-
meta: this.meta,
|
|
216
|
-
address: this.address,
|
|
217
|
-
registerDomain: this.registerDomain,
|
|
218
|
-
uri: this.uri,
|
|
219
|
-
website: this.website,
|
|
220
|
-
createdAt: this.createdAt,
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
getBaseStructureWithPrivateMeta() {
|
|
224
|
-
return structures_1.Organization.create({
|
|
225
|
-
id: this.id,
|
|
226
|
-
active: this.active,
|
|
227
|
-
name: this.name,
|
|
228
|
-
meta: this.meta,
|
|
229
|
-
privateMeta: this.privateMeta,
|
|
230
|
-
address: this.address,
|
|
231
|
-
registerDomain: this.registerDomain,
|
|
232
|
-
uri: this.uri,
|
|
233
|
-
website: this.website,
|
|
234
|
-
createdAt: this.createdAt,
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
async updateDNSRecords() {
|
|
238
|
-
const organization = this;
|
|
239
|
-
// Check initial status
|
|
240
|
-
let isValidRecords = true;
|
|
241
|
-
for (const record of organization.privateMeta.dnsRecords) {
|
|
242
|
-
if (record.status !== structures_1.DNSRecordStatus.Valid) {
|
|
243
|
-
isValidRecords = false;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
const { allValid } = await (0, DNSValidator_js_1.validateDNSRecords)(organization.privateMeta.dnsRecords);
|
|
247
|
-
if (organization.registerDomain ?? organization.privateMeta.pendingRegisterDomain) {
|
|
248
|
-
const registerDomainRecord = (organization.privateMeta.pendingRegisterDomain ?? organization.registerDomain) + '.';
|
|
249
|
-
const records = organization.privateMeta.dnsRecords.filter(r => r.name === registerDomainRecord);
|
|
250
|
-
const areRegisterDomainRecordsValid = records.length === 0 || records.every(r => r.status === structures_1.DNSRecordStatus.Valid);
|
|
251
|
-
if (areRegisterDomainRecordsValid) {
|
|
252
|
-
// We can setup the register domain if needed
|
|
253
|
-
if (organization.privateMeta.pendingRegisterDomain !== null) {
|
|
254
|
-
organization.registerDomain = organization.privateMeta.pendingRegisterDomain;
|
|
255
|
-
organization.privateMeta.pendingRegisterDomain = null;
|
|
256
|
-
console.log('Did set register domain for ' + this.id + ' to ' + organization.registerDomain);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
260
|
-
// Clear register domain
|
|
261
|
-
if (organization.registerDomain) {
|
|
262
|
-
// We need to clear it, to prevent sending e-mails with invalid links
|
|
263
|
-
organization.privateMeta.pendingRegisterDomain = organization.privateMeta.pendingRegisterDomain ?? organization.registerDomain;
|
|
264
|
-
organization.registerDomain = null;
|
|
265
|
-
console.log('Cleared register domain for ' + this.id + ' because of invalid non txt records');
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
if (allValid) {
|
|
270
|
-
if (organization.privateMeta.pendingMailDomain !== null) {
|
|
271
|
-
organization.privateMeta.mailDomain = organization.privateMeta.pendingMailDomain;
|
|
272
|
-
organization.privateMeta.pendingMailDomain = null;
|
|
273
|
-
}
|
|
274
|
-
const wasUnstable = organization.serverMeta.isDNSUnstable;
|
|
275
|
-
organization.serverMeta.markDNSValid();
|
|
276
|
-
const didSendDomainSetupMail = organization.serverMeta.didSendDomainSetupMail;
|
|
277
|
-
const didSendWarning = organization.serverMeta.DNSRecordWarningCount > 0;
|
|
278
|
-
organization.serverMeta.DNSRecordWarningCount = 0;
|
|
279
|
-
const wasActive = this.privateMeta.mailDomainActive;
|
|
280
|
-
await this.updateAWSMailIdenitity();
|
|
281
|
-
// yay! Do not Save until after doing AWS changes
|
|
282
|
-
await organization.save();
|
|
283
|
-
if (wasUnstable && !organization.serverMeta.isDNSUnstable) {
|
|
284
|
-
console.warn('DNS settings became stable for ' + this.name + ' ' + this.id);
|
|
285
|
-
await this.sendEmailTemplate({
|
|
286
|
-
type: structures_1.EmailTemplateType.OrganizationStableDNS,
|
|
287
|
-
bcc: true,
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
else if (!wasActive && this.privateMeta.mailDomainActive && (!didSendDomainSetupMail || didSendWarning) && !organization.serverMeta.isDNSUnstable) {
|
|
291
|
-
organization.serverMeta.didSendDomainSetupMail = true;
|
|
292
|
-
await organization.save();
|
|
293
|
-
if (!didSendDomainSetupMail) {
|
|
294
|
-
await this.sendEmailTemplate({
|
|
295
|
-
type: structures_1.EmailTemplateType.OrganizationDNSSetupComplete,
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
await this.sendEmailTemplate({
|
|
300
|
-
type: structures_1.EmailTemplateType.OrganizationValidDNS,
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
else {
|
|
306
|
-
// DNS settings gone broken
|
|
307
|
-
if (organization.privateMeta.mailDomain) {
|
|
308
|
-
organization.privateMeta.pendingMailDomain = organization.privateMeta.pendingMailDomain ?? organization.privateMeta.mailDomain;
|
|
309
|
-
organization.privateMeta.mailDomain = null;
|
|
310
|
-
}
|
|
311
|
-
const wasDNSUnstable = organization.serverMeta.isDNSUnstable;
|
|
312
|
-
organization.serverMeta.markDNSFailure();
|
|
313
|
-
// disable AWS emails
|
|
314
|
-
this.privateMeta.mailDomainActive = false;
|
|
315
|
-
// save
|
|
316
|
-
await organization.save();
|
|
317
|
-
if (!wasDNSUnstable && organization.serverMeta.isDNSUnstable) {
|
|
318
|
-
// DNS became instable
|
|
319
|
-
console.warn('DNS settings became instable for ' + this.name + ' ' + this.id);
|
|
320
|
-
await this.sendEmailTemplate({
|
|
321
|
-
type: structures_1.EmailTemplateType.OrganizationUnstableDNS,
|
|
322
|
-
bcc: true,
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
else if (!organization.serverMeta.isDNSUnstable && organization.serverMeta.didSendDomainSetupMail && organization.serverMeta.DNSRecordWarningCount == 0) {
|
|
326
|
-
organization.serverMeta.DNSRecordWarningCount += 1;
|
|
327
|
-
await organization.save();
|
|
328
|
-
await this.sendEmailTemplate({
|
|
329
|
-
type: structures_1.EmailTemplateType.OrganizationInvalidDNS,
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
async sendEmailTemplate(data) {
|
|
335
|
-
const recipients = await this.getAdminRecipients();
|
|
336
|
-
const defaultI18n = new backend_i18n_1.I18n(structures_1.Language.Dutch, structures_1.Country.Belgium);
|
|
337
|
-
const i18n = this.i18n;
|
|
338
|
-
const replaceAll = [
|
|
339
|
-
{
|
|
340
|
-
from: defaultI18n.localizedDomains.marketing(),
|
|
341
|
-
to: i18n.localizedDomains.marketing(),
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
from: defaultI18n.$t('%2a'),
|
|
345
|
-
to: i18n.$t('%2a'),
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
from: defaultI18n.$t('%19'),
|
|
349
|
-
to: i18n.$t('%19'),
|
|
350
|
-
},
|
|
351
|
-
];
|
|
352
|
-
// Create e-mail builder
|
|
353
|
-
await (0, EmailBuilder_js_1.sendEmailTemplate)(null, {
|
|
354
|
-
replaceAll,
|
|
355
|
-
recipients,
|
|
356
|
-
template: {
|
|
357
|
-
type: data.type,
|
|
358
|
-
},
|
|
359
|
-
singleBcc: data.bcc ? { email: 'simon@stamhoofd.be' } : undefined,
|
|
360
|
-
type: 'transactional',
|
|
361
|
-
defaultReplacements: [
|
|
362
|
-
structures_1.Replacement.create({
|
|
363
|
-
token: 'mailDomain',
|
|
364
|
-
value: this.privateMeta.mailDomain ?? this.privateMeta.pendingMailDomain ?? '',
|
|
365
|
-
}),
|
|
366
|
-
],
|
|
367
|
-
unsubscribeType: 'marketing',
|
|
368
|
-
fromStamhoofd: true,
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
static get forbiddenEmailDomains() {
|
|
372
|
-
return [
|
|
373
|
-
STAMHOOFD.domains.dashboard,
|
|
374
|
-
...Object.values(STAMHOOFD.domains.defaultBroadcastEmail ?? {}),
|
|
375
|
-
...Object.values(STAMHOOFD.domains.defaultTransactionalEmail ?? {}),
|
|
376
|
-
];
|
|
377
|
-
}
|
|
378
|
-
async deleteAWSMailIdenitity(mailDomain) {
|
|
379
|
-
// Protect specific domain names
|
|
380
|
-
if (Organization.forbiddenEmailDomains.includes(mailDomain.toLowerCase())) {
|
|
381
|
-
return;
|
|
382
|
-
}
|
|
383
|
-
if (STAMHOOFD.environment !== 'production') {
|
|
384
|
-
// Temporary ignore this
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
const client = new client_sesv2_1.SESv2Client({});
|
|
388
|
-
// Check if mail identitiy already exists..
|
|
389
|
-
try {
|
|
390
|
-
const cmd = new client_sesv2_1.GetEmailIdentityCommand({
|
|
391
|
-
EmailIdentity: mailDomain,
|
|
392
|
-
});
|
|
393
|
-
const result = await client.send(cmd);
|
|
394
|
-
if (result.VerifiedForSendingStatus === true) {
|
|
395
|
-
console.log('Cant delete AWS mail idenitiy @' + this.id + ' for ' + mailDomain + ': already validated and might be in use by other organizations');
|
|
396
|
-
return;
|
|
397
|
-
}
|
|
398
|
-
console.log('Deleting AWS mail identity @' + this.id + ' for ' + mailDomain);
|
|
399
|
-
const deleteCmd = new client_sesv2_1.DeleteEmailIdentityCommand({
|
|
400
|
-
EmailIdentity: mailDomain,
|
|
401
|
-
});
|
|
402
|
-
await client.send(deleteCmd);
|
|
403
|
-
console.log('Deleted AWS mail idenitiy @' + this.id + ' for ' + this.privateMeta.mailDomain);
|
|
404
|
-
}
|
|
405
|
-
catch (e) {
|
|
406
|
-
console.error('Could not delete AWS email identitiy @' + this.id + ' for ' + this.privateMeta.mailDomain);
|
|
407
|
-
console.error(e);
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* Create or update the AWS mail idenitiy and also update the active state of the mailDomain
|
|
412
|
-
*/
|
|
413
|
-
async updateAWSMailIdenitity() {
|
|
414
|
-
if (this.privateMeta.mailDomain === null) {
|
|
415
|
-
return;
|
|
416
|
-
}
|
|
417
|
-
// Protect specific domain names
|
|
418
|
-
if (['stamhoofd.be', 'stamhoofd.nl', 'stamhoofd.shop', 'stamhoofd.app', 'stamhoofd.email'].includes(this.privateMeta.mailDomain)) {
|
|
419
|
-
console.error('Tried to validate AWS mail identity with protected domains @' + this.id);
|
|
420
|
-
this.privateMeta.mailDomainActive = false;
|
|
421
|
-
return;
|
|
422
|
-
}
|
|
423
|
-
if (STAMHOOFD.environment !== 'production') {
|
|
424
|
-
// Temporary ignore this
|
|
425
|
-
this.privateMeta.mailDomainActive = true;
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
const client = new client_sesv2_1.SESv2Client({});
|
|
429
|
-
const expectedConfigurationSetName = utility_1.Formatter.slug(STAMHOOFD.platformName + '-domains');
|
|
430
|
-
// Check if mail identitiy already exists..
|
|
431
|
-
let exists = false;
|
|
432
|
-
let existing = undefined;
|
|
433
|
-
try {
|
|
434
|
-
const cmd = new client_sesv2_1.GetEmailIdentityCommand({
|
|
435
|
-
EmailIdentity: this.privateMeta.mailDomain,
|
|
436
|
-
});
|
|
437
|
-
existing = await client.send(cmd);
|
|
438
|
-
exists = true;
|
|
439
|
-
console.log('AWS mail idenitiy exists already: just checking the verification status in AWS @' + this.id);
|
|
440
|
-
if (existing.ConfigurationSetName !== expectedConfigurationSetName) {
|
|
441
|
-
// Not allowed to use this identity
|
|
442
|
-
this.privateMeta.mailDomainActive = false;
|
|
443
|
-
console.error('Organization is not allowed to use email identity ' + this.privateMeta.mailDomain + ' @' + this.id + ', got ' + existing.ConfigurationSetName);
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
446
|
-
this.privateMeta.mailDomainActive = existing.VerifiedForSendingStatus ?? false;
|
|
447
|
-
if (existing.VerifiedForSendingStatus !== true) {
|
|
448
|
-
console.error('Not validated @' + this.id);
|
|
449
|
-
}
|
|
450
|
-
if (existing.VerifiedForSendingStatus !== true && existing.DkimAttributes?.Status === 'FAILED') {
|
|
451
|
-
console.error('AWS failed to verify DKIM records. Triggering a forced recheck @' + this.id);
|
|
452
|
-
const deleteCmd = new client_sesv2_1.DeleteEmailIdentityCommand({
|
|
453
|
-
EmailIdentity: this.privateMeta.mailDomain,
|
|
454
|
-
});
|
|
455
|
-
await client.send(deleteCmd);
|
|
456
|
-
// Recreate it immediately
|
|
457
|
-
exists = false;
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
catch (e) {
|
|
461
|
-
console.error(e);
|
|
462
|
-
}
|
|
463
|
-
if (!exists) {
|
|
464
|
-
console.log('Creating email identity in AWS SES...');
|
|
465
|
-
const cmd = new client_sesv2_1.CreateEmailIdentityCommand({
|
|
466
|
-
EmailIdentity: this.privateMeta.mailDomain,
|
|
467
|
-
ConfigurationSetName: expectedConfigurationSetName,
|
|
468
|
-
DkimSigningAttributes: {
|
|
469
|
-
DomainSigningPrivateKey: this.serverMeta.privateDKIMKey,
|
|
470
|
-
DomainSigningSelector: utility_1.Formatter.slug(STAMHOOFD.platformName),
|
|
471
|
-
},
|
|
472
|
-
Tags: [
|
|
473
|
-
{
|
|
474
|
-
Key: 'OrganizationId',
|
|
475
|
-
Value: this.id,
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
Key: 'Environment',
|
|
479
|
-
Value: STAMHOOFD.environment ?? 'Unknown',
|
|
480
|
-
},
|
|
481
|
-
],
|
|
482
|
-
});
|
|
483
|
-
const result = await client.send(cmd);
|
|
484
|
-
this.privateMeta.mailDomainActive = result.VerifiedForSendingStatus ?? false;
|
|
485
|
-
// Disable email forwarding of bounces and complaints
|
|
486
|
-
// We handle this now with the configuration set
|
|
487
|
-
const putFeedbackCmd = new client_sesv2_1.PutEmailIdentityFeedbackAttributesCommand({
|
|
488
|
-
EmailIdentity: this.privateMeta.mailDomain,
|
|
489
|
-
EmailForwardingEnabled: false,
|
|
490
|
-
});
|
|
491
|
-
await client.send(putFeedbackCmd);
|
|
492
|
-
}
|
|
493
|
-
if (this.privateMeta.mailFromDomain && (!exists || (existing && (!existing.MailFromAttributes || existing.MailFromAttributes.MailFromDomain !== this.privateMeta.mailFromDomain)))) {
|
|
494
|
-
// Also set a from domain, to fix SPF
|
|
495
|
-
console.log('Setting mail from domain: ' + this.privateMeta.mailFromDomain + ' for ' + this.id);
|
|
496
|
-
const cmd = new client_sesv2_1.PutEmailIdentityMailFromAttributesCommand({
|
|
497
|
-
EmailIdentity: this.privateMeta.mailDomain,
|
|
498
|
-
BehaviorOnMxFailure: 'USE_DEFAULT_VALUE',
|
|
499
|
-
MailFromDomain: this.privateMeta.mailFromDomain,
|
|
500
|
-
});
|
|
501
|
-
await client.send(cmd);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
async checkDrips() {
|
|
505
|
-
const days7 = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
|
|
506
|
-
// Welcome drip
|
|
507
|
-
// Created maximum 7 days ago
|
|
508
|
-
if (this.createdAt > days7 && !this.serverMeta.hasEmail(structures_1.EmailTemplateType.OrganizationDripWelcome)) {
|
|
509
|
-
await this.sendEmailTemplate({
|
|
510
|
-
type: structures_1.EmailTemplateType.OrganizationDripWelcome,
|
|
511
|
-
personal: true,
|
|
512
|
-
});
|
|
513
|
-
this.serverMeta.addEmail(structures_1.EmailTemplateType.OrganizationDripWelcome);
|
|
514
|
-
await this.save();
|
|
515
|
-
return; // Never send more than 1 drip email on the same day
|
|
516
|
-
}
|
|
517
|
-
// Webshop trial checkin
|
|
518
|
-
if (!this.serverMeta.hasEmail(structures_1.EmailTemplateType.OrganizationDripWebshopTrialCheckin)) {
|
|
519
|
-
if (this.meta.packages.isWebshopsTrial) {
|
|
520
|
-
const activeTime = this.meta.packages.getActiveTime(structures_1.STPackageType.TrialWebshops);
|
|
521
|
-
if (activeTime !== null && activeTime > 4 * 24 * 60 * 60 * 1000) {
|
|
522
|
-
// 7 days checkin
|
|
523
|
-
await this.sendEmailTemplate({
|
|
524
|
-
type: structures_1.EmailTemplateType.OrganizationDripWebshopTrialCheckin,
|
|
525
|
-
personal: true,
|
|
526
|
-
});
|
|
527
|
-
this.serverMeta.addEmail(structures_1.EmailTemplateType.OrganizationDripWebshopTrialCheckin);
|
|
528
|
-
this.serverMeta.addEmail(structures_1.EmailTemplateType.OrganizationDripMembersTrialCheckin); // also mark members checkin
|
|
529
|
-
await this.save();
|
|
530
|
-
return; // Never send more than 1 drip email on the same day
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
// Members trial checkin
|
|
535
|
-
if (!this.serverMeta.hasEmail(structures_1.EmailTemplateType.OrganizationDripMembersTrialCheckin)) {
|
|
536
|
-
if (this.meta.packages.isMembersTrial) {
|
|
537
|
-
const activeTime = this.meta.packages.getActiveTime(structures_1.STPackageType.TrialMembers);
|
|
538
|
-
if (activeTime !== null && activeTime > 4 * 24 * 60 * 60 * 1000) {
|
|
539
|
-
// 7 days checkin
|
|
540
|
-
await this.sendEmailTemplate({
|
|
541
|
-
type: structures_1.EmailTemplateType.OrganizationDripMembersTrialCheckin,
|
|
542
|
-
personal: true,
|
|
543
|
-
});
|
|
544
|
-
this.serverMeta.addEmail(structures_1.EmailTemplateType.OrganizationDripMembersTrialCheckin);
|
|
545
|
-
this.serverMeta.addEmail(structures_1.EmailTemplateType.OrganizationDripWebshopTrialCheckin); // Also mark webshop trial checkin
|
|
546
|
-
await this.save();
|
|
547
|
-
return; // Never send more than 1 drip email on the same day
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
// Webshop trial expired after 1 week
|
|
552
|
-
if (!this.serverMeta.hasEmail(structures_1.EmailTemplateType.OrganizationDripWebshopTrialExpired)) {
|
|
553
|
-
if (!this.meta.packages.useWebshops) {
|
|
554
|
-
const deactivatedTime = this.meta.packages.getDeactivatedTime(structures_1.STPackageType.TrialWebshops);
|
|
555
|
-
if (deactivatedTime !== null && deactivatedTime < 14 * 24 * 60 * 60 * 1000 && deactivatedTime > 7 * 24 * 60 * 60 * 1000) {
|
|
556
|
-
await this.sendEmailTemplate({
|
|
557
|
-
type: structures_1.EmailTemplateType.OrganizationDripWebshopTrialExpired,
|
|
558
|
-
personal: true,
|
|
559
|
-
});
|
|
560
|
-
this.serverMeta.addEmail(structures_1.EmailTemplateType.OrganizationDripWebshopTrialExpired);
|
|
561
|
-
this.serverMeta.addEmail(structures_1.EmailTemplateType.OrganizationDripMembersTrialExpired); // also mark members
|
|
562
|
-
await this.save();
|
|
563
|
-
return; // Never send more than 1 drip email on the same day
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
if (!this.serverMeta.hasEmail(structures_1.EmailTemplateType.OrganizationDripMembersTrialExpired)) {
|
|
568
|
-
if (!this.meta.packages.useMembers) {
|
|
569
|
-
const deactivatedTime = this.meta.packages.getDeactivatedTime(structures_1.STPackageType.TrialMembers);
|
|
570
|
-
if (deactivatedTime !== null && deactivatedTime < 14 * 24 * 60 * 60 * 1000 && deactivatedTime > 7 * 24 * 60 * 60 * 1000) {
|
|
571
|
-
await this.sendEmailTemplate({
|
|
572
|
-
type: structures_1.EmailTemplateType.OrganizationDripMembersTrialExpired,
|
|
573
|
-
personal: true,
|
|
574
|
-
});
|
|
575
|
-
this.serverMeta.addEmail(structures_1.EmailTemplateType.OrganizationDripMembersTrialExpired);
|
|
576
|
-
this.serverMeta.addEmail(structures_1.EmailTemplateType.OrganizationDripWebshopTrialExpired); // also mark webshops
|
|
577
|
-
await this.save();
|
|
578
|
-
return; // Never send more than 1 drip email on the same day
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
// trial expired reminder (after 10 months)
|
|
583
|
-
if (!this.serverMeta.hasEmail(structures_1.EmailTemplateType.OrganizationDripTrialExpiredReminder)) {
|
|
584
|
-
if (!this.meta.packages.isPaid && !this.meta.packages.wasPaid) {
|
|
585
|
-
const deactivatedTime1 = this.meta.packages.getDeactivatedTime(structures_1.STPackageType.TrialWebshops);
|
|
586
|
-
const deactivatedTime2 = this.meta.packages.getDeactivatedTime(structures_1.STPackageType.TrialMembers);
|
|
587
|
-
const deactivatedTime = deactivatedTime1 && deactivatedTime2 ? Math.max(deactivatedTime1, deactivatedTime2) : (deactivatedTime1 ? deactivatedTime1 : deactivatedTime2);
|
|
588
|
-
if (deactivatedTime !== null && deactivatedTime > 10 * 30 * 24 * 60 * 60 * 1000 && deactivatedTime < 13 * 31 * 24 * 60 * 60 * 1000) {
|
|
589
|
-
await this.sendEmailTemplate({
|
|
590
|
-
type: structures_1.EmailTemplateType.OrganizationDripTrialExpiredReminder,
|
|
591
|
-
personal: true,
|
|
592
|
-
bcc: true,
|
|
593
|
-
});
|
|
594
|
-
this.serverMeta.addEmail(structures_1.EmailTemplateType.OrganizationDripTrialExpiredReminder);
|
|
595
|
-
await this.save();
|
|
596
|
-
return; // Never send more than 1 drip email on the same day
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
if (!this.serverMeta.hasEmail(structures_1.EmailTemplateType.OrganizationDripWebshopNotRenewed)) {
|
|
601
|
-
if (!this.meta.packages.useWebshops) {
|
|
602
|
-
const deactivatedTime = this.meta.packages.getDeactivatedTime(structures_1.STPackageType.Webshops);
|
|
603
|
-
if (deactivatedTime !== null && deactivatedTime > 30 * 24 * 60 * 60 * 1000 && deactivatedTime < 30 * 3 * 24 * 60 * 60 * 1000) {
|
|
604
|
-
await this.sendEmailTemplate({
|
|
605
|
-
type: structures_1.EmailTemplateType.OrganizationDripWebshopNotRenewed,
|
|
606
|
-
personal: true,
|
|
607
|
-
bcc: true,
|
|
608
|
-
});
|
|
609
|
-
this.serverMeta.addEmail(structures_1.EmailTemplateType.OrganizationDripWebshopNotRenewed);
|
|
610
|
-
await this.save();
|
|
611
|
-
return; // Never send more than 1 drip email on the same day
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
if (!this.serverMeta.hasEmail(structures_1.EmailTemplateType.OrganizationDripMembersNotRenewed)) {
|
|
616
|
-
if (!this.meta.packages.useMembers) {
|
|
617
|
-
const deactivatedTime = this.meta.packages.getDeactivatedTime(structures_1.STPackageType.Members);
|
|
618
|
-
if (deactivatedTime !== null && deactivatedTime > 30 * 24 * 60 * 60 * 1000 && deactivatedTime < 30 * 3 * 24 * 60 * 60 * 1000) {
|
|
619
|
-
await this.sendEmailTemplate({
|
|
620
|
-
type: structures_1.EmailTemplateType.OrganizationDripMembersNotRenewed,
|
|
621
|
-
personal: true,
|
|
622
|
-
bcc: true,
|
|
623
|
-
});
|
|
624
|
-
this.serverMeta.addEmail(structures_1.EmailTemplateType.OrganizationDripMembersNotRenewed);
|
|
625
|
-
await this.save();
|
|
626
|
-
return; // Never send more than 1 drip email on the same day
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
/**
|
|
632
|
-
* E-mail address when we receive replies for organization@stamhoofd.email.
|
|
633
|
-
* Note that this sould be private because it can contain personal e-mail addresses if the organization is not configured correctly
|
|
634
|
-
*/
|
|
635
|
-
async getReplyEmails() {
|
|
636
|
-
const sender = this.privateMeta.emails.find(e => e.default) ?? this.privateMeta.emails[0];
|
|
637
|
-
if (sender) {
|
|
638
|
-
return [
|
|
639
|
-
{
|
|
640
|
-
name: sender.name,
|
|
641
|
-
email: sender.email,
|
|
642
|
-
},
|
|
643
|
-
];
|
|
644
|
-
}
|
|
645
|
-
return await this.getAdminToEmails();
|
|
646
|
-
}
|
|
647
|
-
async getAdmins() {
|
|
648
|
-
// Circular reference fix
|
|
649
|
-
const User = (await Promise.resolve().then(() => tslib_1.__importStar(require('./User.js')))).User;
|
|
650
|
-
return await User.getAdmins(this.id, { verified: true });
|
|
651
|
-
}
|
|
652
|
-
/**
|
|
653
|
-
* These email addresess are private
|
|
654
|
-
*/
|
|
655
|
-
async getFullAdmins() {
|
|
656
|
-
const admins = await this.getAdmins();
|
|
657
|
-
// Only full access
|
|
658
|
-
return admins.filter(a => a.permissions && a.permissions.forOrganization(this)?.hasFullAccess());
|
|
659
|
-
}
|
|
660
|
-
/**
|
|
661
|
-
* These email addresess are private
|
|
662
|
-
*/
|
|
663
|
-
async getAdminToEmails() {
|
|
664
|
-
const filtered = await this.getFullAdmins();
|
|
665
|
-
if (STAMHOOFD.environment === 'production') {
|
|
666
|
-
if (filtered.length > 1) {
|
|
667
|
-
// remove stamhoofd email addresses
|
|
668
|
-
const f = filtered.flatMap(f => f.getEmailTo()).filter(e => !e.email.endsWith('@stamhoofd.be') && !e.email.endsWith('@stamhoofd.nl'));
|
|
669
|
-
if (f.length > 0) {
|
|
670
|
-
return f;
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
return filtered.flatMap(f => f.getEmailTo());
|
|
675
|
-
}
|
|
676
|
-
/**
|
|
677
|
-
* These email addresess are private
|
|
678
|
-
*/
|
|
679
|
-
async getAdminRecipients() {
|
|
680
|
-
let filtered = await this.getFullAdmins();
|
|
681
|
-
if (STAMHOOFD.environment === 'production') {
|
|
682
|
-
if (filtered.length > 1) {
|
|
683
|
-
// remove stamhoofd email addresses
|
|
684
|
-
filtered = filtered.filter(e => !e.email.endsWith('@stamhoofd.be') && !e.email.endsWith('@stamhoofd.nl'));
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
return filtered.flatMap((f) => {
|
|
688
|
-
return structures_1.Recipient.create({
|
|
689
|
-
firstName: f.firstName,
|
|
690
|
-
lastName: f.lastName,
|
|
691
|
-
email: f.email,
|
|
692
|
-
replacements: [
|
|
693
|
-
structures_1.Replacement.create({
|
|
694
|
-
token: 'organizationName',
|
|
695
|
-
value: this.name,
|
|
696
|
-
}),
|
|
697
|
-
],
|
|
698
|
-
});
|
|
699
|
-
});
|
|
700
|
-
}
|
|
701
|
-
/**
|
|
702
|
-
* Return default e-mail address if no email addresses are set.
|
|
703
|
-
*/
|
|
704
|
-
getDefaultFrom(i18n, type = 'broadcast') {
|
|
705
|
-
const domain = type === 'transactional' ? i18n.localizedDomains.defaultTransactionalEmail() : i18n.localizedDomains.defaultBroadcastEmail();
|
|
706
|
-
return {
|
|
707
|
-
name: this.name,
|
|
708
|
-
email: ('noreply-' + this.uri + '@' + domain),
|
|
709
|
-
};
|
|
710
|
-
}
|
|
711
|
-
async getPaymentProviderFor(method, config) {
|
|
712
|
-
let stripeAccount = (config.stripeAccountId ? (await index_js_1.StripeAccount.getByID(config.stripeAccountId)) : null) ?? null;
|
|
713
|
-
if (stripeAccount && stripeAccount.organizationId !== this.id) {
|
|
714
|
-
console.warn('Stripe account ' + stripeAccount.id + ' is not linked to organization ' + this.id);
|
|
715
|
-
stripeAccount = null;
|
|
716
|
-
}
|
|
717
|
-
const provider = this.privateMeta.getPaymentProviderFor(method, stripeAccount?.meta);
|
|
718
|
-
if (provider === null && ![structures_1.PaymentMethod.Unknown, structures_1.PaymentMethod.Transfer, structures_1.PaymentMethod.PointOfSale].includes(method)) {
|
|
719
|
-
if (!stripeAccount && config.stripeAccountId) {
|
|
720
|
-
console.warn('Missing stripe account id ' + config.stripeAccountId);
|
|
721
|
-
}
|
|
722
|
-
throw new simple_errors_1.SimpleError({
|
|
723
|
-
code: 'payment_provider_not_configured',
|
|
724
|
-
message: 'Payment provider not configured for ' + method,
|
|
725
|
-
human: $t(`%x5`),
|
|
726
|
-
});
|
|
727
|
-
}
|
|
728
|
-
if (provider !== structures_1.PaymentProvider.Stripe && stripeAccount) {
|
|
729
|
-
stripeAccount = null;
|
|
730
|
-
}
|
|
731
|
-
return {
|
|
732
|
-
provider,
|
|
733
|
-
stripeAccount,
|
|
734
|
-
};
|
|
735
|
-
}
|
|
736
|
-
async getConnectedPaymentProviders() {
|
|
737
|
-
const allPaymentMethods = Object.values(structures_1.PaymentMethod);
|
|
738
|
-
const providers = [];
|
|
739
|
-
let stripeAccounts = await index_js_1.StripeAccount.where({ organizationId: this.id, status: 'active' });
|
|
740
|
-
if (stripeAccounts.length === 0) {
|
|
741
|
-
stripeAccounts = [null];
|
|
742
|
-
}
|
|
743
|
-
for (const account of stripeAccounts) {
|
|
744
|
-
for (const method of allPaymentMethods) {
|
|
745
|
-
const provider = this.privateMeta.getPaymentProviderFor(method, account?.meta);
|
|
746
|
-
if (provider && !providers.includes(provider)) {
|
|
747
|
-
providers.push(provider);
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
return providers;
|
|
752
|
-
}
|
|
753
|
-
async delete() {
|
|
754
|
-
// Clear periodID first to remove circular dependency
|
|
755
|
-
if (this.periodId) {
|
|
756
|
-
await Organization.update().where('id', this.id).set('periodId', null).update();
|
|
757
|
-
}
|
|
758
|
-
return await super.delete();
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
exports.Organization = Organization;
|
|
762
|
-
tslib_1.__decorate([
|
|
763
|
-
(0, simple_database_1.column)({
|
|
764
|
-
primary: true, type: 'string', beforeSave(value) {
|
|
765
|
-
return value ?? (0, uuid_1.v4)();
|
|
766
|
-
},
|
|
767
|
-
})
|
|
768
|
-
], Organization.prototype, "id", void 0);
|
|
769
|
-
tslib_1.__decorate([
|
|
770
|
-
(0, simple_database_1.column)({ type: 'string' })
|
|
771
|
-
], Organization.prototype, "name", void 0);
|
|
772
|
-
tslib_1.__decorate([
|
|
773
|
-
(0, simple_database_1.column)({ type: 'string', nullable: true })
|
|
774
|
-
], Organization.prototype, "website", void 0);
|
|
775
|
-
tslib_1.__decorate([
|
|
776
|
-
(0, simple_database_1.column)({ type: 'string', nullable: true })
|
|
777
|
-
], Organization.prototype, "registerDomain", void 0);
|
|
778
|
-
tslib_1.__decorate([
|
|
779
|
-
(0, simple_database_1.column)({ type: 'string' })
|
|
780
|
-
], Organization.prototype, "uri", void 0);
|
|
781
|
-
tslib_1.__decorate([
|
|
782
|
-
(0, simple_database_1.column)({ type: 'string' })
|
|
783
|
-
], Organization.prototype, "periodId", void 0);
|
|
784
|
-
tslib_1.__decorate([
|
|
785
|
-
(0, simple_database_1.column)({ type: 'json', decoder: structures_1.OrganizationMetaData })
|
|
786
|
-
], Organization.prototype, "meta", void 0);
|
|
787
|
-
tslib_1.__decorate([
|
|
788
|
-
(0, simple_database_1.column)({ type: 'json', decoder: structures_1.OrganizationPrivateMetaData })
|
|
789
|
-
], Organization.prototype, "privateMeta", void 0);
|
|
790
|
-
tslib_1.__decorate([
|
|
791
|
-
(0, simple_database_1.column)({ type: 'json', decoder: OrganizationServerMetaData_js_1.OrganizationServerMetaData })
|
|
792
|
-
], Organization.prototype, "serverMeta", void 0);
|
|
793
|
-
tslib_1.__decorate([
|
|
794
|
-
(0, simple_database_1.column)({ type: 'json', decoder: structures_1.Address })
|
|
795
|
-
], Organization.prototype, "address", void 0);
|
|
796
|
-
tslib_1.__decorate([
|
|
797
|
-
(0, simple_database_1.column)({
|
|
798
|
-
type: 'string', beforeSave: function () {
|
|
799
|
-
return this.name + '\n' + this.address.toString();
|
|
800
|
-
},
|
|
801
|
-
})
|
|
802
|
-
], Organization.prototype, "searchIndex", void 0);
|
|
803
|
-
tslib_1.__decorate([
|
|
804
|
-
(0, simple_database_1.column)({
|
|
805
|
-
type: 'datetime', beforeSave(old) {
|
|
806
|
-
if (old !== undefined) {
|
|
807
|
-
return old;
|
|
808
|
-
}
|
|
809
|
-
const date = new Date();
|
|
810
|
-
date.setMilliseconds(0);
|
|
811
|
-
return date;
|
|
812
|
-
},
|
|
813
|
-
})
|
|
814
|
-
], Organization.prototype, "createdAt", void 0);
|
|
815
|
-
tslib_1.__decorate([
|
|
816
|
-
(0, simple_database_1.column)({
|
|
817
|
-
type: 'datetime', beforeSave() {
|
|
818
|
-
const date = new Date();
|
|
819
|
-
date.setMilliseconds(0);
|
|
820
|
-
return date;
|
|
821
|
-
},
|
|
822
|
-
skipUpdate: true,
|
|
823
|
-
})
|
|
824
|
-
], Organization.prototype, "updatedAt", void 0);
|
|
825
|
-
tslib_1.__decorate([
|
|
826
|
-
(0, simple_database_1.column)({ type: 'boolean' })
|
|
827
|
-
], Organization.prototype, "active", void 0);
|
|
828
|
-
//# sourceMappingURL=Organization.js.map
|