@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
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { column } from '@simonbackx/simple-database';
|
|
3
|
+
import { SimpleError } from '@simonbackx/simple-errors';
|
|
4
|
+
import { QueryableModel } from '@stamhoofd/sql';
|
|
5
|
+
import { EmailTemplateType, Recipient, Replacement } from '@stamhoofd/structures';
|
|
6
|
+
import basex from 'base-x';
|
|
7
|
+
import crypto from 'crypto';
|
|
8
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
|
+
import { sendEmailTemplate } from '../helpers/EmailBuilder.js';
|
|
10
|
+
import { Platform } from './Platform.js';
|
|
11
|
+
const ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
12
|
+
const bs58 = basex(ALPHABET);
|
|
13
|
+
async function randomBytes(size) {
|
|
14
|
+
return new Promise((resolve, reject) => {
|
|
15
|
+
crypto.randomBytes(size, (err, buf) => {
|
|
16
|
+
if (err) {
|
|
17
|
+
reject(err);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
resolve(buf);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
async function randomInt(max) {
|
|
25
|
+
return new Promise((resolve, reject) => {
|
|
26
|
+
crypto.randomInt(max, (err, n) => {
|
|
27
|
+
if (err) {
|
|
28
|
+
reject(err);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
resolve(n);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Holds the verificationCodes for a given email (not a user, since a user can switch email addresses and might avoid verification that way)
|
|
37
|
+
*/
|
|
38
|
+
export class EmailVerificationCode extends QueryableModel {
|
|
39
|
+
static table = 'email_verification_codes';
|
|
40
|
+
id;
|
|
41
|
+
organizationId = null;
|
|
42
|
+
userId;
|
|
43
|
+
/**
|
|
44
|
+
* The e-mail that will get verified. If on verification, the user e-mail differs from this one,
|
|
45
|
+
* we'll set the user email to this email address
|
|
46
|
+
*/
|
|
47
|
+
email;
|
|
48
|
+
/**
|
|
49
|
+
* This one is send to the sender. Allows for polling + extra length + sender authentication
|
|
50
|
+
*/
|
|
51
|
+
token = '';
|
|
52
|
+
code = '';
|
|
53
|
+
/**
|
|
54
|
+
* The amount of times this code has been generated for the same e-mail address
|
|
55
|
+
*/
|
|
56
|
+
generatedCount = 0;
|
|
57
|
+
/**
|
|
58
|
+
* The amount of times this unique code has been tried.
|
|
59
|
+
*/
|
|
60
|
+
tries = 0;
|
|
61
|
+
expiresAt;
|
|
62
|
+
/**
|
|
63
|
+
* createdAt behaves more like createdAt for verificationCode. Since every save is considered to have a new verificationCode
|
|
64
|
+
*/
|
|
65
|
+
createdAt;
|
|
66
|
+
static CODE_LENGTH = 6;
|
|
67
|
+
static MAX_TRIES = 9; // minus 0..MAX_TRIES_VARY
|
|
68
|
+
async generateCode() {
|
|
69
|
+
this.code = ((await randomInt(Math.pow(10, EmailVerificationCode.CODE_LENGTH))) + '').padStart(EmailVerificationCode.CODE_LENGTH, '0');
|
|
70
|
+
this.token = bs58.encode(await randomBytes(100)).toLowerCase();
|
|
71
|
+
// Increase generatedCount if we changed the code
|
|
72
|
+
if (this.tries > 0) {
|
|
73
|
+
// For statistics (how many did they try and had to resend the email)
|
|
74
|
+
this.generatedCount++;
|
|
75
|
+
}
|
|
76
|
+
// Reset the real tries
|
|
77
|
+
this.tries = 0;
|
|
78
|
+
// Expire in 12 hours
|
|
79
|
+
this.expiresAt = new Date(new Date().getTime() + 1000 * 60 * 60 * 12);
|
|
80
|
+
}
|
|
81
|
+
getEmailVerificationUrl(user, organization, i18n) {
|
|
82
|
+
let host;
|
|
83
|
+
if (user.permissions || !organization || STAMHOOFD.userMode === 'platform') {
|
|
84
|
+
host = 'https://' + (STAMHOOFD.domains.dashboard ?? 'stamhoofd.app') + '/' + i18n.locale;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
// Add language if different than default
|
|
88
|
+
host = 'https://' + organization.getHost();
|
|
89
|
+
if (i18n.language !== organization.i18n.language) {
|
|
90
|
+
host += '/' + i18n.language;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return host + '/verify-email' + (user.organizationPermissions && this.organizationId ? '/' + encodeURIComponent(this.organizationId) : '') + '?code=' + encodeURIComponent(this.code) + '&token=' + encodeURIComponent(this.token);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Return true if this token is still valid (used for automatic polling in code view)
|
|
97
|
+
*/
|
|
98
|
+
static async poll(organizationId, token) {
|
|
99
|
+
const verificationCodes = await this.where({
|
|
100
|
+
token,
|
|
101
|
+
organizationId: {
|
|
102
|
+
sign: 'IN',
|
|
103
|
+
value: [organizationId, null],
|
|
104
|
+
},
|
|
105
|
+
}, { limit: 1 });
|
|
106
|
+
if (verificationCodes.length == 0) {
|
|
107
|
+
return false; // = expired or invalid
|
|
108
|
+
}
|
|
109
|
+
const verificationCode = verificationCodes[0];
|
|
110
|
+
if (verificationCode.token !== token) {
|
|
111
|
+
// Safety check, is not possible
|
|
112
|
+
console.error('Security check failed for verify: check MySQL optimization');
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
if (verificationCode.expiresAt < new Date()) {
|
|
116
|
+
// Expired.
|
|
117
|
+
// Can't expose this because that would expose a user enumeration attack
|
|
118
|
+
// -> we'll include this expiry date in e-mails
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
if (verificationCode.tries >= EmailVerificationCode.MAX_TRIES) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* We don't throw errors here, because we don't want to expose any information about the existance of the code.
|
|
128
|
+
* We just expose if it is valid or not, nothing else
|
|
129
|
+
* False = expired or invalid
|
|
130
|
+
* Error => token okay, but too many attempts checking the code
|
|
131
|
+
*
|
|
132
|
+
*/
|
|
133
|
+
static async verify(organizationId, token, code) {
|
|
134
|
+
if (code.length !== EmailVerificationCode.CODE_LENGTH) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const verificationCodes = await this.where({
|
|
138
|
+
token,
|
|
139
|
+
organizationId: {
|
|
140
|
+
sign: 'IN',
|
|
141
|
+
value: [organizationId, null],
|
|
142
|
+
},
|
|
143
|
+
}, { limit: 1 });
|
|
144
|
+
if (verificationCodes.length == 0) {
|
|
145
|
+
return; // = expired or invalid
|
|
146
|
+
}
|
|
147
|
+
const verificationCode = verificationCodes[0];
|
|
148
|
+
if (verificationCode.token !== token) {
|
|
149
|
+
// Safety check, is not possible
|
|
150
|
+
console.error('Security check failed for verify: check MySQL optimization');
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (verificationCode.expiresAt < new Date()) {
|
|
154
|
+
// Expired.
|
|
155
|
+
// Can't expose this because that would expose a user enumeration attack
|
|
156
|
+
// -> we'll include this expiry date in e-mails
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (verificationCode.tries >= EmailVerificationCode.MAX_TRIES) {
|
|
160
|
+
// We can saferly inform the user, because he is authenticated with the token
|
|
161
|
+
throw new SimpleError({
|
|
162
|
+
code: 'too_many_attempts',
|
|
163
|
+
message: 'Too many attempts',
|
|
164
|
+
human: $t(`%GL`),
|
|
165
|
+
statusCode: 429,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
if (verificationCode.code === code || (code === '111111' && (STAMHOOFD.environment === 'development' || STAMHOOFD.environment === 'test'))) {
|
|
169
|
+
// Delete all remaining information!
|
|
170
|
+
// To avoid leaving information about the existince of this user (tries)
|
|
171
|
+
await verificationCode.delete();
|
|
172
|
+
return verificationCode;
|
|
173
|
+
}
|
|
174
|
+
verificationCode.tries++;
|
|
175
|
+
await verificationCode.save();
|
|
176
|
+
if (verificationCode.tries >= EmailVerificationCode.MAX_TRIES) {
|
|
177
|
+
// We can saferly inform the user, because he is authenticated with the token
|
|
178
|
+
throw new SimpleError({
|
|
179
|
+
code: 'too_many_attempts',
|
|
180
|
+
message: 'Too many attempts',
|
|
181
|
+
human: $t(`%GL`),
|
|
182
|
+
statusCode: 429,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
async send(user, organization, i18n, withCode = true) {
|
|
187
|
+
const url = this.getEmailVerificationUrl(user, organization, i18n);
|
|
188
|
+
const name = organization?.name ?? (await Platform.getSharedPrivateStruct()).config.name;
|
|
189
|
+
const replacements = [
|
|
190
|
+
Replacement.create({
|
|
191
|
+
token: 'organizationName',
|
|
192
|
+
value: name,
|
|
193
|
+
}),
|
|
194
|
+
Replacement.create({
|
|
195
|
+
token: 'confirmEmailUrl',
|
|
196
|
+
value: url,
|
|
197
|
+
}),
|
|
198
|
+
];
|
|
199
|
+
if (withCode) {
|
|
200
|
+
const formattedCode = this.code.substr(0, 3) + ' ' + this.code.substr(3);
|
|
201
|
+
await sendEmailTemplate(organization, {
|
|
202
|
+
recipients: [
|
|
203
|
+
Recipient.create({
|
|
204
|
+
email: this.email,
|
|
205
|
+
replacements: [
|
|
206
|
+
...replacements,
|
|
207
|
+
Replacement.create({
|
|
208
|
+
token: 'confirmEmailCode',
|
|
209
|
+
value: formattedCode,
|
|
210
|
+
}),
|
|
211
|
+
],
|
|
212
|
+
}),
|
|
213
|
+
],
|
|
214
|
+
template: {
|
|
215
|
+
type: EmailTemplateType.VerifyEmail,
|
|
216
|
+
},
|
|
217
|
+
type: 'transactional',
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
await sendEmailTemplate(organization, {
|
|
222
|
+
recipients: [
|
|
223
|
+
Recipient.create({
|
|
224
|
+
email: this.email,
|
|
225
|
+
replacements,
|
|
226
|
+
}),
|
|
227
|
+
],
|
|
228
|
+
template: {
|
|
229
|
+
type: EmailTemplateType.VerifyEmailWithoutCode,
|
|
230
|
+
},
|
|
231
|
+
type: 'transactional',
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
static async resend(organization, token, i18n) {
|
|
236
|
+
const verificationCodes = await this.where({
|
|
237
|
+
token,
|
|
238
|
+
organizationId: organization
|
|
239
|
+
? {
|
|
240
|
+
sign: 'IN',
|
|
241
|
+
value: [organization.id, null],
|
|
242
|
+
}
|
|
243
|
+
: null,
|
|
244
|
+
}, { limit: 1 });
|
|
245
|
+
if (verificationCodes.length == 0) {
|
|
246
|
+
console.log("Can't resend code, no coded found for token", token);
|
|
247
|
+
// TODO: maybe send a note via email
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const verificationCode = verificationCodes[0];
|
|
251
|
+
if (verificationCode.expiresAt < new Date()) {
|
|
252
|
+
// Don't report error, could be brute forced
|
|
253
|
+
console.log("Can't resend code, token is expired", token);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const { User } = await import('./User.js');
|
|
257
|
+
const user = await User.getByID(verificationCode.userId);
|
|
258
|
+
if (!user) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
await verificationCode.send(user, organization, i18n);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Create or reuse a verification code for a given email address
|
|
265
|
+
* If needed, it will update the code.
|
|
266
|
+
* Use this method for sending only, not for verification!
|
|
267
|
+
*/
|
|
268
|
+
static async createFor(user, email) {
|
|
269
|
+
// TODO: make this constant time to avoid complex timing attacks (especially when under load)
|
|
270
|
+
// Do we already have a verificationCode for this email?
|
|
271
|
+
// Only user <-> organization binding is unique
|
|
272
|
+
// Since, when changing email, we don't throw an error if it is use (user enumeration)
|
|
273
|
+
// So multiple users should be able to request changing to a password, but only on validation should they fail
|
|
274
|
+
// (or this should be noted in the verification email and accounts could be merged)
|
|
275
|
+
const verificationCodes = await this.where({ userId: user.id }, { limit: 1 });
|
|
276
|
+
let verificationCode;
|
|
277
|
+
if (verificationCodes.length == 0) {
|
|
278
|
+
verificationCode = new EmailVerificationCode();
|
|
279
|
+
verificationCode.organizationId = user.organizationId;
|
|
280
|
+
await verificationCode.generateCode();
|
|
281
|
+
// Reset the real tries
|
|
282
|
+
verificationCode.tries = 0;
|
|
283
|
+
// Expire in 3 hours
|
|
284
|
+
verificationCode.expiresAt = new Date(new Date().getTime() + 1000 * 60 * 60 * 3);
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
verificationCode = verificationCodes[0];
|
|
288
|
+
if (verificationCode.email !== email || verificationCode.expiresAt < new Date(new Date().getTime() - 15 * 60 * 1000) || verificationCode.tries >= EmailVerificationCode.MAX_TRIES) {
|
|
289
|
+
// Expired: also update the token
|
|
290
|
+
await verificationCode.generateCode();
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
verificationCode.email = email;
|
|
294
|
+
verificationCode.userId = user.id;
|
|
295
|
+
await verificationCode.save();
|
|
296
|
+
return verificationCode;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
__decorate([
|
|
300
|
+
column({
|
|
301
|
+
primary: true, type: 'string', beforeSave(value) {
|
|
302
|
+
return value ?? uuidv4();
|
|
303
|
+
},
|
|
304
|
+
})
|
|
305
|
+
], EmailVerificationCode.prototype, "id", void 0);
|
|
306
|
+
__decorate([
|
|
307
|
+
column({ type: 'string', nullable: true })
|
|
308
|
+
], EmailVerificationCode.prototype, "organizationId", void 0);
|
|
309
|
+
__decorate([
|
|
310
|
+
column({ type: 'string' })
|
|
311
|
+
], EmailVerificationCode.prototype, "userId", void 0);
|
|
312
|
+
__decorate([
|
|
313
|
+
column({ type: 'string' })
|
|
314
|
+
], EmailVerificationCode.prototype, "email", void 0);
|
|
315
|
+
__decorate([
|
|
316
|
+
column({ type: 'string' })
|
|
317
|
+
], EmailVerificationCode.prototype, "token", void 0);
|
|
318
|
+
__decorate([
|
|
319
|
+
column({ type: 'string' })
|
|
320
|
+
], EmailVerificationCode.prototype, "code", void 0);
|
|
321
|
+
__decorate([
|
|
322
|
+
column({ type: 'integer' })
|
|
323
|
+
], EmailVerificationCode.prototype, "generatedCount", void 0);
|
|
324
|
+
__decorate([
|
|
325
|
+
column({ type: 'integer' })
|
|
326
|
+
], EmailVerificationCode.prototype, "tries", void 0);
|
|
327
|
+
__decorate([
|
|
328
|
+
column({ type: 'datetime' })
|
|
329
|
+
], EmailVerificationCode.prototype, "expiresAt", void 0);
|
|
330
|
+
__decorate([
|
|
331
|
+
column({
|
|
332
|
+
type: 'datetime', beforeSave() {
|
|
333
|
+
const date = new Date();
|
|
334
|
+
date.setMilliseconds(0);
|
|
335
|
+
return date;
|
|
336
|
+
},
|
|
337
|
+
})
|
|
338
|
+
], EmailVerificationCode.prototype, "createdAt", void 0);
|
|
339
|
+
//# sourceMappingURL=EmailVerificationCode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmailVerificationCode.js","sourceRoot":"","sources":["../../src/models/EmailVerificationCode.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,KAAK,MAAM,QAAQ,CAAC;AAC3B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAIzC,MAAM,QAAQ,GAAG,4DAA4D,CAAC;AAC9E,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;AAE7B,KAAK,UAAU,WAAW,CAAC,IAAY;IACnC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC,GAAiB,EAAE,GAAW,EAAE,EAAE;YACxD,IAAI,GAAG,EAAE,CAAC;gBACN,MAAM,CAAC,GAAG,CAAC,CAAC;gBACZ,OAAO;YACX,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;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AChB,CAAC;KACJ,CAAC;wDACc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["../../src/models/Event.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,KAAK,IAAI,WAAW,EAA+B,MAAM,uBAAuB,CAAC;AAErG,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,qBAAa,KAAM,SAAQ,cAAc;IACrC,MAAM,CAAC,KAAK,SAAY;IAKxB,EAAE,EAAG,MAAM,CAAC;IAGZ,IAAI,EAAE,MAAM,CAAC;IAGb,MAAM,EAAE,MAAM,CAAC;IAGf,cAAc,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGrC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAQ;IAG9B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGhC,SAAS,EAAE,IAAI,CAAC;IAGhB,OAAO,EAAE,IAAI,CAAC;IAGd,IAAI,YAAwB;IAY5B,SAAS,EAAE,IAAI,CAAC;IAUhB,SAAS,EAAE,IAAI,CAAC;IAEhB;;OAEG;IACH,YAAY,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI;IAOjC;;OAEG;IACH,mBAAmB,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI;IAOlC,qBAAqB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;CAgDlD"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { column } from '@simonbackx/simple-database';
|
|
3
|
+
import { QueryableModel } from '@stamhoofd/sql';
|
|
4
|
+
import { EventMeta, Event as EventStruct, GroupType, TranslatedString } from '@stamhoofd/structures';
|
|
5
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
6
|
+
import { Group } from './Group.js';
|
|
7
|
+
export class Event extends QueryableModel {
|
|
8
|
+
static table = 'events';
|
|
9
|
+
id;
|
|
10
|
+
name;
|
|
11
|
+
typeId;
|
|
12
|
+
organizationId = null;
|
|
13
|
+
groupId = null;
|
|
14
|
+
webshopId = null;
|
|
15
|
+
startDate;
|
|
16
|
+
endDate;
|
|
17
|
+
meta = EventMeta.create({});
|
|
18
|
+
createdAt;
|
|
19
|
+
updatedAt;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated
|
|
22
|
+
*/
|
|
23
|
+
getStructure(group) {
|
|
24
|
+
return EventStruct.create({
|
|
25
|
+
...this,
|
|
26
|
+
group: group ? group.getStructure() : null,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @deprecated
|
|
31
|
+
*/
|
|
32
|
+
getPrivateStructure(group) {
|
|
33
|
+
return EventStruct.create({
|
|
34
|
+
...this,
|
|
35
|
+
group: group ? group.getPrivateStructure() : null,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async syncGroupRequirements(group) {
|
|
39
|
+
if (!group) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
group.settings.requireDefaultAgeGroupIds = this.meta.defaultAgeGroupIds ?? [];
|
|
43
|
+
group.settings.requireGroupIds = this.meta.groups?.map(g => g.id) ?? [];
|
|
44
|
+
group.settings.startDate = this.startDate;
|
|
45
|
+
group.settings.endDate = this.endDate;
|
|
46
|
+
group.settings.minAge = this.meta.minAge ?? null;
|
|
47
|
+
group.settings.maxAge = this.meta.maxAge ?? null;
|
|
48
|
+
if (group.type === GroupType.EventRegistration) {
|
|
49
|
+
// Don't change the name of the waiting list
|
|
50
|
+
group.settings.name = new TranslatedString(this.name);
|
|
51
|
+
group.settings.eventId = this.id;
|
|
52
|
+
}
|
|
53
|
+
if (this.organizationId) {
|
|
54
|
+
// This is a not-national event, so require the organization
|
|
55
|
+
group.settings.requireOrganizationIds = [this.organizationId];
|
|
56
|
+
group.settings.requireOrganizationTags = [];
|
|
57
|
+
group.settings.requirePlatformMembershipOn = null;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
group.settings.requireOrganizationTags = this.meta.organizationTagIds ?? [];
|
|
61
|
+
// Everyone can register
|
|
62
|
+
group.settings.requireOrganizationIds = [];
|
|
63
|
+
// But they need a valid platform membership
|
|
64
|
+
group.settings.requirePlatformMembershipOn = this.endDate;
|
|
65
|
+
}
|
|
66
|
+
await group.save();
|
|
67
|
+
if (group.waitingListId) {
|
|
68
|
+
const waitingList = await Group.getByID(group.waitingListId);
|
|
69
|
+
if (waitingList) {
|
|
70
|
+
if (group.settings.allowRegistrationsByOrganization) {
|
|
71
|
+
waitingList.settings.allowRegistrationsByOrganization = true;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
waitingList.settings.allowRegistrationsByOrganization = false;
|
|
75
|
+
}
|
|
76
|
+
await this.syncGroupRequirements(waitingList);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
__decorate([
|
|
82
|
+
column({ primary: true, type: 'string', beforeSave(value) {
|
|
83
|
+
return value ?? uuidv4();
|
|
84
|
+
} })
|
|
85
|
+
], Event.prototype, "id", void 0);
|
|
86
|
+
__decorate([
|
|
87
|
+
column({ type: 'string' })
|
|
88
|
+
], Event.prototype, "name", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
column({ type: 'string' })
|
|
91
|
+
], Event.prototype, "typeId", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
column({ type: 'string', nullable: true })
|
|
94
|
+
], Event.prototype, "organizationId", void 0);
|
|
95
|
+
__decorate([
|
|
96
|
+
column({ type: 'string', nullable: true })
|
|
97
|
+
], Event.prototype, "groupId", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
column({ type: 'string', nullable: true })
|
|
100
|
+
], Event.prototype, "webshopId", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
column({ type: 'datetime' })
|
|
103
|
+
], Event.prototype, "startDate", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
column({ type: 'datetime' })
|
|
106
|
+
], Event.prototype, "endDate", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
column({ type: 'json', decoder: EventMeta })
|
|
109
|
+
], Event.prototype, "meta", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
column({
|
|
112
|
+
type: 'datetime', beforeSave(old) {
|
|
113
|
+
if (old !== undefined) {
|
|
114
|
+
return old;
|
|
115
|
+
}
|
|
116
|
+
const date = new Date();
|
|
117
|
+
date.setMilliseconds(0);
|
|
118
|
+
return date;
|
|
119
|
+
},
|
|
120
|
+
})
|
|
121
|
+
], Event.prototype, "createdAt", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
column({
|
|
124
|
+
type: 'datetime', beforeSave() {
|
|
125
|
+
const date = new Date();
|
|
126
|
+
date.setMilliseconds(0);
|
|
127
|
+
return date;
|
|
128
|
+
},
|
|
129
|
+
skipUpdate: true,
|
|
130
|
+
})
|
|
131
|
+
], Event.prototype, "updatedAt", void 0);
|
|
132
|
+
//# sourceMappingURL=Event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Event.js","sourceRoot":"","sources":["../../src/models/Event.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,KAAK,IAAI,WAAW,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACrG,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,OAAO,KAAM,SAAQ,cAAc;IACrC,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC;IAKxB,EAAE,CAAU;IAGZ,IAAI,CAAS;IAGb,MAAM,CAAS;IAGf,cA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O,IAAI,CAAC;QAChB,CAAC;KACJ,CAAC;wCACc;AAUhB;IARC,MAAM,CAAC;QACJ,IAAI,EAAE,UAAU,EAAE,UAAU;YACxB,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;YACxB,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;YACxB,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,UAAU,EAAE,IAAI;KACnB,CAAC;wCACc"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ManyToManyRelation } from '@simonbackx/simple-database';
|
|
2
|
+
import { QueryableModel } from '@stamhoofd/sql';
|
|
3
|
+
import type { RecordAnswer } from '@stamhoofd/structures';
|
|
4
|
+
import { EventNotificationStatus } from '@stamhoofd/structures';
|
|
5
|
+
import { Event } from './Event.js';
|
|
6
|
+
export declare class EventNotification extends QueryableModel {
|
|
7
|
+
static table: string;
|
|
8
|
+
id: string;
|
|
9
|
+
typeId: string;
|
|
10
|
+
periodId: string;
|
|
11
|
+
startDate: Date;
|
|
12
|
+
endDate: Date;
|
|
13
|
+
status: EventNotificationStatus;
|
|
14
|
+
/**
|
|
15
|
+
* Feedback on a review, e.g. when it is declined (explains which changes need to be made).
|
|
16
|
+
* It is only visible when the status is not 'accepted' or 'pending'.
|
|
17
|
+
*/
|
|
18
|
+
feedbackText: string | null;
|
|
19
|
+
organizationId: string;
|
|
20
|
+
recordAnswers: Map<string, RecordAnswer>;
|
|
21
|
+
/**
|
|
22
|
+
* Contains the answers of an event notification that were accepted
|
|
23
|
+
*/
|
|
24
|
+
acceptedRecordAnswers: Map<string, RecordAnswer>;
|
|
25
|
+
createdBy: string | null;
|
|
26
|
+
submittedBy: string | null;
|
|
27
|
+
submittedAt: Date | null;
|
|
28
|
+
createdAt: Date;
|
|
29
|
+
updatedAt: Date;
|
|
30
|
+
static events: ManyToManyRelation<"events", EventNotification, Event, undefined>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=EventNotification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventNotification.d.ts","sourceRoot":"","sources":["../../src/models/EventNotification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAC,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAuB,MAAM,uBAAuB,CAAC;AAErF,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,qBAAa,iBAAkB,SAAQ,cAAc;IACjD,MAAM,CAAC,KAAK,SAAyB;IAKrC,EAAE,EAAG,MAAM,CAAC;IAGZ,MAAM,EAAE,MAAM,CAAC;IAGf,QAAQ,EAAE,MAAM,CAAC;IAGjB,SAAS,EAAE,IAAI,CAAC;IAGhB,OAAO,EAAE,IAAI,CAAC;IAGd,MAAM,0BAAiC;IAEvC;;;OAGG;IAEH,YAAY,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGnC,cAAc,EAAE,MAAM,CAAC;IAGvB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IAErD;;OAEG;IAEH,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAa;IAG7D,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGhC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGlC,WAAW,EAAE,IAAI,GAAG,IAAI,CAAQ;IAYhC,SAAS,EAAE,IAAI,CAAC;IAUhB,SAAS,EAAE,IAAI,CAAC;IAGhB,MAAM,CAAC,MAAM,oEAAkG;CAClH"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { column, ManyToManyRelation } from '@simonbackx/simple-database';
|
|
3
|
+
import { MapDecoder, StringDecoder } from '@simonbackx/simple-encoding';
|
|
4
|
+
import { QueryableModel } from '@stamhoofd/sql';
|
|
5
|
+
import { EventNotificationStatus, RecordAnswerDecoder } from '@stamhoofd/structures';
|
|
6
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
7
|
+
import { Event } from './Event.js';
|
|
8
|
+
export class EventNotification extends QueryableModel {
|
|
9
|
+
static table = 'event_notifications';
|
|
10
|
+
id;
|
|
11
|
+
typeId;
|
|
12
|
+
periodId;
|
|
13
|
+
startDate;
|
|
14
|
+
endDate;
|
|
15
|
+
status = EventNotificationStatus.Draft;
|
|
16
|
+
/**
|
|
17
|
+
* Feedback on a review, e.g. when it is declined (explains which changes need to be made).
|
|
18
|
+
* It is only visible when the status is not 'accepted' or 'pending'.
|
|
19
|
+
*/
|
|
20
|
+
feedbackText = null;
|
|
21
|
+
organizationId;
|
|
22
|
+
recordAnswers = new Map();
|
|
23
|
+
/**
|
|
24
|
+
* Contains the answers of an event notification that were accepted
|
|
25
|
+
*/
|
|
26
|
+
acceptedRecordAnswers = new Map();
|
|
27
|
+
createdBy = null;
|
|
28
|
+
submittedBy = null;
|
|
29
|
+
submittedAt = null;
|
|
30
|
+
createdAt;
|
|
31
|
+
updatedAt;
|
|
32
|
+
// Note: all relations should point to their parents, not the other way around to avoid reference cycles
|
|
33
|
+
static events = new ManyToManyRelation(EventNotification, Event, 'events');
|
|
34
|
+
}
|
|
35
|
+
__decorate([
|
|
36
|
+
column({ primary: true, type: 'string', beforeSave(value) {
|
|
37
|
+
return value ?? uuidv4();
|
|
38
|
+
} })
|
|
39
|
+
], EventNotification.prototype, "id", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
column({ type: 'string' })
|
|
42
|
+
], EventNotification.prototype, "typeId", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
column({ type: 'string' })
|
|
45
|
+
], EventNotification.prototype, "periodId", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
column({ type: 'datetime' })
|
|
48
|
+
], EventNotification.prototype, "startDate", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
column({ type: 'datetime' })
|
|
51
|
+
], EventNotification.prototype, "endDate", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
column({ type: 'string' })
|
|
54
|
+
], EventNotification.prototype, "status", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
column({ type: 'string', nullable: true })
|
|
57
|
+
], EventNotification.prototype, "feedbackText", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
column({ type: 'string' })
|
|
60
|
+
], EventNotification.prototype, "organizationId", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
column({ type: 'json', decoder: new MapDecoder(StringDecoder, RecordAnswerDecoder) })
|
|
63
|
+
], EventNotification.prototype, "recordAnswers", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
column({ type: 'json', decoder: new MapDecoder(StringDecoder, RecordAnswerDecoder) })
|
|
66
|
+
], EventNotification.prototype, "acceptedRecordAnswers", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
column({ type: 'string', nullable: true })
|
|
69
|
+
], EventNotification.prototype, "createdBy", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
column({ type: 'string', nullable: true })
|
|
72
|
+
], EventNotification.prototype, "submittedBy", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
column({ type: 'datetime', nullable: true })
|
|
75
|
+
], EventNotification.prototype, "submittedAt", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
column({
|
|
78
|
+
type: 'datetime', beforeSave(old) {
|
|
79
|
+
if (old !== undefined) {
|
|
80
|
+
return old;
|
|
81
|
+
}
|
|
82
|
+
const date = new Date();
|
|
83
|
+
date.setMilliseconds(0);
|
|
84
|
+
return date;
|
|
85
|
+
},
|
|
86
|
+
})
|
|
87
|
+
], EventNotification.prototype, "createdAt", void 0);
|
|
88
|
+
__decorate([
|
|
89
|
+
column({
|
|
90
|
+
type: 'datetime', beforeSave() {
|
|
91
|
+
const date = new Date();
|
|
92
|
+
date.setMilliseconds(0);
|
|
93
|
+
return date;
|
|
94
|
+
},
|
|
95
|
+
skipUpdate: true,
|
|
96
|
+
})
|
|
97
|
+
], EventNotification.prototype, "updatedAt", void 0);
|
|
98
|
+
//# sourceMappingURL=EventNotification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventNotification.js","sourceRoot":"","sources":["../../src/models/EventNotification.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,MAAM,OAAO,iBAAkB,SAAQ,cAAc;IACjD,MAAM,CAAC,KAAK,GAAG,qBAAqB,CAAC;IAKrC,EAAE,CAAU;IAGZ,MAAM,CAAS;IAGf,QAAQ,CAAS;IAGjB,SAAS,CAAO;IAGhB,OAAO,CAAO;IAGd,MAAM,GAAG,uBAAuB,CAAC,KAAK,CAAC;IAEvC;;;OAGG;IAEH,YAAY,GAAkB,IAAI,CAAC;IAGnC,cAAc,CAAS;IAGvB,aAAa,GAA8B,IAAI,GAAG,EAAE,CAAC;IAErD;;OAEG;IAEH,qBAAqB,GAA8B,IAAI,GAAG,EAAE,CAAC;IAG7D,SAAS,GAAkB,IAAI,CAAC;IAGhC,WAAW,GAAkB,IAAI,CAAC;IAGlC,WAAW,GAAgB,IAAI,CAAC;IAYhC,SAAS,CAAO;IAUhB,SAAS,CAAO;IAEhB,wGAAwG;IACxG,MAAM,CAAC,MAAM,GAAG,IAAI,kBAAkB,CAAqC,iBAAiB,EAAE,KAAK,E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