Compare commits
16 commits
c7c674f2ae
...
590da2bc7c
| Author | SHA1 | Date | |
|---|---|---|---|
| 590da2bc7c | |||
| 90adff9e39 | |||
| 755b2fdeec | |||
| 0ff60d11a7 | |||
| 7a79ec9716 | |||
| 291db7ccfd | |||
| f5fbf42c8b | |||
| cd3ef2527f | |||
| 76b3069362 | |||
| fb6afc03a7 | |||
| 138e1452d6 | |||
| 26d2897976 | |||
| a3e59cd899 | |||
| a023d0612e | |||
| e6c50b876e | |||
| 9566da52a6 |
120 changed files with 754 additions and 782 deletions
|
|
@ -87,6 +87,23 @@ func (ac *AuthUserController) ChangePassword(c *gin.Context) {
|
||||||
ac.lc.Logout(c)
|
ac.lc.Logout(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsAuthUser checks if the currently authenticated session matches the given user identifier.
|
||||||
|
//
|
||||||
|
// @Summary Check if current user
|
||||||
|
// @Schemes
|
||||||
|
// @Description Check if the currently authenticated session matches the given user identifier.
|
||||||
|
// @Tags users
|
||||||
|
// @Accept json
|
||||||
|
// @Produce json
|
||||||
|
// @Security securitydefinitions.basic
|
||||||
|
// @Param userId path string true "User identifier"
|
||||||
|
// @Success 204 {null} null
|
||||||
|
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
||||||
|
// @Router /users/{userId}/is_auth_user [get]
|
||||||
|
func (ac *AuthUserController) IsAuthUser(c *gin.Context) {
|
||||||
|
c.Status(http.StatusNoContent)
|
||||||
|
}
|
||||||
|
|
||||||
// DeleteAuthUser delete the account related to the given user.
|
// DeleteAuthUser delete the account related to the given user.
|
||||||
//
|
//
|
||||||
// @Summary Drop account
|
// @Summary Drop account
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ func (dc *DomainController) GetDomain(c *gin.Context) {
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param domainId path string true "Domain identifier"
|
// @Param domainId path string true "Domain identifier"
|
||||||
// @Param body body happydns.Domain true "The new object overriding the current domain"
|
// @Param body body happydns.DomainUpdateInput true "The fields to update"
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Success 200 {object} happydns.Domain
|
// @Success 200 {object} happydns.Domain
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
||||||
|
|
@ -167,7 +167,7 @@ func (dc *DomainController) UpdateDomain(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var domain happydns.Domain
|
var domain happydns.DomainUpdateInput
|
||||||
err := c.ShouldBindJSON(&domain)
|
err := c.ShouldBindJSON(&domain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"errmsg": err.Error()})
|
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"errmsg": err.Error()})
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ func NewDomainLogController(domainLogService happydns.DomainLogUsecase) *DomainL
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param domainId path string true "Domain identifier"
|
// @Param domainId path string true "Domain identifier"
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Success 200 {object} []happydns.DomainLog
|
// @Success 200 {array} happydns.DomainLog
|
||||||
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
||||||
// @Failure 404 {object} happydns.ErrorResponse "Domain not found"
|
// @Failure 404 {object} happydns.ErrorResponse "Domain not found"
|
||||||
// @Router /domains/{domainId}/logs [get]
|
// @Router /domains/{domainId}/logs [get]
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ func (pc *ProviderController) AddProvider(c *gin.Context) {
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param providerId path string true "Provider identifier"
|
// @Param providerId path string true "Provider identifier"
|
||||||
// @Param body body happydns.Provider true "The new object overriding the current provider"
|
// @Param body body happydns.ProviderMinimal true "The new object overriding the current provider"
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Success 200 {object} happydns.Provider
|
// @Success 200 {object} happydns.Provider
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
||||||
|
|
@ -197,7 +197,7 @@ func (pc *ProviderController) DeleteProvider(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusNoContent, nil)
|
c.Status(http.StatusNoContent)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDomainsHostedByProvider lists domains available to management from the given Provider.
|
// GetDomainsHostedByProvider lists domains available to management from the given Provider.
|
||||||
|
|
@ -210,7 +210,7 @@ func (pc *ProviderController) DeleteProvider(c *gin.Context) {
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param providerId path string true "Provider identifier"
|
// @Param providerId path string true "Provider identifier"
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Success 200 {object} happydns.Provider
|
// @Success 200 {array} string
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "Unable to instantiate the provider"
|
// @Failure 400 {object} happydns.ErrorResponse "Unable to instantiate the provider"
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "The provider doesn't support domain listing"
|
// @Failure 400 {object} happydns.ErrorResponse "The provider doesn't support domain listing"
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "Provider error"
|
// @Failure 400 {object} happydns.ErrorResponse "Provider error"
|
||||||
|
|
@ -238,8 +238,9 @@ func (pc *ProviderController) GetDomainsHostedByProvider(c *gin.Context) {
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param providerId path string true "Provider identifier"
|
// @Param providerId path string true "Provider identifier"
|
||||||
|
// @Param fqdn path string true "Fully qualified domain name"
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Success 200 {object} happydns.Provider
|
// @Success 204 "Domain created successfully"
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "Unable to instantiate the provider"
|
// @Failure 400 {object} happydns.ErrorResponse "Unable to instantiate the provider"
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "The provider doesn't support domain listing"
|
// @Failure 400 {object} happydns.ErrorResponse "The provider doesn't support domain listing"
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "Provider error"
|
// @Failure 400 {object} happydns.ErrorResponse "Provider error"
|
||||||
|
|
@ -255,5 +256,5 @@ func (pc *ProviderController) CreateDomainOnProvider(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusOK, true)
|
c.Status(http.StatusNoContent)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ func NewProviderSettingsController(pSettingsServices happydns.ProviderSettingsUs
|
||||||
// @Param body body happydns.ProviderSettingsState true "The current state of the Provider's settings, possibly empty (but not null)"
|
// @Param body body happydns.ProviderSettingsState true "The current state of the Provider's settings, possibly empty (but not null)"
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Success 200 {object} happydns.Provider "The Provider has been created with the given settings"
|
// @Success 200 {object} happydns.Provider "The Provider has been created with the given settings"
|
||||||
// @Success 202 {object} happydns.ProviderSettingsResponse "The settings need more rafinement"
|
// @Success 202 {object} happydns.ProviderSettingsResponse "The settings need more refinement"
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
||||||
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
||||||
// @Failure 404 {object} happydns.ErrorResponse "Provider not found"
|
// @Failure 404 {object} happydns.ErrorResponse "Provider not found"
|
||||||
|
|
|
||||||
|
|
@ -42,32 +42,6 @@ func NewResolverController(resolverService happydns.ResolverUsecase) *ResolverCo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DNSMsg is the documentation struct corresponding to dns.Msg
|
|
||||||
type DNSMsg struct {
|
|
||||||
// Question is the Question section of the DNS response.
|
|
||||||
Question []DNSQuestion
|
|
||||||
|
|
||||||
// Answer is the list of Answer records in the DNS response.
|
|
||||||
Answer []any `swaggertype:"object"`
|
|
||||||
|
|
||||||
// Ns is the list of Authoritative records in the DNS response.
|
|
||||||
Ns []any `swaggertype:"object"`
|
|
||||||
|
|
||||||
// Extra is the list of extra records in the DNS response.
|
|
||||||
Extra []any `swaggertype:"object"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type DNSQuestion struct {
|
|
||||||
// Name is the domain name researched.
|
|
||||||
Name string
|
|
||||||
|
|
||||||
// Qtype is the type of record researched.
|
|
||||||
Qtype uint16
|
|
||||||
|
|
||||||
// Qclass is the class of record researched.
|
|
||||||
Qclass uint16
|
|
||||||
}
|
|
||||||
|
|
||||||
// RunResolver performs a NS resolution for a given domain, with options.
|
// RunResolver performs a NS resolution for a given domain, with options.
|
||||||
//
|
//
|
||||||
// @Summary Perform a DNS resolution.
|
// @Summary Perform a DNS resolution.
|
||||||
|
|
@ -77,8 +51,7 @@ type DNSQuestion struct {
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Param body body happydns.ResolverRequest true "Options to the resolution"
|
// @Param body body happydns.ResolverRequest true "Options to the resolution"
|
||||||
// @Success 200 {object} DNSMsg
|
// @Success 200 {object} happydns.ResolverResponse
|
||||||
// @Success 204 {object} happydns.ErrorResponse "No content"
|
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
||||||
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
||||||
// @Failure 403 {object} happydns.ErrorResponse "The resolver refused to treat our request"
|
// @Failure 403 {object} happydns.ErrorResponse "The resolver refused to treat our request"
|
||||||
|
|
@ -100,5 +73,5 @@ func (rc *ResolverController) RunResolver(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusOK, r)
|
c.JSON(http.StatusOK, happydns.NewResolverResponseFromMsg(r))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,9 +56,10 @@ func NewServiceController(duService happydns.ZoneServiceUsecase, suService happy
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Param domainId path string true "Domain identifier"
|
// @Param domainId path string true "Domain identifier"
|
||||||
// @Param zoneId path string true "Zone identifier"
|
// @Param zoneId path string true "Zone identifier"
|
||||||
// @Param subdomain path string true "Part of the subdomain considered for the service (@ for the root of the zone ; subdomain is relative to the root, do not include it)"
|
// @Param subdomain path string true "Part of the subdomain considered for the service (@ for the root of the zone ; subdomain is relative to the root, do not include it)"
|
||||||
|
// @Param body body happydns.Service true "Service to add"
|
||||||
// @Success 200 {object} happydns.Zone
|
// @Success 200 {object} happydns.Zone
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
||||||
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ func (ssc *ServiceSpecsController) InitializeServiceSpec(c *gin.Context) {
|
||||||
// @Param serviceType path string true "The service's type"
|
// @Param serviceType path string true "The service's type"
|
||||||
// @Param domain query string true "The domain to use to generate the records"
|
// @Param domain query string true "The domain to use to generate the records"
|
||||||
// @Param ttl query int false "The TTL used by the generated records"
|
// @Param ttl query int false "The TTL used by the generated records"
|
||||||
|
// @Param body body happydns.Service true "The service configuration to generate records for"
|
||||||
// @Success 200 {array} happydns.Record
|
// @Success 200 {array} happydns.Record
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "Invalid request body"
|
// @Failure 400 {object} happydns.ErrorResponse "Invalid request body"
|
||||||
// @Failure 404 {object} happydns.ErrorResponse "Service type does not exist"
|
// @Failure 404 {object} happydns.ErrorResponse "Service type does not exist"
|
||||||
|
|
|
||||||
|
|
@ -68,9 +68,9 @@ func (sc *SessionController) SessionHandler(c *gin.Context) {
|
||||||
// @Description Get the content of the current user's session.
|
// @Description Get the content of the current user's session.
|
||||||
// @Tags users
|
// @Tags users
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Prodsce json
|
// @Produce json
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Ssccess 200 {object} happydns.Session
|
// @Success 200 {object} happydns.Session
|
||||||
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
||||||
// @Router /session [get]
|
// @Router /session [get]
|
||||||
func (sc *SessionController) GetSession(c *gin.Context) {
|
func (sc *SessionController) GetSession(c *gin.Context) {
|
||||||
|
|
@ -97,9 +97,9 @@ func (sc *SessionController) GetSession(c *gin.Context) {
|
||||||
// @Description Remove the content of the current user's session.
|
// @Description Remove the content of the current user's session.
|
||||||
// @Tags users
|
// @Tags users
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Prodsce json
|
// @Produce json
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Ssccess 204
|
// @Success 204
|
||||||
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
||||||
// @Router /session [delete]
|
// @Router /session [delete]
|
||||||
func (sc *SessionController) ClearSession(c *gin.Context) {
|
func (sc *SessionController) ClearSession(c *gin.Context) {
|
||||||
|
|
@ -117,9 +117,9 @@ func (sc *SessionController) ClearSession(c *gin.Context) {
|
||||||
// @Description Closes all sessions for a given user.
|
// @Description Closes all sessions for a given user.
|
||||||
// @Tags users
|
// @Tags users
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Prodsce json
|
// @Produce json
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Ssccess 204 {null} null
|
// @Success 204
|
||||||
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
||||||
// @Router /sessions [delete]
|
// @Router /sessions [delete]
|
||||||
func (sc *SessionController) ClearUserSessions(c *gin.Context) {
|
func (sc *SessionController) ClearUserSessions(c *gin.Context) {
|
||||||
|
|
@ -145,9 +145,9 @@ func (sc *SessionController) ClearUserSessions(c *gin.Context) {
|
||||||
// @Description List the sessions open for the current user
|
// @Description List the sessions open for the current user
|
||||||
// @Tags users
|
// @Tags users
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Prodsce json
|
// @Produce json
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Ssccess 200 {object} happydns.Session
|
// @Success 200 {array} happydns.Session
|
||||||
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
||||||
// @Router /sessions [get]
|
// @Router /sessions [get]
|
||||||
func (sc *SessionController) GetSessions(c *gin.Context) {
|
func (sc *SessionController) GetSessions(c *gin.Context) {
|
||||||
|
|
@ -173,13 +173,14 @@ func (sc *SessionController) GetSessions(c *gin.Context) {
|
||||||
// @Description Create a new session for the current user.
|
// @Description Create a new session for the current user.
|
||||||
// @Tags users
|
// @Tags users
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Prodsce json
|
// @Produce json
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Ssccess 200 {object} happydns.Session
|
// @Param body body happydns.SessionInput true "Session to create"
|
||||||
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
// @Success 200 {object} happydns.Session
|
||||||
|
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
||||||
// @Router /sessions [post]
|
// @Router /sessions [post]
|
||||||
func (sc *SessionController) CreateSession(c *gin.Context) {
|
func (sc *SessionController) CreateSession(c *gin.Context) {
|
||||||
var us happydns.Session
|
var us happydns.SessionInput
|
||||||
err := c.ShouldBindJSON(&us)
|
err := c.ShouldBindJSON(&us)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("%s sends invalid Session JSON: %s", c.ClientIP(), err.Error())
|
log.Printf("%s sends invalid Session JSON: %s", c.ClientIP(), err.Error())
|
||||||
|
|
@ -199,7 +200,7 @@ func (sc *SessionController) CreateSession(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusOK, gin.H{"id": sess.Id})
|
c.JSON(http.StatusOK, sess)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateSession update a session owned by the current user
|
// UpdateSession update a session owned by the current user
|
||||||
|
|
@ -209,14 +210,15 @@ func (sc *SessionController) CreateSession(c *gin.Context) {
|
||||||
// @Description Update a session owned by the current user.
|
// @Description Update a session owned by the current user.
|
||||||
// @Tags users
|
// @Tags users
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Param sessionId path string true "Session identifier"
|
// @Produce json
|
||||||
// @Prodsce json
|
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Ssccess 200 {object} happydns.Session
|
// @Param sessionId path string true "Session identifier"
|
||||||
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
// @Param body body happydns.SessionInput true "Session fields to update"
|
||||||
|
// @Success 200 {object} happydns.Session
|
||||||
|
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
||||||
// @Router /sessions/{sessionId} [put]
|
// @Router /sessions/{sessionId} [put]
|
||||||
func (sc *SessionController) UpdateSession(c *gin.Context) {
|
func (sc *SessionController) UpdateSession(c *gin.Context) {
|
||||||
var us happydns.Session
|
var us happydns.SessionInput
|
||||||
err := c.ShouldBindJSON(&us)
|
err := c.ShouldBindJSON(&us)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("%s sends invalid Session JSON: %s", c.ClientIP(), err.Error())
|
log.Printf("%s sends invalid Session JSON: %s", c.ClientIP(), err.Error())
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,8 @@ func NewUserController(userService happydns.UserUsecase, lc *LoginController) *U
|
||||||
// @Tags users
|
// @Tags users
|
||||||
// @Accept json
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Success 200 {object} happydns.User "The created user"
|
// @Param userId path string true "User identifier"
|
||||||
|
// @Success 200 {object} happydns.User "The user"
|
||||||
// @Failure 500 {object} happydns.ErrorResponse
|
// @Failure 500 {object} happydns.ErrorResponse
|
||||||
// @Router /users/{userId} [get]
|
// @Router /users/{userId} [get]
|
||||||
func (uc *UserController) GetUser(c *gin.Context) {
|
func (uc *UserController) GetUser(c *gin.Context) {
|
||||||
|
|
|
||||||
|
|
@ -145,7 +145,7 @@ func (zc *ZoneController) DiffZonesHandler(c *gin.Context) {
|
||||||
// @Param domainId path string true "Domain identifier"
|
// @Param domainId path string true "Domain identifier"
|
||||||
// @Param zoneId path string true "Zone identifier to use as the new one."
|
// @Param zoneId path string true "Zone identifier to use as the new one."
|
||||||
// @Param oldZoneId path string true "Zone identifier to use as the old one. Currently only @ are expected, to use the currently deployed zone."
|
// @Param oldZoneId path string true "Zone identifier to use as the old one. Currently only @ are expected, to use the currently deployed zone."
|
||||||
// @Success 200 {object} []happydns.Correction "Differences, reported as text, one diff per item"
|
// @Success 200 {array} happydns.Correction "Differences, reported as text, one diff per item"
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
||||||
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
||||||
// @Failure 404 {object} happydns.ErrorResponse "Domain not found"
|
// @Failure 404 {object} happydns.ErrorResponse "Domain not found"
|
||||||
|
|
@ -194,7 +194,7 @@ func (zc *ZoneController) DiffZonesSummary(c *gin.Context) {
|
||||||
// @Security securitydefinitions.basic
|
// @Security securitydefinitions.basic
|
||||||
// @Param domainId path string true "Domain identifier"
|
// @Param domainId path string true "Domain identifier"
|
||||||
// @Param zoneId path string true "Zone identifier"
|
// @Param zoneId path string true "Zone identifier"
|
||||||
// @Param body body []string true "Differences (from /diff_zones) to apply"
|
// @Param body body happydns.ApplyZoneForm true "Differences to apply with commit message"
|
||||||
// @Success 200 {object} happydns.ZoneMeta "The new Zone metadata containing the current zone"
|
// @Success 200 {object} happydns.ZoneMeta "The new Zone metadata containing the current zone"
|
||||||
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
// @Failure 400 {object} happydns.ErrorResponse "Invalid input"
|
||||||
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
// @Failure 401 {object} happydns.ErrorResponse "Authentication failure"
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,6 @@
|
||||||
package route
|
package route
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|
||||||
"git.happydns.org/happyDomain/internal/api/controller"
|
"git.happydns.org/happyDomain/internal/api/controller"
|
||||||
|
|
@ -36,9 +34,7 @@ func DeclareAuthUserRoutes(router *gin.RouterGroup, authUserUC happydns.AuthUser
|
||||||
|
|
||||||
apiUserAuthRoutes := router.Group("/users/:uid")
|
apiUserAuthRoutes := router.Group("/users/:uid")
|
||||||
apiUserAuthRoutes.Use(middleware.AuthUserHandler(authUserUC))
|
apiUserAuthRoutes.Use(middleware.AuthUserHandler(authUserUC))
|
||||||
apiUserAuthRoutes.GET("/is_auth_user", func(c *gin.Context) {
|
apiUserAuthRoutes.GET("/is_auth_user", ac.IsAuthUser)
|
||||||
c.Status(http.StatusNoContent)
|
|
||||||
})
|
|
||||||
apiUserAuthRoutes.POST("/delete", ac.DeleteAuthUser)
|
apiUserAuthRoutes.POST("/delete", ac.DeleteAuthUser)
|
||||||
apiUserAuthRoutes.POST("/new_password", ac.ChangePassword)
|
apiUserAuthRoutes.POST("/new_password", ac.ChangePassword)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,13 @@ import (
|
||||||
// UserAuth represents an account used for authentication (not used in case of external auth).
|
// UserAuth represents an account used for authentication (not used in case of external auth).
|
||||||
type UserAuth struct {
|
type UserAuth struct {
|
||||||
// Id is the User's identifier.
|
// Id is the User's identifier.
|
||||||
Id Identifier `json:"id" swaggertype:"string"`
|
Id Identifier `json:"id" swaggertype:"string" readonly:"true"`
|
||||||
|
|
||||||
// Email is the User's login and mean of contact.
|
// Email is the User's login and mean of contact.
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
|
|
||||||
// EmailVerification is the time when the User verify its email address.
|
// EmailVerification is the time when the User verify its email address.
|
||||||
EmailVerification *time.Time `json:"emailVerification,omitempty"`
|
EmailVerification *time.Time `json:"emailVerification,omitempty" format:"date-time"`
|
||||||
|
|
||||||
// Password is hashed.
|
// Password is hashed.
|
||||||
Password []byte `json:"password,omitempty"`
|
Password []byte `json:"password,omitempty"`
|
||||||
|
|
@ -45,10 +45,10 @@ type UserAuth struct {
|
||||||
PasswordRecoveryKey []byte `json:"passwordRecoveryKey,omitempty"`
|
PasswordRecoveryKey []byte `json:"passwordRecoveryKey,omitempty"`
|
||||||
|
|
||||||
// CreatedAt is the time when the User has register is account.
|
// CreatedAt is the time when the User has register is account.
|
||||||
CreatedAt time.Time `json:"createdAt"`
|
CreatedAt time.Time `json:"createdAt" format:"date-time" readonly:"true"`
|
||||||
|
|
||||||
// LastLoggedIn is the time when the User has logged in for the last time.
|
// LastLoggedIn is the time when the User has logged in for the last time.
|
||||||
LastLoggedIn *time.Time `json:"lastLoggedIn,omitempty"`
|
LastLoggedIn *time.Time `json:"lastLoggedIn,omitempty" format:"date-time"`
|
||||||
|
|
||||||
// AllowCommercials stores the user preference regarding email contacts.
|
// AllowCommercials stores the user preference regarding email contacts.
|
||||||
AllowCommercials bool `json:"allowCommercials"`
|
AllowCommercials bool `json:"allowCommercials"`
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@ const (
|
||||||
type Correction struct {
|
type Correction struct {
|
||||||
F func() error `json:"-"`
|
F func() error `json:"-"`
|
||||||
Id Identifier `json:"id,omitempty" swaggertype:"string"`
|
Id Identifier `json:"id,omitempty" swaggertype:"string"`
|
||||||
Msg string `json:"msg"`
|
Msg string `json:"msg" binding:"required"`
|
||||||
Kind CorrectionKind `json:"kind,omitempty"`
|
Kind CorrectionKind `json:"kind" binding:"required"`
|
||||||
OldRecords []Record `json:"-"`
|
OldRecords []Record `json:"-"`
|
||||||
NewRecords []Record `json:"-"`
|
NewRecords []Record `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,24 +42,30 @@ type DomainCreationInput struct {
|
||||||
// Domain holds information about a domain name own by a User.
|
// Domain holds information about a domain name own by a User.
|
||||||
type Domain struct {
|
type Domain struct {
|
||||||
// Id is the Domain's identifier in the database.
|
// Id is the Domain's identifier in the database.
|
||||||
Id Identifier `json:"id" swaggertype:"string"`
|
Id Identifier `json:"id" swaggertype:"string" binding:"required" readonly:"true"`
|
||||||
|
|
||||||
// Owner is the identifier of the Domain's Owner.
|
// Owner is the identifier of the Domain's Owner.
|
||||||
Owner Identifier `json:"id_owner" swaggertype:"string"`
|
Owner Identifier `json:"id_owner" swaggertype:"string" binding:"required"`
|
||||||
|
|
||||||
// ProviderId is the identifier of the Provider used to access and edit the
|
// ProviderId is the identifier of the Provider used to access and edit the
|
||||||
// Domain.
|
// Domain.
|
||||||
ProviderId Identifier `json:"id_provider" swaggertype:"string"`
|
ProviderId Identifier `json:"id_provider" swaggertype:"string" binding:"required"`
|
||||||
|
|
||||||
// DomainName is the FQDN of the managed Domain.
|
// DomainName is the FQDN of the managed Domain.
|
||||||
DomainName string `json:"domain"`
|
DomainName string `json:"domain" binding:"required"`
|
||||||
|
|
||||||
// Group is a hint string aims to group domains.
|
// Group is a hint string aims to group domains.
|
||||||
Group string `json:"group,omitempty"`
|
Group string `json:"group,omitempty"`
|
||||||
|
|
||||||
// ZoneHistory are the identifiers to the Zone attached to the current
|
// ZoneHistory are the identifiers to the Zone attached to the current
|
||||||
// Domain.
|
// Domain.
|
||||||
ZoneHistory []Identifier `json:"zone_history" swaggertype:"array,string"`
|
ZoneHistory []Identifier `json:"zone_history" swaggertype:"array,string" binding:"required" readonly:"true"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// DomainUpdateInput is used for swagger documentation as Domain update.
|
||||||
|
type DomainUpdateInput struct {
|
||||||
|
// Group is a hint string aims to group domains.
|
||||||
|
Group string `json:"group,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDomain(user *User, name string, providerID Identifier) (*Domain, error) {
|
func NewDomain(user *User, name string, providerID Identifier) (*Domain, error) {
|
||||||
|
|
|
||||||
|
|
@ -72,10 +72,10 @@ type CustomForm struct {
|
||||||
// Field
|
// Field
|
||||||
type Field struct {
|
type Field struct {
|
||||||
// Id is the field identifier.
|
// Id is the field identifier.
|
||||||
Id string `json:"id"`
|
Id string `json:"id" binding:"required"`
|
||||||
|
|
||||||
// Type is the string representation of the field's type.
|
// Type is the string representation of the field's type.
|
||||||
Type string `json:"type"`
|
Type string `json:"type" binding:"required"`
|
||||||
|
|
||||||
// Label is the title given to the field, displayed as <label> tag on the interface.
|
// Label is the title given to the field, displayed as <label> tag on the interface.
|
||||||
Label string `json:"label,omitempty"`
|
Label string `json:"label,omitempty"`
|
||||||
|
|
|
||||||
|
|
@ -41,19 +41,19 @@ const (
|
||||||
|
|
||||||
type DomainLog struct {
|
type DomainLog struct {
|
||||||
// Id is the Log's identifier in the database.
|
// Id is the Log's identifier in the database.
|
||||||
Id Identifier `json:"id" swaggertype:"string"`
|
Id Identifier `json:"id" swaggertype:"string" binding:"required" readonly:"true"`
|
||||||
|
|
||||||
// IdUser is the identifier of the person responsible for the action.
|
// IdUser is the identifier of the person responsible for the action.
|
||||||
IdUser Identifier `json:"id_user" swaggertype:"string"`
|
IdUser Identifier `json:"id_user" swaggertype:"string" binding:"required" readonly:"true"`
|
||||||
|
|
||||||
// Date is the date of the action.
|
// Date is the date of the action.
|
||||||
Date time.Time `json:"date"`
|
Date time.Time `json:"date" binding:"required" format:"date-time" readonly:"true"`
|
||||||
|
|
||||||
// Content is the description of the action logged.
|
// Content is the description of the action logged.
|
||||||
Content string `json:"content"`
|
Content string `json:"content" binding:"required" readonly:"true"`
|
||||||
|
|
||||||
// Level reports the criticity level of the action logged.
|
// Level reports the criticity level of the action logged.
|
||||||
Level int8 `json:"level"`
|
Level int8 `json:"level" binding:"required" readonly:"true"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DomainLogWithDomainId struct {
|
type DomainLogWithDomainId struct {
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,10 @@ type ProviderBody interface {
|
||||||
// ProviderInfos describes the purpose of a user usable provider.
|
// ProviderInfos describes the purpose of a user usable provider.
|
||||||
type ProviderInfos struct {
|
type ProviderInfos struct {
|
||||||
// Name is the name displayed.
|
// Name is the name displayed.
|
||||||
Name string `json:"name"`
|
Name string `json:"name" binding:"required"`
|
||||||
|
|
||||||
// Description is a brief description of what the provider is.
|
// Description is a brief description of what the provider is.
|
||||||
Description string `json:"description"`
|
Description string `json:"description" binding:"required"`
|
||||||
|
|
||||||
// Capabilites is a list of special ability of the provider (automatically filled).
|
// Capabilites is a list of special ability of the provider (automatically filled).
|
||||||
Capabilities []string `json:"capabilities,omitempty"`
|
Capabilities []string `json:"capabilities,omitempty"`
|
||||||
|
|
@ -72,13 +72,13 @@ type ProviderMinimal struct {
|
||||||
// ProviderMeta holds the metadata associated to a Provider.
|
// ProviderMeta holds the metadata associated to a Provider.
|
||||||
type ProviderMeta struct {
|
type ProviderMeta struct {
|
||||||
// Type is the string representation of the Provider's type.
|
// Type is the string representation of the Provider's type.
|
||||||
Type string `json:"_srctype"`
|
Type string `json:"_srctype" binding:"required"`
|
||||||
|
|
||||||
// Id is the Provider's identifier.
|
// Id is the Provider's identifier.
|
||||||
Id Identifier `json:"_id" swaggertype:"string"`
|
Id Identifier `json:"_id" swaggertype:"string" binding:"required" readonly:"true"`
|
||||||
|
|
||||||
// Owner is the User's identifier for the current Provider.
|
// Owner is the User's identifier for the current Provider.
|
||||||
Owner Identifier `json:"_ownerid" swaggertype:"string"`
|
Owner Identifier `json:"_ownerid" swaggertype:"string" binding:"required" readonly:"true"`
|
||||||
|
|
||||||
// Comment is a string that helps user to distinguish the Provider.
|
// Comment is a string that helps user to distinguish the Provider.
|
||||||
Comment string `json:"_comment,omitempty"`
|
Comment string `json:"_comment,omitempty"`
|
||||||
|
|
|
||||||
|
|
@ -40,30 +40,48 @@ type ResolverRequest struct {
|
||||||
Type string `json:"type"`
|
Type string `json:"type"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DNSQuestion holds a single DNS question entry.
|
||||||
type DNSQuestion struct {
|
type DNSQuestion struct {
|
||||||
// Name is the domain name researched.
|
// Name is the domain name researched.
|
||||||
Name string
|
Name string `json:"name"`
|
||||||
|
|
||||||
// Qtype is the type of record researched.
|
// Qtype is the type of record researched.
|
||||||
Qtype uint16
|
Qtype uint16 `json:"qtype"`
|
||||||
|
|
||||||
// Qclass is the class of record researched.
|
// Qclass is the class of record researched.
|
||||||
Qclass uint16
|
Qclass uint16 `json:"qclass"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DNSMsg is the documentation struct corresponding to dns.Msg
|
// ResolverResponse is the API response for a DNS resolution.
|
||||||
type DNSMsg struct {
|
type ResolverResponse struct {
|
||||||
// Question is the Question section of the DNS response.
|
// Question is the Question section of the DNS response.
|
||||||
Question []DNSQuestion
|
Question []DNSQuestion `json:"question"`
|
||||||
|
|
||||||
// Answer is the list of Answer records in the DNS response.
|
// Answer is the list of Answer records in the DNS response.
|
||||||
Answer []any `swaggertype:"object"`
|
Answer []dns.RR `json:"answer" swaggertype:"object"`
|
||||||
|
|
||||||
// Ns is the list of Authoritative records in the DNS response.
|
// Ns is the list of Authoritative records in the DNS response.
|
||||||
Ns []any `swaggertype:"object"`
|
Ns []dns.RR `json:"ns" swaggertype:"object"`
|
||||||
|
|
||||||
// Extra is the list of extra records in the DNS response.
|
// Extra is the list of extra records in the DNS response.
|
||||||
Extra []any `swaggertype:"object"`
|
Extra []dns.RR `json:"extra" swaggertype:"object"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewResolverResponseFromMsg converts a dns.Msg to a ResolverResponse.
|
||||||
|
func NewResolverResponseFromMsg(msg *dns.Msg) *ResolverResponse {
|
||||||
|
resp := &ResolverResponse{
|
||||||
|
Answer: msg.Answer,
|
||||||
|
Ns: msg.Ns,
|
||||||
|
Extra: msg.Extra,
|
||||||
|
}
|
||||||
|
for _, q := range msg.Question {
|
||||||
|
resp.Question = append(resp.Question, DNSQuestion{
|
||||||
|
Name: q.Name,
|
||||||
|
Qtype: q.Qtype,
|
||||||
|
Qclass: q.Qclass,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return resp
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResolverUsecase interface {
|
type ResolverUsecase interface {
|
||||||
|
|
|
||||||
|
|
@ -84,19 +84,19 @@ type SPFContributor interface {
|
||||||
// ServiceMeta holds the metadata associated to a Service.
|
// ServiceMeta holds the metadata associated to a Service.
|
||||||
type ServiceMeta struct {
|
type ServiceMeta struct {
|
||||||
// Type is the string representation of the Service's type.
|
// Type is the string representation of the Service's type.
|
||||||
Type string `json:"_svctype"`
|
Type string `json:"_svctype" binding:"required" readonly:"true"`
|
||||||
|
|
||||||
// Id is the Service's identifier.
|
// Id is the Service's identifier.
|
||||||
Id Identifier `json:"_id,omitempty" swaggertype:"string"`
|
Id Identifier `json:"_id,omitempty" swaggertype:"string" readonly:"true"`
|
||||||
|
|
||||||
// OwnerId is the User's identifier for the current Service.
|
// OwnerId is the User's identifier for the current Service.
|
||||||
OwnerId Identifier `json:"_ownerid,omitempty" swaggertype:"string"`
|
OwnerId Identifier `json:"_ownerid,omitempty" swaggertype:"string"`
|
||||||
|
|
||||||
// Domain contains the abstract domain where this Service relates.
|
// Domain contains the abstract domain where this Service relates.
|
||||||
Domain string `json:"_domain"`
|
Domain string `json:"_domain" binding:"required"`
|
||||||
|
|
||||||
// Ttl contains the specific TTL for the underlying Resources.
|
// Ttl contains the specific TTL for the underlying Resources.
|
||||||
Ttl uint32 `json:"_ttl"`
|
Ttl uint32 `json:"_ttl" binding:"required"`
|
||||||
|
|
||||||
// Comment is a string that helps user to distinguish the Service.
|
// Comment is a string that helps user to distinguish the Service.
|
||||||
Comment string `json:"_comment,omitempty"`
|
Comment string `json:"_comment,omitempty"`
|
||||||
|
|
@ -109,11 +109,11 @@ type ServiceMeta struct {
|
||||||
Aliases []string `json:"_aliases,omitempty"`
|
Aliases []string `json:"_aliases,omitempty"`
|
||||||
|
|
||||||
// NbResources holds the number of Resources stored inside this Service.
|
// NbResources holds the number of Resources stored inside this Service.
|
||||||
NbResources int `json:"_tmp_hint_nb"`
|
NbResources int `json:"_tmp_hint_nb" binding:"required"`
|
||||||
|
|
||||||
// PropagatedAt is the estimated time at which the last published changes
|
// PropagatedAt is the estimated time at which the last published changes
|
||||||
// for this service will be fully propagated (old cached records expired).
|
// for this service will be fully propagated (old cached records expired).
|
||||||
PropagatedAt *time.Time `json:"_propagated_at,omitempty"`
|
PropagatedAt *time.Time `json:"_propagated_at,omitempty" format:"date-time"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServiceCombined combined ServiceMeta + Service
|
// ServiceCombined combined ServiceMeta + Service
|
||||||
|
|
|
||||||
|
|
@ -53,13 +53,13 @@ type ServiceRestrictions struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ServiceInfos struct {
|
type ServiceInfos struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name" binding:"required"`
|
||||||
Type string `json:"_svctype"`
|
Type string `json:"_svctype" binding:"required"`
|
||||||
Icon string `json:"_svcicon,omitempty"`
|
Icon string `json:"_svcicon,omitempty"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description" binding:"required"`
|
||||||
Family string `json:"family"`
|
Family string `json:"family" binding:"required"`
|
||||||
Categories []string `json:"categories"`
|
Categories []string `json:"categories" binding:"required"`
|
||||||
RecordTypes []uint16 `json:"record_types"`
|
RecordTypes []uint16 `json:"record_types" binding:"required"`
|
||||||
Tabs bool `json:"tabs,omitempty"`
|
Tabs bool `json:"tabs,omitempty"`
|
||||||
Restrictions ServiceRestrictions `json:"restrictions,omitempty"`
|
Restrictions ServiceRestrictions `json:"restrictions,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,30 +25,39 @@ import (
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Session holds informatin about a User's currently connected.
|
// Session holds information about a User's currently connected.
|
||||||
type Session struct {
|
type Session struct {
|
||||||
// Id is the Session's identifier.
|
// Id is the Session's identifier.
|
||||||
Id string `json:"id"`
|
Id string `json:"id" binding:"required" readonly:"true"`
|
||||||
|
|
||||||
// IdUser is the User's identifier of the Session.
|
// IdUser is the User's identifier of the Session.
|
||||||
IdUser Identifier `json:"login" swaggertype:"string"`
|
IdUser Identifier `json:"login" swaggertype:"string" binding:"required" readonly:"true"`
|
||||||
|
|
||||||
// Description is a user defined string aims to identify each session.
|
// Description is a user defined string aims to identify each session.
|
||||||
Description string `json:"description"`
|
Description string `json:"description" binding:"required"`
|
||||||
|
|
||||||
// IssuedAt holds the creation date of the Session.
|
// IssuedAt holds the creation date of the Session.
|
||||||
IssuedAt time.Time `json:"time"`
|
IssuedAt time.Time `json:"time" binding:"required" format:"date-time" readonly:"true"`
|
||||||
|
|
||||||
// ExpiresOn holds the expirate date of the Session.
|
// ExpiresOn holds the expirate date of the Session.
|
||||||
ExpiresOn time.Time `json:"exp"`
|
ExpiresOn time.Time `json:"exp" binding:"required" format:"date-time"`
|
||||||
|
|
||||||
// ModifiedOn is the last time the session has been updated.
|
// ModifiedOn is the last time the session has been updated.
|
||||||
ModifiedOn time.Time `json:"upd"`
|
ModifiedOn time.Time `json:"upd" binding:"required" format:"date-time"`
|
||||||
|
|
||||||
// Content stores data filled by other modules.
|
// Content stores data filled by other modules.
|
||||||
Content string `json:"content,omitempty"`
|
Content string `json:"content,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SessionInput is used for creating or updating a session.
|
||||||
|
type SessionInput struct {
|
||||||
|
// Description is a user defined string aims to identify each session.
|
||||||
|
Description string `json:"description"`
|
||||||
|
|
||||||
|
// ExpiresOn holds the expirate date of the Session.
|
||||||
|
ExpiresOn time.Time `json:"exp" format:"date-time"`
|
||||||
|
}
|
||||||
|
|
||||||
// ClearSession removes all content from the Session.
|
// ClearSession removes all content from the Session.
|
||||||
func (s *Session) ClearSession() {
|
func (s *Session) ClearSession() {
|
||||||
s.Content = ""
|
s.Content = ""
|
||||||
|
|
|
||||||
|
|
@ -29,19 +29,19 @@ import (
|
||||||
// User represents an account.
|
// User represents an account.
|
||||||
type User struct {
|
type User struct {
|
||||||
// Id is the User's identifier.
|
// Id is the User's identifier.
|
||||||
Id Identifier `json:"id" swaggertype:"string"`
|
Id Identifier `json:"id" swaggertype:"string" binding:"required" readonly:"true"`
|
||||||
|
|
||||||
// Email is the User's login and means of contact.
|
// Email is the User's login and means of contact.
|
||||||
Email string `json:"email"`
|
Email string `json:"email" binding:"required"`
|
||||||
|
|
||||||
// CreatedAt is the time when the User logs in for the first time.
|
// CreatedAt is the time when the User logs in for the first time.
|
||||||
CreatedAt time.Time `json:"created_at,omitempty"`
|
CreatedAt time.Time `json:"created_at" format:"date-time" binding:"required" readonly:"true"`
|
||||||
|
|
||||||
// LastSeen is the time when the User used happyDNS for the last time (in a 12h frame).
|
// LastSeen is the time when the User used happyDNS for the last time (in a 12h frame).
|
||||||
LastSeen time.Time `json:"last_seen,omitempty"`
|
LastSeen time.Time `json:"last_seen" format:"date-time" binding:"required" readonly:"true"`
|
||||||
|
|
||||||
// Settings holds the settings for an account.
|
// Settings holds the settings for an account.
|
||||||
Settings UserSettings `json:"settings,omitempty"`
|
Settings UserSettings `json:"settings" binding:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *User) GetUserId() Identifier {
|
func (u *User) GetUserId() Identifier {
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ import (
|
||||||
type UserProfile struct {
|
type UserProfile struct {
|
||||||
UserId []byte `json:"userid"`
|
UserId []byte `json:"userid"`
|
||||||
Name string `json:"username"`
|
Name string `json:"username"`
|
||||||
CreatedAt time.Time `json:"created_at"`
|
CreatedAt time.Time `json:"created_at" format:"date-time"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *UserProfile) GetUserId() Identifier {
|
func (u *UserProfile) GetUserId() Identifier {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ package happydns
|
||||||
import ()
|
import ()
|
||||||
|
|
||||||
type VersionResponse struct {
|
type VersionResponse struct {
|
||||||
Version string `json:"version"`
|
Version string `json:"version" binding:"required"`
|
||||||
LastCommit string `json:"last-commit"`
|
LastCommit string `json:"last-commit" binding:"required"`
|
||||||
DirtyBuild bool `json:"dirty-build"`
|
DirtyBuild bool `json:"dirty-build,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,28 +30,28 @@ import (
|
||||||
// ZoneMeta holds the metadata associated to a Zone.
|
// ZoneMeta holds the metadata associated to a Zone.
|
||||||
type ZoneMeta struct {
|
type ZoneMeta struct {
|
||||||
// Id is the Zone's identifier.
|
// Id is the Zone's identifier.
|
||||||
Id Identifier `json:"id" swaggertype:"string"`
|
Id Identifier `json:"id" swaggertype:"string" binding:"required"`
|
||||||
|
|
||||||
// IdAuthor is the User's identifier for the current Zone.
|
// IdAuthor is the User's identifier for the current Zone.
|
||||||
IdAuthor Identifier `json:"id_author" swaggertype:"string"`
|
IdAuthor Identifier `json:"id_author" swaggertype:"string" binding:"required"`
|
||||||
|
|
||||||
// ParentZone identifies the parental zone of this one.
|
// ParentZone identifies the parental zone of this one.
|
||||||
ParentZone *Identifier `json:"parent,omitempty" swaggertype:"string"`
|
ParentZone *Identifier `json:"parent,omitempty" swaggertype:"string"`
|
||||||
|
|
||||||
// DefaultTTL is the TTL to use when no TTL has been defined for a record in this Zone.
|
// DefaultTTL is the TTL to use when no TTL has been defined for a record in this Zone.
|
||||||
DefaultTTL uint32 `json:"default_ttl"`
|
DefaultTTL uint32 `json:"default_ttl" binding:"required"`
|
||||||
|
|
||||||
// LastModified holds the time when the last modification has been made on this Zone.
|
// LastModified holds the time when the last modification has been made on this Zone.
|
||||||
LastModified time.Time `json:"last_modified,omitempty"`
|
LastModified time.Time `json:"last_modified" format:"date-time" binding:"required"`
|
||||||
|
|
||||||
// CommitMsg is a message defined by the User to give a label to this Zone revision.
|
// CommitMsg is a message defined by the User to give a label to this Zone revision.
|
||||||
CommitMsg *string `json:"commit_message,omitempty"`
|
CommitMsg *string `json:"commit_message,omitempty"`
|
||||||
|
|
||||||
// CommitDate is the time when the commit has been made.
|
// CommitDate is the time when the commit has been made.
|
||||||
CommitDate *time.Time `json:"commit_date,omitempty"`
|
CommitDate *time.Time `json:"commit_date,omitempty" format:"date-time"`
|
||||||
|
|
||||||
// Published indicates whether the Zone has already been published or not.
|
// Published indicates whether the Zone has already been published or not.
|
||||||
Published *time.Time `json:"published,omitempty"`
|
Published *time.Time `json:"published,omitempty" format:"date-time"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ZoneMessage is the intermediate struct for parsing zones.
|
// ZoneMessage is the intermediate struct for parsing zones.
|
||||||
|
|
@ -63,7 +63,7 @@ type ZoneMessage struct {
|
||||||
// Zone contains ZoneMeta + map of services by subdomains.
|
// Zone contains ZoneMeta + map of services by subdomains.
|
||||||
type Zone struct {
|
type Zone struct {
|
||||||
ZoneMeta
|
ZoneMeta
|
||||||
Services map[Subdomain][]*Service `json:"services"`
|
Services map[Subdomain][]*Service `json:"services" binding:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// DerivateNew creates a new Zone from the current one, by copying all fields.
|
// DerivateNew creates a new Zone from the current one, by copying all fields.
|
||||||
|
|
@ -169,15 +169,15 @@ type ZoneUsecase interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ApplyZoneForm struct {
|
type ApplyZoneForm struct {
|
||||||
WantedCorrections []Identifier `json:"wantedCorrections"`
|
WantedCorrections []Identifier `json:"wantedCorrections" swaggertype:"array,string"`
|
||||||
CommitMsg string `json:"commitMessage"`
|
CommitMsg string `json:"commitMessage"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PrepareZoneForm struct {
|
type PrepareZoneForm struct {
|
||||||
WantedCorrections []Identifier `json:"wantedCorrections"`
|
WantedCorrections []Identifier `json:"wantedCorrections" swaggertype:"array,string"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PrepareZoneResponse struct {
|
type PrepareZoneResponse struct {
|
||||||
Corrections []*Correction `json:"corrections"`
|
Corrections []*Correction `json:"corrections" binding:"required"`
|
||||||
NbDiffs int `json:"nbDiffs"`
|
NbDiffs int `json:"nbDiffs" binding:"required"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,8 +78,8 @@
|
||||||
body: {
|
body: {
|
||||||
domain: domainName,
|
domain: domainName,
|
||||||
group: group || undefined,
|
group: group || undefined,
|
||||||
id_owner: id_owner || undefined,
|
id_owner: id_owner,
|
||||||
id_provider: id_provider || undefined,
|
id_provider: id_provider,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,8 +59,8 @@
|
||||||
body: {
|
body: {
|
||||||
domain: domain,
|
domain: domain,
|
||||||
group: group || undefined,
|
group: group || undefined,
|
||||||
id_owner: id_owner || undefined,
|
id_owner: id_owner,
|
||||||
id_provider: id_provider || undefined,
|
id_provider: id_provider,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,5 +8,13 @@ export default defineConfig({
|
||||||
name: "@hey-api/client-fetch",
|
name: "@hey-api/client-fetch",
|
||||||
runtimeConfigPath: "$lib/hey-api.ts",
|
runtimeConfigPath: "$lib/hey-api.ts",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "@hey-api/sdk",
|
||||||
|
transformer: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "@hey-api/transformers",
|
||||||
|
dates: true,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
|
||||||
480
web/package-lock.json
generated
480
web/package-lock.json
generated
|
|
@ -8,7 +8,7 @@
|
||||||
"name": "happyDomain",
|
"name": "happyDomain",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hey-api/openapi-ts": "^0.90.6",
|
"@hey-api/openapi-ts": "^0.95.0",
|
||||||
"@sveltestrap/sveltestrap": "^7.0.0",
|
"@sveltestrap/sveltestrap": "^7.0.0",
|
||||||
"bootstrap": "^5.3.0",
|
"bootstrap": "^5.3.0",
|
||||||
"bootstrap-icons": "^1.13.0",
|
"bootstrap-icons": "^1.13.0",
|
||||||
|
|
@ -42,22 +42,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@emnapi/core": {
|
"node_modules/@emnapi/core": {
|
||||||
"version": "1.9.1",
|
"version": "1.9.2",
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.1.tgz",
|
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.2.tgz",
|
||||||
"integrity": "sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==",
|
"integrity": "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@emnapi/wasi-threads": "1.2.0",
|
"@emnapi/wasi-threads": "1.2.1",
|
||||||
"tslib": "^2.4.0"
|
"tslib": "^2.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@emnapi/runtime": {
|
"node_modules/@emnapi/runtime": {
|
||||||
"version": "1.9.1",
|
"version": "1.9.2",
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz",
|
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.2.tgz",
|
||||||
"integrity": "sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==",
|
"integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
|
@ -67,9 +67,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@emnapi/wasi-threads": {
|
"node_modules/@emnapi/wasi-threads": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz",
|
||||||
"integrity": "sha512-N10dEJNSsUx41Z6pZsXU8FjPjpBEplgH24sfkmITrBED1/U2Esum9F3lfLrMjKHHjmi557zQn7kR9R+XWXu5Rg==",
|
"integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
|
|
@ -121,13 +121,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/compat": {
|
"node_modules/@eslint/compat": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-2.0.4.tgz",
|
||||||
"integrity": "sha512-SjIJhGigp8hmd1YGIBwh7Ovri7Kisl42GYFjrOyHhtfYGGoLW6teYi/5p8W50KSsawUPpuLOSmsq1bD0NGQLBw==",
|
"integrity": "sha512-o598tCGstJv9Kk4XapwP+oDij9HD9Qr3V37ABzTfdzVvbFciV+sfg9zSW6olj6G/IXj7p89SwSzPnZ+JUEPIPg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/core": "^1.1.1"
|
"@eslint/core": "^1.2.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^20.19.0 || ^22.13.0 || >=24"
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||||
|
|
@ -142,13 +142,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/config-array": {
|
"node_modules/@eslint/config-array": {
|
||||||
"version": "0.23.3",
|
"version": "0.23.4",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.3.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.4.tgz",
|
||||||
"integrity": "sha512-j+eEWmB6YYLwcNOdlwQ6L2OsptI/LO6lNBuLIqe5R7RetD658HLoF+Mn7LzYmAWWNNzdC6cqP+L6r8ujeYXWLw==",
|
"integrity": "sha512-lf19F24LSMfF8weXvW5QEtnLqW70u7kgit5e9PSx0MsHAFclGd1T9ynvWEMDT1w5J4Qt54tomGeAhdoAku1Xow==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/object-schema": "^3.0.3",
|
"@eslint/object-schema": "^3.0.4",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"minimatch": "^10.2.4"
|
"minimatch": "^10.2.4"
|
||||||
},
|
},
|
||||||
|
|
@ -157,22 +157,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/config-helpers": {
|
"node_modules/@eslint/config-helpers": {
|
||||||
"version": "0.5.3",
|
"version": "0.5.4",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.5.4.tgz",
|
||||||
"integrity": "sha512-lzGN0onllOZCGroKJmRwY6QcEHxbjBw1gwB8SgRSqK8YbbtEXMvKynsXc3553ckIEBxsbMBU7oOZXKIPGZNeZw==",
|
"integrity": "sha512-jJhqiY3wPMlWWO3370M86CPJ7pt8GmEwSLglMfQhjXal07RCvhmU0as4IuUEW5SJeunfItiEetHmSxCCe9lDBg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/core": "^1.1.1"
|
"@eslint/core": "^1.2.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^20.19.0 || ^22.13.0 || >=24"
|
"node": "^20.19.0 || ^22.13.0 || >=24"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/core": {
|
"node_modules/@eslint/core": {
|
||||||
"version": "1.1.1",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.0.tgz",
|
||||||
"integrity": "sha512-QUPblTtE51/7/Zhfv8BDwO0qkkzQL7P/aWWbqcf4xWLEYn1oKjdO0gglQBB4GAsu7u6wjijbCmzsUTy6mnk6oQ==",
|
"integrity": "sha512-8FTGbNzTvmSlc4cZBaShkC6YvFMG0riksYWRFKXztqVdXaQbcZLXlFbSpC05s70sGEsXAw0qwhx69JiW7hQS7A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -204,9 +204,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/object-schema": {
|
"node_modules/@eslint/object-schema": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.4.tgz",
|
||||||
"integrity": "sha512-iM869Pugn9Nsxbh/YHRqYiqd23AmIbxJOcpUMOuWCVNdoQJ5ZtwL6h3t0bcZzJUlC3Dq9jCFCESBZnX0GTv7iQ==",
|
"integrity": "sha512-55lO/7+Yp0ISKRP0PsPtNTeNGapXaO085aELZmWCVc5SH3jfrqpuU6YgOdIxMS99ZHkQN1cXKE+cdIqwww9ptw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -214,13 +214,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/plugin-kit": {
|
"node_modules/@eslint/plugin-kit": {
|
||||||
"version": "0.6.1",
|
"version": "0.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.0.tgz",
|
||||||
"integrity": "sha512-iH1B076HoAshH1mLpHMgwdGeTs0CYwL0SPMkGuSebZrwBp16v415e9NZXg2jtrqPVQjf6IANe2Vtlr5KswtcZQ==",
|
"integrity": "sha512-ejvBr8MQCbVsWNZnCwDXjUKq40MDmHalq7cJ6e9s/qzTUFIIo/afzt1Vui9T97FM/V/pN4YsFVoed5NIa96RDg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint/core": "^1.1.1",
|
"@eslint/core": "^1.2.0",
|
||||||
"levn": "^0.4.1"
|
"levn": "^0.4.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -228,12 +228,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@hey-api/codegen-core": {
|
"node_modules/@hey-api/codegen-core": {
|
||||||
"version": "0.5.5",
|
"version": "0.7.4",
|
||||||
"resolved": "https://registry.npmjs.org/@hey-api/codegen-core/-/codegen-core-0.5.5.tgz",
|
"resolved": "https://registry.npmjs.org/@hey-api/codegen-core/-/codegen-core-0.7.4.tgz",
|
||||||
"integrity": "sha512-f2ZHucnA2wBGAY8ipB4wn/mrEYW+WUxU2huJmUvfDO6AE2vfILSHeF3wCO39Pz4wUYPoAWZByaauftLrOfC12Q==",
|
"integrity": "sha512-DGd9yeSQzflOWO3Y5mt1GRXkXH9O/yIMgbxPjwLI3jwu/3nAjoXXD26lEeFb6tclYlg0JAqTIs5d930G/qxHeA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hey-api/types": "0.1.2",
|
"@hey-api/types": "0.1.4",
|
||||||
"ansi-colors": "4.1.3",
|
"ansi-colors": "4.1.3",
|
||||||
"c12": "3.3.3",
|
"c12": "3.3.3",
|
||||||
"color-support": "1.1.3"
|
"color-support": "1.1.3"
|
||||||
|
|
@ -243,43 +243,40 @@
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/hey-api"
|
"url": "https://github.com/sponsors/hey-api"
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"typescript": ">=5.5.3"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@hey-api/json-schema-ref-parser": {
|
"node_modules/@hey-api/json-schema-ref-parser": {
|
||||||
"version": "1.2.2",
|
"version": "1.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/@hey-api/json-schema-ref-parser/-/json-schema-ref-parser-1.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/@hey-api/json-schema-ref-parser/-/json-schema-ref-parser-1.3.1.tgz",
|
||||||
"integrity": "sha512-oS+5yAdwnK20lSeFO1d53Ku+yaGCsY8PcrmSq2GtSs3bsBfRnHAbpPKSVzQcaxAOrzj5NB+f34WhZglVrNayBA==",
|
"integrity": "sha512-7atnpUkT8TyUPHYPLk91j/GyaqMuwTEHanLOe50Dlx0EEvNuQqFD52Yjg8x4KU0UFL1mWlyhE+sUE/wAtQ1N2A==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jsdevtools/ono": "^7.1.3",
|
"@jsdevtools/ono": "7.1.3",
|
||||||
"@types/json-schema": "^7.0.15",
|
"@types/json-schema": "7.0.15",
|
||||||
"js-yaml": "^4.1.1",
|
"js-yaml": "4.1.1"
|
||||||
"lodash": "^4.17.21"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 16"
|
"node": ">=20.19.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/hey-api"
|
"url": "https://github.com/sponsors/hey-api"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@hey-api/openapi-ts": {
|
"node_modules/@hey-api/openapi-ts": {
|
||||||
"version": "0.90.10",
|
"version": "0.95.0",
|
||||||
"resolved": "https://registry.npmjs.org/@hey-api/openapi-ts/-/openapi-ts-0.90.10.tgz",
|
"resolved": "https://registry.npmjs.org/@hey-api/openapi-ts/-/openapi-ts-0.95.0.tgz",
|
||||||
"integrity": "sha512-o0wlFxuLt1bcyIV/ZH8DQ1wrgODTnUYj/VfCHOOYgXUQlLp9Dm2PjihOz+WYrZLowhqUhSKeJRArOGzvLuOTsg==",
|
"integrity": "sha512-lk5C+WKl5yqEmliQihEyhX/jNcWlAykTSEqkDeKa9xSq5YDAzOFvx7oos8YTqiIzdc4TemtlEaB8Rns7+8A0qg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hey-api/codegen-core": "^0.5.5",
|
"@hey-api/codegen-core": "0.7.4",
|
||||||
"@hey-api/json-schema-ref-parser": "1.2.2",
|
"@hey-api/json-schema-ref-parser": "1.3.1",
|
||||||
"@hey-api/types": "0.1.2",
|
"@hey-api/shared": "0.3.0",
|
||||||
|
"@hey-api/spec-types": "0.1.0",
|
||||||
|
"@hey-api/types": "0.1.4",
|
||||||
"ansi-colors": "4.1.3",
|
"ansi-colors": "4.1.3",
|
||||||
"color-support": "1.1.3",
|
"color-support": "1.1.3",
|
||||||
"commander": "14.0.2",
|
"commander": "14.0.3",
|
||||||
"open": "11.0.0",
|
"get-tsconfig": "4.13.6"
|
||||||
"semver": "7.7.3"
|
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"openapi-ts": "bin/run.js"
|
"openapi-ts": "bin/run.js"
|
||||||
|
|
@ -291,13 +288,47 @@
|
||||||
"url": "https://github.com/sponsors/hey-api"
|
"url": "https://github.com/sponsors/hey-api"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": ">=5.5.3"
|
"typescript": ">=5.5.3 || >=6.0.0 || 6.0.1-rc"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@hey-api/shared": {
|
||||||
|
"version": "0.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@hey-api/shared/-/shared-0.3.0.tgz",
|
||||||
|
"integrity": "sha512-G+4GPojdLEh9bUwRG88teMPM1HdqMm/IsJ38cbnNxhyDu1FkFGwilkA1EqnULCzfTam/ZoZkaLdmAd8xEh4Xsw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@hey-api/codegen-core": "0.7.4",
|
||||||
|
"@hey-api/json-schema-ref-parser": "1.3.1",
|
||||||
|
"@hey-api/spec-types": "0.1.0",
|
||||||
|
"@hey-api/types": "0.1.4",
|
||||||
|
"ansi-colors": "4.1.3",
|
||||||
|
"cross-spawn": "7.0.6",
|
||||||
|
"open": "11.0.0",
|
||||||
|
"semver": "7.7.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20.19.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/hey-api"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@hey-api/spec-types": {
|
||||||
|
"version": "0.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@hey-api/spec-types/-/spec-types-0.1.0.tgz",
|
||||||
|
"integrity": "sha512-StS4RrAO5pyJCBwe6uF9MAuPflkztriW+FPnVb7oEjzDYv1sxPwP+f7fL6u6D+UVrKpZ/9bPNx/xXVdkeWPU6A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@hey-api/types": "0.1.4"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/hey-api"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@hey-api/types": {
|
"node_modules/@hey-api/types": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/@hey-api/types/-/types-0.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/@hey-api/types/-/types-0.1.4.tgz",
|
||||||
"integrity": "sha512-uNNtiVAWL7XNrV/tFXx7GLY9lwaaDazx1173cGW3+UEaw4RUPsHEmiB4DSpcjNxMIcrctfz2sGKLnVx5PBG2RA==",
|
"integrity": "sha512-thWfawrDIP7wSI9ioT13I5soaaqB5vAPIiZmgD8PbeEVKNrkonc0N/Sjj97ezl7oQgusZmaNphGdMKipPO6IBg==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@humanfs/core": {
|
"node_modules/@humanfs/core": {
|
||||||
|
|
@ -555,9 +586,6 @@
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -578,9 +606,6 @@
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm"
|
"arm"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -601,9 +626,6 @@
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -624,9 +646,6 @@
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -647,9 +666,6 @@
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -670,9 +686,6 @@
|
||||||
"cpu": [
|
"cpu": [
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -856,9 +869,6 @@
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -876,9 +886,6 @@
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -896,9 +903,6 @@
|
||||||
"ppc64"
|
"ppc64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -916,9 +920,6 @@
|
||||||
"s390x"
|
"s390x"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -936,9 +937,6 @@
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -956,9 +954,6 @@
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -1070,9 +1065,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sveltejs/kit": {
|
"node_modules/@sveltejs/kit": {
|
||||||
"version": "2.55.0",
|
"version": "2.56.1",
|
||||||
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.55.0.tgz",
|
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.56.1.tgz",
|
||||||
"integrity": "sha512-MdFRjevVxmAknf2NbaUkDF16jSIzXMWd4Nfah0Qp8TtQVoSp3bV4jKt8mX7z7qTUTWvgSaxtR0EG5WJf53gcuA==",
|
"integrity": "sha512-9hDOl3yUh8UXWt+mN29dbcdrW0vNwPvMqi01y2Mw+ceErNIISh8MeEY7fXT2Dx1CjC/kfsVqrbxw7DifYr4hsg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -1099,7 +1094,7 @@
|
||||||
"@opentelemetry/api": "^1.0.0",
|
"@opentelemetry/api": "^1.0.0",
|
||||||
"@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0",
|
"@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0 || ^7.0.0",
|
||||||
"svelte": "^4.0.0 || ^5.0.0-next.0",
|
"svelte": "^4.0.0 || ^5.0.0-next.0",
|
||||||
"typescript": "^5.3.3",
|
"typescript": "^5.3.3 || ^6.0.0",
|
||||||
"vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0 || ^8.0.0"
|
"vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0 || ^8.0.0"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
|
|
@ -1214,9 +1209,9 @@
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "25.5.0",
|
"version": "25.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.2.tgz",
|
||||||
"integrity": "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==",
|
"integrity": "sha512-tO4ZIRKNC+MDWV4qKVZe3Ql/woTnmHDr5JD8UI5hn2pwBrHEwOEMZK7WlNb5RKB6EoJ02gwmQS9OrjuFnZYdpg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -1230,20 +1225,20 @@
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||||
"version": "8.57.2",
|
"version": "8.58.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.57.2.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.58.0.tgz",
|
||||||
"integrity": "sha512-NZZgp0Fm2IkD+La5PR81sd+g+8oS6JwJje+aRWsDocxHkjyRw0J5L5ZTlN3LI1LlOcGL7ph3eaIUmTXMIjLk0w==",
|
"integrity": "sha512-RLkVSiNuUP1C2ROIWfqX+YcUfLaSnxGE/8M+Y57lopVwg9VTYYfhuz15Yf1IzCKgZj6/rIbYTmJCUSqr76r0Wg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/regexpp": "^4.12.2",
|
"@eslint-community/regexpp": "^4.12.2",
|
||||||
"@typescript-eslint/scope-manager": "8.57.2",
|
"@typescript-eslint/scope-manager": "8.58.0",
|
||||||
"@typescript-eslint/type-utils": "8.57.2",
|
"@typescript-eslint/type-utils": "8.58.0",
|
||||||
"@typescript-eslint/utils": "8.57.2",
|
"@typescript-eslint/utils": "8.58.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.57.2",
|
"@typescript-eslint/visitor-keys": "8.58.0",
|
||||||
"ignore": "^7.0.5",
|
"ignore": "^7.0.5",
|
||||||
"natural-compare": "^1.4.0",
|
"natural-compare": "^1.4.0",
|
||||||
"ts-api-utils": "^2.4.0"
|
"ts-api-utils": "^2.5.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
|
@ -1253,9 +1248,9 @@
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@typescript-eslint/parser": "^8.57.2",
|
"@typescript-eslint/parser": "^8.58.0",
|
||||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||||
"typescript": ">=4.8.4 <6.0.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
|
"node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
|
||||||
|
|
@ -1269,16 +1264,16 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser": {
|
"node_modules/@typescript-eslint/parser": {
|
||||||
"version": "8.57.2",
|
"version": "8.58.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.57.2.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.58.0.tgz",
|
||||||
"integrity": "sha512-30ScMRHIAD33JJQkgfGW1t8CURZtjc2JpTrq5n2HFhOefbAhb7ucc7xJwdWcrEtqUIYJ73Nybpsggii6GtAHjA==",
|
"integrity": "sha512-rLoGZIf9afaRBYsPUMtvkDWykwXwUPL60HebR4JgTI8mxfFe2cQTu3AGitANp4b9B2QlVru6WzjgB2IzJKiCSA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/scope-manager": "8.57.2",
|
"@typescript-eslint/scope-manager": "8.58.0",
|
||||||
"@typescript-eslint/types": "8.57.2",
|
"@typescript-eslint/types": "8.58.0",
|
||||||
"@typescript-eslint/typescript-estree": "8.57.2",
|
"@typescript-eslint/typescript-estree": "8.58.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.57.2",
|
"@typescript-eslint/visitor-keys": "8.58.0",
|
||||||
"debug": "^4.4.3"
|
"debug": "^4.4.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -1290,18 +1285,18 @@
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||||
"typescript": ">=4.8.4 <6.0.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/project-service": {
|
"node_modules/@typescript-eslint/project-service": {
|
||||||
"version": "8.57.2",
|
"version": "8.58.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.57.2.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.58.0.tgz",
|
||||||
"integrity": "sha512-FuH0wipFywXRTHf+bTTjNyuNQQsQC3qh/dYzaM4I4W0jrCqjCVuUh99+xd9KamUfmCGPvbO8NDngo/vsnNVqgw==",
|
"integrity": "sha512-8Q/wBPWLQP1j16NxoPNIKpDZFMaxl7yWIoqXWYeWO+Bbd2mjgvoF0dxP2jKZg5+x49rgKdf7Ck473M8PC3V9lg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/tsconfig-utils": "^8.57.2",
|
"@typescript-eslint/tsconfig-utils": "^8.58.0",
|
||||||
"@typescript-eslint/types": "^8.57.2",
|
"@typescript-eslint/types": "^8.58.0",
|
||||||
"debug": "^4.4.3"
|
"debug": "^4.4.3"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -1312,18 +1307,18 @@
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": ">=4.8.4 <6.0.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/scope-manager": {
|
"node_modules/@typescript-eslint/scope-manager": {
|
||||||
"version": "8.57.2",
|
"version": "8.58.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.57.2.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.58.0.tgz",
|
||||||
"integrity": "sha512-snZKH+W4WbWkrBqj4gUNRIGb/jipDW3qMqVJ4C9rzdFc+wLwruxk+2a5D+uoFcKPAqyqEnSb4l2ULuZf95eSkw==",
|
"integrity": "sha512-W1Lur1oF50FxSnNdGp3Vs6P+yBRSmZiw4IIjEeYxd8UQJwhUF0gDgDD/W/Tgmh73mxgEU3qX0Bzdl/NGuSPEpQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.57.2",
|
"@typescript-eslint/types": "8.58.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.57.2"
|
"@typescript-eslint/visitor-keys": "8.58.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
|
@ -1334,9 +1329,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/tsconfig-utils": {
|
"node_modules/@typescript-eslint/tsconfig-utils": {
|
||||||
"version": "8.57.2",
|
"version": "8.58.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.57.2.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.58.0.tgz",
|
||||||
"integrity": "sha512-3Lm5DSM+DCowsUOJC+YqHHnKEfFh5CoGkj5Z31NQSNF4l5wdOwqGn99wmwN/LImhfY3KJnmordBq/4+VDe2eKw==",
|
"integrity": "sha512-doNSZEVJsWEu4htiVC+PR6NpM+pa+a4ClH9INRWOWCUzMst/VA9c4gXq92F8GUD1rwhNvRLkgjfYtFXegXQF7A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -1347,21 +1342,21 @@
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": ">=4.8.4 <6.0.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/type-utils": {
|
"node_modules/@typescript-eslint/type-utils": {
|
||||||
"version": "8.57.2",
|
"version": "8.58.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.57.2.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.58.0.tgz",
|
||||||
"integrity": "sha512-Co6ZCShm6kIbAM/s+oYVpKFfW7LBc6FXoPXjTRQ449PPNBY8U0KZXuevz5IFuuUj2H9ss40atTaf9dlGLzbWZg==",
|
"integrity": "sha512-aGsCQImkDIqMyx1u4PrVlbi/krmDsQUs4zAcCV6M7yPcPev+RqVlndsJy9kJ8TLihW9TZ0kbDAzctpLn5o+lOg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.57.2",
|
"@typescript-eslint/types": "8.58.0",
|
||||||
"@typescript-eslint/typescript-estree": "8.57.2",
|
"@typescript-eslint/typescript-estree": "8.58.0",
|
||||||
"@typescript-eslint/utils": "8.57.2",
|
"@typescript-eslint/utils": "8.58.0",
|
||||||
"debug": "^4.4.3",
|
"debug": "^4.4.3",
|
||||||
"ts-api-utils": "^2.4.0"
|
"ts-api-utils": "^2.5.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
|
@ -1372,13 +1367,13 @@
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||||
"typescript": ">=4.8.4 <6.0.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/types": {
|
"node_modules/@typescript-eslint/types": {
|
||||||
"version": "8.57.2",
|
"version": "8.58.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.57.2.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.58.0.tgz",
|
||||||
"integrity": "sha512-/iZM6FnM4tnx9csuTxspMW4BOSegshwX5oBDznJ7S4WggL7Vczz5d2W11ecc4vRrQMQHXRSxzrCsyG5EsPPTbA==",
|
"integrity": "sha512-O9CjxypDT89fbHxRfETNoAnHj/i6IpRK0CvbVN3qibxlLdo5p5hcLmUuCCrHMpxiWSwKyI8mCP7qRNYuOJ0Uww==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
|
@ -1389,21 +1384,21 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/typescript-estree": {
|
"node_modules/@typescript-eslint/typescript-estree": {
|
||||||
"version": "8.57.2",
|
"version": "8.58.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.57.2.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.58.0.tgz",
|
||||||
"integrity": "sha512-2MKM+I6g8tJxfSmFKOnHv2t8Sk3T6rF20A1Puk0svLK+uVapDZB/4pfAeB7nE83uAZrU6OxW+HmOd5wHVdXwXA==",
|
"integrity": "sha512-7vv5UWbHqew/dvs+D3e1RvLv1v2eeZ9txRHPnEEBUgSNLx5ghdzjHa0sgLWYVKssH+lYmV0JaWdoubo0ncGYLA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/project-service": "8.57.2",
|
"@typescript-eslint/project-service": "8.58.0",
|
||||||
"@typescript-eslint/tsconfig-utils": "8.57.2",
|
"@typescript-eslint/tsconfig-utils": "8.58.0",
|
||||||
"@typescript-eslint/types": "8.57.2",
|
"@typescript-eslint/types": "8.58.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.57.2",
|
"@typescript-eslint/visitor-keys": "8.58.0",
|
||||||
"debug": "^4.4.3",
|
"debug": "^4.4.3",
|
||||||
"minimatch": "^10.2.2",
|
"minimatch": "^10.2.2",
|
||||||
"semver": "^7.7.3",
|
"semver": "^7.7.3",
|
||||||
"tinyglobby": "^0.2.15",
|
"tinyglobby": "^0.2.15",
|
||||||
"ts-api-utils": "^2.4.0"
|
"ts-api-utils": "^2.5.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
|
@ -1413,20 +1408,20 @@
|
||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": ">=4.8.4 <6.0.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/utils": {
|
"node_modules/@typescript-eslint/utils": {
|
||||||
"version": "8.57.2",
|
"version": "8.58.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.57.2.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.58.0.tgz",
|
||||||
"integrity": "sha512-krRIbvPK1ju1WBKIefiX+bngPs+odIQUtR7kymzPfo1POVw3jlF+nLkmexdSSd4UCbDcQn+wMBATOOmpBbqgKg==",
|
"integrity": "sha512-RfeSqcFeHMHlAWzt4TBjWOAtoW9lnsAGiP3GbaX9uVgTYYrMbVnGONEfUCiSss+xMHFl+eHZiipmA8WkQ7FuNA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.9.1",
|
"@eslint-community/eslint-utils": "^4.9.1",
|
||||||
"@typescript-eslint/scope-manager": "8.57.2",
|
"@typescript-eslint/scope-manager": "8.58.0",
|
||||||
"@typescript-eslint/types": "8.57.2",
|
"@typescript-eslint/types": "8.58.0",
|
||||||
"@typescript-eslint/typescript-estree": "8.57.2"
|
"@typescript-eslint/typescript-estree": "8.58.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
|
@ -1437,17 +1432,17 @@
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||||
"typescript": ">=4.8.4 <6.0.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/visitor-keys": {
|
"node_modules/@typescript-eslint/visitor-keys": {
|
||||||
"version": "8.57.2",
|
"version": "8.58.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.57.2.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.58.0.tgz",
|
||||||
"integrity": "sha512-zhahknjobV2FiD6Ee9iLbS7OV9zi10rG26odsQdfBO/hjSzUQbkIYgda+iNKK1zNiW2ey+Lf8MU5btN17V3dUw==",
|
"integrity": "sha512-XJ9UD9+bbDo4a4epraTwG3TsNPeiB9aShrUneAVXy8q4LuwowN+qu89/6ByLMINqvIMeI9H9hOHQtg/ijrYXzQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.57.2",
|
"@typescript-eslint/types": "8.58.0",
|
||||||
"eslint-visitor-keys": "^5.0.0"
|
"eslint-visitor-keys": "^5.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -1807,9 +1802,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/commander": {
|
"node_modules/commander": {
|
||||||
"version": "14.0.2",
|
"version": "14.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
|
||||||
"integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==",
|
"integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
|
|
@ -1851,7 +1846,6 @@
|
||||||
"version": "7.0.6",
|
"version": "7.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"path-key": "^3.1.0",
|
"path-key": "^3.1.0",
|
||||||
|
|
@ -1951,9 +1945,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/defu": {
|
"node_modules/defu": {
|
||||||
"version": "6.1.4",
|
"version": "6.1.6",
|
||||||
"resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/defu/-/defu-6.1.6.tgz",
|
||||||
"integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==",
|
"integrity": "sha512-f8mefEW4WIVg4LckePx3mALjQSPQgFlg9U8yaPdlsbdYcHQyj9n2zL2LJEA52smeYxOvmd/nB7TpMtHGMTHcug==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/destr": {
|
"node_modules/destr": {
|
||||||
|
|
@ -1979,9 +1973,9 @@
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/dotenv": {
|
"node_modules/dotenv": {
|
||||||
"version": "17.3.1",
|
"version": "17.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.4.0.tgz",
|
||||||
"integrity": "sha512-IO8C/dzEb6O3F9/twg6ZLXz164a2fhTnEWb95H23Dm4OuN+92NmEAlTrupP9VW6Jm3sO26tQlqyvyi4CsnY9GA==",
|
"integrity": "sha512-kCKF62fwtzwYm0IGBNjRUjtJgMfGapII+FslMHIjMR5KTnwEmBmWLDRSnc3XSNP8bNy34tekgQyDT0hr7pERRQ==",
|
||||||
"license": "BSD-2-Clause",
|
"license": "BSD-2-Clause",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
|
|
@ -2011,18 +2005,18 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "10.1.0",
|
"version": "10.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-10.2.0.tgz",
|
||||||
"integrity": "sha512-S9jlY/ELKEUwwQnqWDO+f+m6sercqOPSqXM5Go94l7DOmxHVDgmSFGWEzeE/gwgTAr0W103BWt0QLe/7mabIvA==",
|
"integrity": "sha512-+L0vBFYGIpSNIt/KWTpFonPrqYvgKw1eUI5Vn7mEogrQcWtWYtNQ7dNqC+px/J0idT3BAkiWrhfS7k+Tum8TUA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.8.0",
|
"@eslint-community/eslint-utils": "^4.8.0",
|
||||||
"@eslint-community/regexpp": "^4.12.2",
|
"@eslint-community/regexpp": "^4.12.2",
|
||||||
"@eslint/config-array": "^0.23.3",
|
"@eslint/config-array": "^0.23.4",
|
||||||
"@eslint/config-helpers": "^0.5.3",
|
"@eslint/config-helpers": "^0.5.4",
|
||||||
"@eslint/core": "^1.1.1",
|
"@eslint/core": "^1.2.0",
|
||||||
"@eslint/plugin-kit": "^0.6.1",
|
"@eslint/plugin-kit": "^0.7.0",
|
||||||
"@humanfs/node": "^0.16.6",
|
"@humanfs/node": "^0.16.6",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@humanwhocodes/retry": "^0.4.2",
|
"@humanwhocodes/retry": "^0.4.2",
|
||||||
|
|
@ -2083,9 +2077,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-svelte": {
|
"node_modules/eslint-plugin-svelte": {
|
||||||
"version": "3.16.0",
|
"version": "3.17.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-svelte/-/eslint-plugin-svelte-3.16.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-svelte/-/eslint-plugin-svelte-3.17.0.tgz",
|
||||||
"integrity": "sha512-DJXxqpYZUxcE0SfYo8EJzV2ZC+zAD7fJp1n1HwcEMRR1cOEUYvjT9GuzJeNghMjgb7uxuK3IJAzI+x6zzUxO5A==",
|
"integrity": "sha512-sF6wgd5FLS2P8CCaOy2HdYYYEcZ6TwL251dLHUkNmtLnWECk1Dwc+j6VeulmmnFxr7Xs0WNtjweOA+bJ0PnaFw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -2372,6 +2366,18 @@
|
||||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/get-tsconfig": {
|
||||||
|
"version": "4.13.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.6.tgz",
|
||||||
|
"integrity": "sha512-shZT/QMiSHc/YBLxxOkMtgSid5HFoauqCE3/exfsEcwg1WkeqjG+V40yBbBrsD+jW2HDXcs28xOfcbm2jI8Ddw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"resolve-pkg-maps": "^1.0.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/privatenumber/get-tsconfig?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/giget": {
|
"node_modules/giget": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/giget/-/giget-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/giget/-/giget-2.0.0.tgz",
|
||||||
|
|
@ -2552,7 +2558,6 @@
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
|
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
|
||||||
"dev": true,
|
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/jiti": {
|
"node_modules/jiti": {
|
||||||
|
|
@ -2781,9 +2786,6 @@
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -2805,9 +2807,6 @@
|
||||||
"arm64"
|
"arm64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -2829,9 +2828,6 @@
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"glibc"
|
|
||||||
],
|
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -2853,9 +2849,6 @@
|
||||||
"x64"
|
"x64"
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"libc": [
|
|
||||||
"musl"
|
|
||||||
],
|
|
||||||
"license": "MPL-2.0",
|
"license": "MPL-2.0",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"os": [
|
"os": [
|
||||||
|
|
@ -2943,12 +2936,6 @@
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/lodash": {
|
|
||||||
"version": "4.17.23",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz",
|
|
||||||
"integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/magic-string": {
|
"node_modules/magic-string": {
|
||||||
"version": "0.30.21",
|
"version": "0.30.21",
|
||||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
|
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
|
||||||
|
|
@ -2959,13 +2946,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/minimatch": {
|
"node_modules/minimatch": {
|
||||||
"version": "10.2.4",
|
"version": "10.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz",
|
||||||
"integrity": "sha512-oRjTw/97aTBN0RHbYCdtF1MQfvusSIBQM0IZEgzl6426+8jSC0nF1a/GmnVLpfB9yyr6g6FTqWqiZVbxrtaCIg==",
|
"integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BlueOak-1.0.0",
|
"license": "BlueOak-1.0.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"brace-expansion": "^5.0.2"
|
"brace-expansion": "^5.0.5"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "18 || 20 || >=22"
|
"node": "18 || 20 || >=22"
|
||||||
|
|
@ -3064,9 +3051,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/nypm/node_modules/citty": {
|
"node_modules/nypm/node_modules/citty": {
|
||||||
"version": "0.2.1",
|
"version": "0.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/citty/-/citty-0.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/citty/-/citty-0.2.2.tgz",
|
||||||
"integrity": "sha512-kEV95lFBhQgtogAPlQfJJ0WGVSokvLr/UEoFPiKKOXF7pl98HfUVUD0ejsuTCld/9xH9vogSywZ5KqHzXrZpqg==",
|
"integrity": "sha512-+6vJA3L98yv+IdfKGZHBNiGW5KHn22e/JwID0Strsz8h4S/csAu/OuICwxrg44k5MRiZHWIo8XXuJgQTriRP4w==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/obug": {
|
"node_modules/obug": {
|
||||||
|
|
@ -3170,7 +3157,6 @@
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
|
||||||
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
|
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
|
|
@ -3438,6 +3424,15 @@
|
||||||
"url": "https://paulmillr.com/funding/"
|
"url": "https://paulmillr.com/funding/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/resolve-pkg-maps": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/rolldown": {
|
"node_modules/rolldown": {
|
||||||
"version": "1.0.0-rc.12",
|
"version": "1.0.0-rc.12",
|
||||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.12.tgz",
|
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.12.tgz",
|
||||||
|
|
@ -3498,9 +3493,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/sass": {
|
"node_modules/sass": {
|
||||||
"version": "1.98.0",
|
"version": "1.99.0",
|
||||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.98.0.tgz",
|
"resolved": "https://registry.npmjs.org/sass/-/sass-1.99.0.tgz",
|
||||||
"integrity": "sha512-+4N/u9dZ4PrgzGgPlKnaaRQx64RO0JBKs9sDhQ2pLgN6JQZ25uPQZKQYaBJU48Kd5BxgXoJ4e09Dq7nMcOUW3A==",
|
"integrity": "sha512-kgW13M54DUB7IsIRM5LvJkNlpH+WhMpooUcaWGFARkF1Tc82v9mIWkCbCYf+MBvpIUBSeSOTilpZjEPr2VYE6Q==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chokidar": "^4.0.0",
|
"chokidar": "^4.0.0",
|
||||||
|
|
@ -3608,7 +3603,6 @@
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
|
||||||
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"shebang-regex": "^3.0.0"
|
"shebang-regex": "^3.0.0"
|
||||||
|
|
@ -3621,7 +3615,6 @@
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
|
||||||
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
|
|
@ -3700,9 +3693,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/svelte-check": {
|
"node_modules/svelte-check": {
|
||||||
"version": "4.4.5",
|
"version": "4.4.6",
|
||||||
"resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.4.5.tgz",
|
"resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.4.6.tgz",
|
||||||
"integrity": "sha512-1bSwIRCvvmSHrlK52fOlZmVtUZgil43jNL/2H18pRpa+eQjzGt6e3zayxhp1S7GajPFKNM/2PMCG+DZFHlG9fw==",
|
"integrity": "sha512-kP1zG81EWaFe9ZyTv4ZXv44Csi6Pkdpb7S3oj6m+K2ec/IcDg/a8LsFsnVLqm2nxtkSwsd5xPj/qFkTBgXHXjg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
@ -4004,16 +3997,16 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript-eslint": {
|
"node_modules/typescript-eslint": {
|
||||||
"version": "8.57.2",
|
"version": "8.58.0",
|
||||||
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.57.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.58.0.tgz",
|
||||||
"integrity": "sha512-VEPQ0iPgWO/sBaZOU1xo4nuNdODVOajPnTIbog2GKYr31nIlZ0fWPoCQgGfF3ETyBl1vn63F/p50Um9Z4J8O8A==",
|
"integrity": "sha512-e2TQzKfaI85fO+F3QywtX+tCTsu/D3WW5LVU6nz8hTFKFZ8yBJ6mSYRpXqdR3mFjPWmO0eWsTa5f+UpAOe/FMA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "8.57.2",
|
"@typescript-eslint/eslint-plugin": "8.58.0",
|
||||||
"@typescript-eslint/parser": "8.57.2",
|
"@typescript-eslint/parser": "8.58.0",
|
||||||
"@typescript-eslint/typescript-estree": "8.57.2",
|
"@typescript-eslint/typescript-estree": "8.58.0",
|
||||||
"@typescript-eslint/utils": "8.57.2"
|
"@typescript-eslint/utils": "8.58.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
|
|
@ -4024,7 +4017,7 @@
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||||
"typescript": ">=4.8.4 <6.0.0"
|
"typescript": ">=4.8.4 <6.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici-types": {
|
"node_modules/undici-types": {
|
||||||
|
|
@ -4130,9 +4123,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vitefu": {
|
"node_modules/vitefu": {
|
||||||
"version": "1.1.2",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.3.tgz",
|
||||||
"integrity": "sha512-zpKATdUbzbsycPFBN71nS2uzBUQiVnFoOrr2rvqv34S1lcAgMKKkjWleLGeiJlZ8lwCXvtWaRn7R3ZC16SYRuw==",
|
"integrity": "sha512-ub4okH7Z5KLjb6hDyjqrGXqWtWvoYdU3IGm/NorpgHncKoLTCfRIbvlhBm7r0YstIaQRYlp4yEbFqDcKSzXSSg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
|
|
@ -4141,7 +4134,7 @@
|
||||||
"tests/projects/workspace/packages/*"
|
"tests/projects/workspace/packages/*"
|
||||||
],
|
],
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-beta.0"
|
"vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"vite": {
|
"vite": {
|
||||||
|
|
@ -4235,7 +4228,6 @@
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
|
||||||
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"isexe": "^2.0.0"
|
"isexe": "^2.0.0"
|
||||||
|
|
@ -4290,22 +4282,6 @@
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/yaml": {
|
|
||||||
"version": "2.8.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.3.tgz",
|
|
||||||
"integrity": "sha512-AvbaCLOO2Otw/lW5bmh9d/WEdcDFdQp2Z2ZUH3pX9U2ihyUY0nvLv7J6TrWowklRGPYbB/IuIMfYgxaCPg5Bpg==",
|
|
||||||
"extraneous": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"bin": {
|
|
||||||
"yaml": "bin.mjs"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 14.6"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/eemeli"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/yocto-queue": {
|
"node_modules/yocto-queue": {
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@hey-api/openapi-ts": "^0.90.6",
|
"@hey-api/openapi-ts": "^0.95.0",
|
||||||
"@sveltestrap/sveltestrap": "^7.0.0",
|
"@sveltestrap/sveltestrap": "^7.0.0",
|
||||||
"bootstrap": "^5.3.0",
|
"bootstrap": "^5.3.0",
|
||||||
"bootstrap-icons": "^1.13.0",
|
"bootstrap-icons": "^1.13.0",
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import {
|
||||||
deleteDomainsByDomainId,
|
deleteDomainsByDomainId,
|
||||||
getDomainsByDomainIdLogs,
|
getDomainsByDomainIdLogs,
|
||||||
} from "$lib/api-base/sdk.gen";
|
} from "$lib/api-base/sdk.gen";
|
||||||
|
import type { HappydnsDomainUpdateInput } from "$lib/api-base/types.gen";
|
||||||
import type { Domain, DomainLog } from "$lib/model/domain";
|
import type { Domain, DomainLog } from "$lib/model/domain";
|
||||||
import type { Provider } from "$lib/model/provider";
|
import type { Provider } from "$lib/model/provider";
|
||||||
import { unwrapSdkResponse, unwrapEmptyResponse } from "./errors";
|
import { unwrapSdkResponse, unwrapEmptyResponse } from "./errors";
|
||||||
|
|
@ -51,26 +52,18 @@ export async function addDomain(domain: string, provider: Provider | undefined):
|
||||||
body: {
|
body: {
|
||||||
domain,
|
domain,
|
||||||
id_provider,
|
id_provider,
|
||||||
} as any,
|
},
|
||||||
}),
|
}),
|
||||||
) as Domain;
|
) as Domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateDomain(domain: Domain): Promise<Domain> {
|
export async function updateDomain(id: string, body: HappydnsDomainUpdateInput): Promise<Domain> {
|
||||||
if (domain.id) {
|
return unwrapSdkResponse(
|
||||||
return unwrapSdkResponse(
|
await putDomainsByDomainId({
|
||||||
await putDomainsByDomainId({
|
path: { domainId: id },
|
||||||
path: { domainId: domain.id },
|
body,
|
||||||
body: domain as any,
|
}),
|
||||||
}),
|
) as Domain;
|
||||||
) as Domain;
|
|
||||||
} else {
|
|
||||||
return unwrapSdkResponse(
|
|
||||||
await postDomains({
|
|
||||||
body: domain as any,
|
|
||||||
}),
|
|
||||||
) as Domain;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteDomain(id: string): Promise<boolean> {
|
export async function deleteDomain(id: string): Promise<boolean> {
|
||||||
|
|
@ -86,5 +79,5 @@ export async function getDomainLogs(id: string): Promise<Array<DomainLog>> {
|
||||||
await getDomainsByDomainIdLogs({
|
await getDomainsByDomainIdLogs({
|
||||||
path: { domainId: id },
|
path: { domainId: id },
|
||||||
}),
|
}),
|
||||||
) as unknown as Array<DomainLog>;
|
) as Array<DomainLog>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import {
|
||||||
putProvidersByProviderId,
|
putProvidersByProviderId,
|
||||||
deleteProvidersByProviderId,
|
deleteProvidersByProviderId,
|
||||||
} from "$lib/api-base/sdk.gen";
|
} from "$lib/api-base/sdk.gen";
|
||||||
|
import type { HappydnsProviderMinimal } from "$lib/api-base/types.gen";
|
||||||
import type { Provider } from "$lib/model/provider";
|
import type { Provider } from "$lib/model/provider";
|
||||||
import { unwrapSdkResponse, unwrapEmptyResponse } from "./errors";
|
import { unwrapSdkResponse, unwrapEmptyResponse } from "./errors";
|
||||||
|
|
||||||
|
|
@ -51,17 +52,12 @@ export async function listImportableDomains(provider: Provider): Promise<Array<s
|
||||||
) as Array<string>;
|
) as Array<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a domain at the provider.
|
|
||||||
* Note: The old API used POST, but the current OpenAPI spec has GET endpoint.
|
|
||||||
* This might need investigation if it doesn't work as expected.
|
|
||||||
*/
|
|
||||||
export async function createDomain(provider: Provider, fqdn: string): Promise<boolean> {
|
export async function createDomain(provider: Provider, fqdn: string): Promise<boolean> {
|
||||||
return unwrapSdkResponse(
|
return unwrapEmptyResponse(
|
||||||
await getProvidersByProviderIdDomainsByFqdn({
|
await getProvidersByProviderIdDomainsByFqdn({
|
||||||
path: { providerId: provider._id, fqdn } as any,
|
path: { providerId: provider._id, fqdn },
|
||||||
}),
|
}),
|
||||||
) as unknown as boolean;
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateProvider(provider: Provider): Promise<Provider> {
|
export async function updateProvider(provider: Provider): Promise<Provider> {
|
||||||
|
|
@ -69,13 +65,13 @@ export async function updateProvider(provider: Provider): Promise<Provider> {
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await putProvidersByProviderId({
|
await putProvidersByProviderId({
|
||||||
path: { providerId: provider._id },
|
path: { providerId: provider._id },
|
||||||
body: provider as any,
|
body: provider as unknown as HappydnsProviderMinimal,
|
||||||
}),
|
}),
|
||||||
) as Provider;
|
) as Provider;
|
||||||
} else {
|
} else {
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await postProviders({
|
await postProviders({
|
||||||
body: provider as any,
|
body: provider as unknown as HappydnsProviderMinimal,
|
||||||
}),
|
}),
|
||||||
) as Provider;
|
) as Provider;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,33 +20,37 @@
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import { postProvidersSpecsByProviderTypeSettings } from "$lib/api-base/sdk.gen";
|
import { postProvidersSpecsByProviderTypeSettings } from "$lib/api-base/sdk.gen";
|
||||||
import type { Provider } from "$lib/model/provider";
|
import { isProvider, type Provider } from "$lib/model/provider";
|
||||||
import type { ProviderSettingsResponse } from "$lib/model/provider_settings";
|
import type { ProviderSettingsResponse, ProviderSettingsState } from "$lib/model/provider_settings";
|
||||||
import { unwrapSdkResponse } from "./errors";
|
import { unwrapSdkResponse } from "./errors";
|
||||||
|
|
||||||
export async function getProviderSettings(
|
export async function getProviderSettings(
|
||||||
psid: string,
|
psid: string,
|
||||||
state: number,
|
state: number,
|
||||||
settings: any,
|
settings: ProviderSettingsState,
|
||||||
recallid: number | undefined = undefined,
|
recallid: number | undefined = undefined,
|
||||||
): Promise<ProviderSettingsResponse> {
|
): Promise<ProviderSettingsResponse> {
|
||||||
if (!state) state = 0;
|
if (!state) state = 0;
|
||||||
if (!settings) settings = {};
|
if (!settings) settings = { state };
|
||||||
settings.state = state;
|
settings.state = state;
|
||||||
if (recallid) settings.recall = recallid;
|
if (recallid) settings.recall = String(recallid);
|
||||||
|
|
||||||
const data = unwrapSdkResponse(
|
const data = unwrapSdkResponse(
|
||||||
await postProvidersSpecsByProviderTypeSettings({
|
await postProvidersSpecsByProviderTypeSettings({
|
||||||
path: { providerType: psid },
|
path: { providerType: psid },
|
||||||
body: settings as any,
|
body: {
|
||||||
|
_comment: settings._comment,
|
||||||
|
_id: settings._id,
|
||||||
|
state: settings.state,
|
||||||
|
recall: settings.recall,
|
||||||
|
Provider: settings.Provider ? { ...settings.Provider } : undefined,
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
// If the response has _id, it means the provider setup is complete
|
if (isProvider(data)) {
|
||||||
// Throw the Provider object to match old API behavior
|
|
||||||
if ((data as any)._id) {
|
|
||||||
throw data as Provider;
|
throw data as Provider;
|
||||||
} else if ((data as any).form) {
|
} else if ("form" in data) {
|
||||||
return data as ProviderSettingsResponse;
|
return data as ProviderSettingsResponse;
|
||||||
} else {
|
} else {
|
||||||
throw new Error("Not implemented");
|
throw new Error("Not implemented");
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,14 @@
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import { postResolver } from "$lib/api-base/sdk.gen";
|
import { postResolver } from "$lib/api-base/sdk.gen";
|
||||||
|
import type { ControllerDnsMsg } from "$lib/api-base/types.gen";
|
||||||
import type { ResolverForm } from "$lib/model/resolver";
|
import type { ResolverForm } from "$lib/model/resolver";
|
||||||
import { unwrapSdkResponse } from "./errors";
|
import { unwrapSdkResponse } from "./errors";
|
||||||
|
|
||||||
export async function resolve(form: ResolverForm): Promise<any> {
|
export async function resolve(form: ResolverForm): Promise<ControllerDnsMsg> {
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await postResolver({
|
await postResolver({
|
||||||
body: form as any,
|
body: form,
|
||||||
}),
|
}),
|
||||||
);
|
) as ControllerDnsMsg;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import { getDomainsByDomainIdZoneByZoneIdBySubdomainServicesByServiceId } from "$lib/api-base/sdk.gen";
|
import { getDomainsByDomainIdZoneByZoneIdBySubdomainServicesByServiceId } from "$lib/api-base/sdk.gen";
|
||||||
|
import type { HappydnsService } from "$lib/api-base/types.gen";
|
||||||
import type { Domain } from "$lib/model/domain";
|
import type { Domain } from "$lib/model/domain";
|
||||||
import type { ServiceCombined } from "$lib/model/service.svelte";
|
|
||||||
import { unwrapSdkResponse } from "./errors";
|
import { unwrapSdkResponse } from "./errors";
|
||||||
|
|
||||||
export async function getService(
|
export async function getService(
|
||||||
|
|
@ -29,7 +29,7 @@ export async function getService(
|
||||||
zoneid: string,
|
zoneid: string,
|
||||||
subdomain: string,
|
subdomain: string,
|
||||||
svcid: string,
|
svcid: string,
|
||||||
): Promise<ServiceCombined> {
|
): Promise<HappydnsService> {
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await getDomainsByDomainIdZoneByZoneIdBySubdomainServicesByServiceId({
|
await getDomainsByDomainIdZoneByZoneIdBySubdomainServicesByServiceId({
|
||||||
path: {
|
path: {
|
||||||
|
|
@ -39,5 +39,5 @@ export async function getService(
|
||||||
serviceId: svcid,
|
serviceId: svcid,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
) as ServiceCombined;
|
) as HappydnsService;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import {
|
||||||
postServiceSpecsByServiceTypeInit,
|
postServiceSpecsByServiceTypeInit,
|
||||||
postServiceSpecsByServiceTypeRecords,
|
postServiceSpecsByServiceTypeRecords,
|
||||||
} from "$lib/api-base/sdk.gen";
|
} from "$lib/api-base/sdk.gen";
|
||||||
|
import type { HappydnsService } from "$lib/api-base/types.gen";
|
||||||
import type { dnsRR } from "$lib/dns_rr";
|
import type { dnsRR } from "$lib/dns_rr";
|
||||||
import type { ServiceInfos, ServiceSpec } from "$lib/model/service_specs.svelte";
|
import type { ServiceInfos, ServiceSpec } from "$lib/model/service_specs.svelte";
|
||||||
import { unwrapSdkResponse } from "./errors";
|
import { unwrapSdkResponse } from "./errors";
|
||||||
|
|
@ -46,22 +47,20 @@ export async function getServiceSpec(ssid: string): Promise<ServiceSpec> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function initializeService(ssid: string): Promise<any> {
|
export async function initializeService(ssid: string): Promise<Record<string, unknown>> {
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await postServiceSpecsByServiceTypeInit({
|
await postServiceSpecsByServiceTypeInit({
|
||||||
path: { serviceType: ssid },
|
path: { serviceType: ssid },
|
||||||
}),
|
}),
|
||||||
);
|
) as Record<string, unknown>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function generateServiceRecords(ssid: string, value: any, domain?: string): Promise<dnsRR[]> {
|
export async function generateServiceRecords(ssid: string, value: Record<string, unknown>, domain?: string): Promise<dnsRR[]> {
|
||||||
const query: Record<string, string> = {};
|
|
||||||
if (domain) query.domain = domain;
|
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await postServiceSpecsByServiceTypeRecords({
|
await postServiceSpecsByServiceTypeRecords({
|
||||||
path: { serviceType: ssid },
|
path: { serviceType: ssid },
|
||||||
body: value,
|
body: value as HappydnsService,
|
||||||
query: query as any,
|
query: { domain: domain || "" },
|
||||||
})
|
})
|
||||||
) as dnsRR[];
|
) as dnsRR[];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getSessions,
|
getSessions,
|
||||||
getSession as getSdkSession,
|
getSession,
|
||||||
postSessions,
|
postSessions,
|
||||||
putSessionsBySessionId,
|
putSessionsBySessionId,
|
||||||
deleteSessionsBySessionId,
|
deleteSessionsBySessionId,
|
||||||
|
|
@ -34,43 +34,32 @@ export async function listSessions(): Promise<Array<Session>> {
|
||||||
return unwrapSdkResponse(await getSessions()) as Array<Session>;
|
return unwrapSdkResponse(await getSessions()) as Array<Session>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get a specific session by ID.
|
|
||||||
* Note: This endpoint does not exist in the current OpenAPI spec.
|
|
||||||
* This function will throw an error for now.
|
|
||||||
*/
|
|
||||||
export async function getSession(id: string): Promise<Session> {
|
|
||||||
// TODO: This endpoint (GET /sessions/{sessionId}) is not in the OpenAPI spec
|
|
||||||
// For now, we'll have to use a direct fetch or wait for the spec to be updated
|
|
||||||
throw new Error("getSession by ID is not implemented in the current API");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current session.
|
* Get the current session.
|
||||||
* Uses the /session endpoint (singular).
|
* Uses the /session endpoint (singular).
|
||||||
*/
|
*/
|
||||||
export async function getCurrentSession(): Promise<Session> {
|
export async function getCurrentSession(): Promise<Session> {
|
||||||
return unwrapSdkResponse(await getSdkSession()) as Session;
|
return unwrapSdkResponse(await getSession()) as Session;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function addSession(description: string): Promise<Session> {
|
export async function addSession(description: string): Promise<Session> {
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await postSessions({
|
await postSessions({
|
||||||
body: {
|
body: { description },
|
||||||
description,
|
|
||||||
} as any,
|
|
||||||
}),
|
}),
|
||||||
) as Session;
|
) as Session;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateSession(session: Session): Promise<Session> {
|
export async function updateSession(session: Session): Promise<Session> {
|
||||||
if (!session.id) {
|
if (!session.id) {
|
||||||
throw new Error("updateSession requires an existing session id; use addSession to create a new one");
|
throw new Error(
|
||||||
|
"updateSession requires an existing session id; use addSession to create a new one",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await putSessionsBySessionId({
|
await putSessionsBySessionId({
|
||||||
path: { sessionId: session.id },
|
path: { sessionId: session.id },
|
||||||
body: session as any,
|
body: { description: session.description, exp: session.exp },
|
||||||
}),
|
}),
|
||||||
) as Session;
|
) as Session;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ import {
|
||||||
postUsersByUserIdDelete,
|
postUsersByUserIdDelete,
|
||||||
postUsersByUserIdSettings,
|
postUsersByUserIdSettings,
|
||||||
getUsersByUserId,
|
getUsersByUserId,
|
||||||
|
getUsersByUserIdIsAuthUser,
|
||||||
} from "$lib/api-base/sdk.gen";
|
} from "$lib/api-base/sdk.gen";
|
||||||
import { client } from "$lib/api-base/client.gen";
|
|
||||||
import type { UserSettings } from "$lib/model/usersettings";
|
import type { UserSettings } from "$lib/model/usersettings";
|
||||||
import type { User, SignUpForm, LoginForm } from "$lib/model/user";
|
import type { User, SignUpForm, LoginForm } from "$lib/model/user";
|
||||||
import { unwrapSdkResponse, unwrapEmptyResponse } from "./errors";
|
import { unwrapSdkResponse, unwrapEmptyResponse } from "./errors";
|
||||||
|
|
@ -42,7 +42,7 @@ export async function registerUser(form: SignUpForm): Promise<boolean> {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function authUser(form: LoginForm): Promise<User> {
|
export async function authUser(form: LoginForm): Promise<User> {
|
||||||
return unwrapSdkResponse(await postAuth({ body: form })) as unknown as User;
|
return unwrapSdkResponse(await postAuth({ body: form })) as User;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function logout(): Promise<boolean> {
|
export async function logout(): Promise<boolean> {
|
||||||
|
|
@ -150,17 +150,17 @@ export function cleanUserSession(): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function isAuthUser(user: User): Promise<boolean> {
|
export async function isAuthUser(user: User): Promise<boolean> {
|
||||||
const result = await client.get({
|
return unwrapEmptyResponse(
|
||||||
url: "/users/{userId}/is_auth_user",
|
await getUsersByUserIdIsAuthUser({
|
||||||
path: { userId: user.id },
|
path: { userId: user.id },
|
||||||
} as any);
|
}),
|
||||||
return result.response?.status === 204;
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getUser(id: string): Promise<User> {
|
export async function getUser(id: string): Promise<User> {
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await getUsersByUserId({
|
await getUsersByUserId({
|
||||||
path: { userId: id },
|
path: { userId: id },
|
||||||
} as any),
|
}),
|
||||||
) as unknown as User;
|
) as User;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,11 @@ import {
|
||||||
postDomainsByDomainIdZoneByZoneIdRecordsDelete,
|
postDomainsByDomainIdZoneByZoneIdRecordsDelete,
|
||||||
patchDomainsByDomainIdZoneByZoneIdRecords,
|
patchDomainsByDomainIdZoneByZoneIdRecords,
|
||||||
} from "$lib/api-base/sdk.gen";
|
} from "$lib/api-base/sdk.gen";
|
||||||
|
import type { HappydnsService } from "$lib/api-base/types.gen";
|
||||||
import { printRR } from "$lib/dns";
|
import { printRR } from "$lib/dns";
|
||||||
import type { dnsRR } from "$lib/dns_rr";
|
import type { dnsRR } from "$lib/dns_rr";
|
||||||
import type { Correction, FullCorrection } from "$lib/model/correction";
|
import type { Correction, FullCorrection } from "$lib/model/correction";
|
||||||
import type { Domain } from "$lib/model/domain";
|
import type { Domain } from "$lib/model/domain";
|
||||||
import type { ServiceCombined, ServiceMeta } from "$lib/model/service.svelte";
|
|
||||||
import type { Zone, ZoneMeta } from "$lib/model/zone";
|
import type { Zone, ZoneMeta } from "$lib/model/zone";
|
||||||
import { unwrapSdkResponse } from "./errors";
|
import { unwrapSdkResponse } from "./errors";
|
||||||
|
|
||||||
|
|
@ -48,7 +48,7 @@ export async function getZone(domain: Domain, id: string): Promise<Zone> {
|
||||||
await getDomainsByDomainIdZoneByZoneId({
|
await getDomainsByDomainIdZoneByZoneId({
|
||||||
path: { domainId: domain.id, zoneId: id },
|
path: { domainId: domain.id, zoneId: id },
|
||||||
}),
|
}),
|
||||||
) as unknown as Zone;
|
) as Zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function viewZone(domain: Domain, id: string): Promise<string> {
|
export async function viewZone(domain: Domain, id: string): Promise<string> {
|
||||||
|
|
@ -64,7 +64,7 @@ export async function retrieveZone(domain: Domain): Promise<ZoneMeta> {
|
||||||
await postDomainsByDomainIdRetrieveZone({
|
await postDomainsByDomainIdRetrieveZone({
|
||||||
path: { domainId: domain.id },
|
path: { domainId: domain.id },
|
||||||
}),
|
}),
|
||||||
) as unknown as ZoneMeta;
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function applyZone(
|
export async function applyZone(
|
||||||
|
|
@ -76,9 +76,9 @@ export async function applyZone(
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await postDomainsByDomainIdZoneByZoneIdApplyChanges({
|
await postDomainsByDomainIdZoneByZoneIdApplyChanges({
|
||||||
path: { domainId: domain.id, zoneId: id },
|
path: { domainId: domain.id, zoneId: id },
|
||||||
body: { wantedCorrections, commitMessage } as any,
|
body: { wantedCorrections, commitMessage },
|
||||||
}),
|
}),
|
||||||
) as unknown as ZoneMeta;
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function prepareZone(
|
export async function prepareZone(
|
||||||
|
|
@ -89,21 +89,18 @@ export async function prepareZone(
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await postDomainsByDomainIdZoneByZoneIdPrepareChanges({
|
await postDomainsByDomainIdZoneByZoneIdPrepareChanges({
|
||||||
path: { domainId: domain.id, zoneId: id },
|
path: { domainId: domain.id, zoneId: id },
|
||||||
body: { wantedCorrections } as any,
|
body: { wantedCorrections },
|
||||||
}),
|
}),
|
||||||
) as { corrections: Array<FullCorrection>; nbDiffs: number };
|
) as { corrections: Array<FullCorrection>; nbDiffs: number };
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function importZone(domain: Domain, id: string, file: any): Promise<ZoneMeta> {
|
export async function importZone(domain: Domain, file: File | Blob): Promise<ZoneMeta> {
|
||||||
const formData = new FormData();
|
|
||||||
formData.append("zone", file);
|
|
||||||
|
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await postDomainsByDomainIdZone({
|
await postDomainsByDomainIdZone({
|
||||||
path: { domainId: domain.id },
|
path: { domainId: domain.id },
|
||||||
body: formData as any,
|
body: { zone: file },
|
||||||
}),
|
}),
|
||||||
) as unknown as ZoneMeta;
|
) as ZoneMeta;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function diffZone(
|
export async function diffZone(
|
||||||
|
|
@ -133,7 +130,7 @@ export async function diffZoneSummary(
|
||||||
export async function addZoneService(
|
export async function addZoneService(
|
||||||
domain: Domain,
|
domain: Domain,
|
||||||
id: string,
|
id: string,
|
||||||
service: ServiceCombined,
|
service: HappydnsService,
|
||||||
): Promise<Zone> {
|
): Promise<Zone> {
|
||||||
let subdomain = service._domain;
|
let subdomain = service._domain;
|
||||||
if (subdomain === "") subdomain = "@";
|
if (subdomain === "") subdomain = "@";
|
||||||
|
|
@ -141,28 +138,28 @@ export async function addZoneService(
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await postDomainsByDomainIdZoneByZoneIdBySubdomainServices({
|
await postDomainsByDomainIdZoneByZoneIdBySubdomainServices({
|
||||||
path: { domainId: domain.id, zoneId: id, subdomain },
|
path: { domainId: domain.id, zoneId: id, subdomain },
|
||||||
body: service as any,
|
body: service,
|
||||||
}),
|
}),
|
||||||
) as unknown as Zone;
|
) as Zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateZoneService(
|
export async function updateZoneService(
|
||||||
domain: Domain,
|
domain: Domain,
|
||||||
id: string,
|
id: string,
|
||||||
service: ServiceCombined,
|
service: HappydnsService,
|
||||||
): Promise<Zone> {
|
): Promise<Zone> {
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await patchDomainsByDomainIdZoneByZoneId({
|
await patchDomainsByDomainIdZoneByZoneId({
|
||||||
path: { domainId: domain.id, zoneId: id },
|
path: { domainId: domain.id, zoneId: id },
|
||||||
body: service as any,
|
body: service,
|
||||||
}),
|
}),
|
||||||
) as unknown as Zone;
|
) as Zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteZoneService(
|
export async function deleteZoneService(
|
||||||
domain: Domain,
|
domain: Domain,
|
||||||
id: string,
|
id: string,
|
||||||
service: ServiceMeta,
|
service: HappydnsService,
|
||||||
): Promise<Zone> {
|
): Promise<Zone> {
|
||||||
let subdomain = service._domain;
|
let subdomain = service._domain;
|
||||||
if (subdomain === "") subdomain = "@";
|
if (subdomain === "") subdomain = "@";
|
||||||
|
|
@ -173,7 +170,7 @@ export async function deleteZoneService(
|
||||||
await deleteDomainsByDomainIdZoneByZoneIdBySubdomainServicesByServiceId({
|
await deleteDomainsByDomainIdZoneByZoneIdBySubdomainServicesByServiceId({
|
||||||
path: { domainId: domain.id, zoneId: id, subdomain, serviceId: svcid },
|
path: { domainId: domain.id, zoneId: id, subdomain, serviceId: svcid },
|
||||||
}),
|
}),
|
||||||
) as unknown as Zone;
|
) as Zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function addZoneRecord(
|
export async function addZoneRecord(
|
||||||
|
|
@ -185,9 +182,9 @@ export async function addZoneRecord(
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await postDomainsByDomainIdZoneByZoneIdRecords({
|
await postDomainsByDomainIdZoneByZoneIdRecords({
|
||||||
path: { domainId: domain.id, zoneId: id },
|
path: { domainId: domain.id, zoneId: id },
|
||||||
body: [printRR(record, subdomain)] as any,
|
body: [printRR(record, subdomain)],
|
||||||
}),
|
}),
|
||||||
) as unknown as Zone;
|
) as Zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteZoneRecord(
|
export async function deleteZoneRecord(
|
||||||
|
|
@ -199,9 +196,9 @@ export async function deleteZoneRecord(
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await postDomainsByDomainIdZoneByZoneIdRecordsDelete({
|
await postDomainsByDomainIdZoneByZoneIdRecordsDelete({
|
||||||
path: { domainId: domain.id, zoneId: id },
|
path: { domainId: domain.id, zoneId: id },
|
||||||
body: [printRR(record, subdomain)] as any,
|
body: [printRR(record, subdomain)],
|
||||||
}),
|
}),
|
||||||
) as unknown as Zone;
|
) as Zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateZoneRecord(
|
export async function updateZoneRecord(
|
||||||
|
|
@ -214,7 +211,7 @@ export async function updateZoneRecord(
|
||||||
return unwrapSdkResponse(
|
return unwrapSdkResponse(
|
||||||
await patchDomainsByDomainIdZoneByZoneIdRecords({
|
await patchDomainsByDomainIdZoneByZoneIdRecords({
|
||||||
path: { domainId: domain.id, zoneId: id },
|
path: { domainId: domain.id, zoneId: id },
|
||||||
body: { oldrr: printRR(oldrr, subdomain), newrr: printRR(newrr, subdomain) } as any,
|
body: { oldrr: printRR(oldrr, subdomain), newrr: printRR(newrr, subdomain) },
|
||||||
}),
|
}),
|
||||||
) as unknown as Zone;
|
) as Zone;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,10 @@
|
||||||
class?: string;
|
class?: string;
|
||||||
color?: Color | "link" | string;
|
color?: Color | "link" | string;
|
||||||
size?: "sm" | "lg" | string;
|
size?: "sm" | "lg" | string;
|
||||||
title?: string | null;
|
title?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { class: className = "", color = "primary", size = "", title = null }: Props = $props();
|
let { class: className = "", color = "primary", size = "", title }: Props = $props();
|
||||||
|
|
||||||
function getHelpPathFromProvider(ptype: string): string {
|
function getHelpPathFromProvider(ptype: string): string {
|
||||||
if ($providersSpecs && $providersSpecs[ptype]) {
|
if ($providersSpecs && $providersSpecs[ptype]) {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
loading?: import('svelte').Snippet;
|
loading?: import('svelte').Snippet;
|
||||||
empty?: import('svelte').Snippet;
|
empty?: import('svelte').Snippet;
|
||||||
children?: import('svelte').Snippet<[any]>;
|
children?: import('svelte').Snippet<[any]>;
|
||||||
[key: string]: any
|
[key: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
import { toasts } from "$lib/stores/toasts";
|
import { toasts } from "$lib/stores/toasts";
|
||||||
import { t } from "$lib/translations";
|
import { t } from "$lib/translations";
|
||||||
interface Props {
|
interface Props {
|
||||||
[key: string]: any
|
[key: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
let { ...rest }: Props = $props();
|
let { ...rest }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
interface Props {
|
interface Props {
|
||||||
class?: ClassValue;
|
class?: ClassValue;
|
||||||
items: Array<Domain>;
|
items: Array<Domain>;
|
||||||
[key: string]: any;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { class: className, items, ...rest }: Props = $props();
|
let { class: className, items, ...rest }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
service?: any;
|
service?: { [key: string]: any } | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { service = null }: Props = $props();
|
let { service = null }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,9 @@
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
form: CustomForm;
|
form: CustomForm;
|
||||||
value: any;
|
value: Record<string, any> | undefined;
|
||||||
children?: import("svelte").Snippet;
|
children?: import("svelte").Snippet;
|
||||||
[key: string]: any;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { form, value = $bindable(), children, ...rest }: Props = $props();
|
let { form, value = $bindable(), children, ...rest }: Props = $props();
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
index={"" + index}
|
index={"" + index}
|
||||||
specs={field}
|
specs={field}
|
||||||
type={field.type}
|
type={field.type}
|
||||||
bind:value={value[field.id]}
|
bind:value={value![field.id]}
|
||||||
/>
|
/>
|
||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,6 @@
|
||||||
<CustomForm
|
<CustomForm
|
||||||
form={form.form}
|
form={form.form}
|
||||||
bind:value={form.value.Provider}
|
bind:value={form.value.Provider}
|
||||||
on:input={(event) => (form.value.Provider = event.detail)}
|
|
||||||
>
|
>
|
||||||
{#if form.state === 0}
|
{#if form.state === 0}
|
||||||
<ResourceInput
|
<ResourceInput
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
value?: string | null;
|
value?: string | null;
|
||||||
[key: string]: any;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { value = $bindable(null), ...rest }: Props = $props();
|
let { value = $bindable(null), ...rest }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -47,18 +47,18 @@
|
||||||
addingNewDomain?: boolean;
|
addingNewDomain?: boolean;
|
||||||
autofocus?: boolean;
|
autofocus?: boolean;
|
||||||
noButton?: boolean;
|
noButton?: boolean;
|
||||||
preAddFunc?: null | ((arg0: string) => Promise<boolean>);
|
preAddFunc?: (arg0: string) => Promise<boolean>;
|
||||||
provider?: Provider | null;
|
provider?: Provider;
|
||||||
value?: string;
|
value?: string;
|
||||||
[key: string]: any
|
[key: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
addingNewDomain = $bindable(false),
|
addingNewDomain = $bindable(false),
|
||||||
autofocus = false,
|
autofocus = false,
|
||||||
noButton = false,
|
noButton = false,
|
||||||
preAddFunc = null,
|
preAddFunc,
|
||||||
provider = null,
|
provider,
|
||||||
value = $bindable(""),
|
value = $bindable(""),
|
||||||
...rest
|
...rest
|
||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,8 @@
|
||||||
import ObjectInput from "$lib/components/inputs/object.svelte";
|
import ObjectInput from "$lib/components/inputs/object.svelte";
|
||||||
import RawInput from "$lib/components/inputs/raw.svelte";
|
import RawInput from "$lib/components/inputs/raw.svelte";
|
||||||
import TableInput from "$lib/components/inputs/table.svelte";
|
import TableInput from "$lib/components/inputs/table.svelte";
|
||||||
|
import type { Field } from "$lib/model/custom_form.svelte";
|
||||||
|
import type { ServiceInfos } from "$lib/model/service_specs.svelte";
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
|
|
@ -39,7 +41,7 @@
|
||||||
noDecorate?: boolean;
|
noDecorate?: boolean;
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
showDescription?: boolean;
|
showDescription?: boolean;
|
||||||
specs?: any;
|
specs?: Field | ServiceInfos;
|
||||||
type: string;
|
type: string;
|
||||||
value: any;
|
value: any;
|
||||||
}
|
}
|
||||||
|
|
@ -53,7 +55,7 @@
|
||||||
showDescription = true,
|
showDescription = true,
|
||||||
specs = undefined,
|
specs = undefined,
|
||||||
type,
|
type,
|
||||||
value = $bindable()
|
value = $bindable(),
|
||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
|
|
||||||
function sanitizeType(t: string) {
|
function sanitizeType(t: string) {
|
||||||
|
|
@ -63,7 +65,7 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if specs && specs.hide}
|
{#if specs && "hide" in specs && specs.hide}
|
||||||
<!-- hidden input -->
|
<!-- hidden input -->
|
||||||
{:else if type.substring(0, 2) === "[]" && type !== "[]byte" && type !== "[]uint8"}
|
{:else if type.substring(0, 2) === "[]" && type !== "[]byte" && type !== "[]uint8"}
|
||||||
<TableInput
|
<TableInput
|
||||||
|
|
@ -71,7 +73,7 @@
|
||||||
{index}
|
{index}
|
||||||
{noDecorate}
|
{noDecorate}
|
||||||
{readonly}
|
{readonly}
|
||||||
{specs}
|
specs={specs as Field}
|
||||||
type={sanitizeType(type)}
|
type={sanitizeType(type)}
|
||||||
bind:value
|
bind:value
|
||||||
/>
|
/>
|
||||||
|
|
@ -80,7 +82,7 @@
|
||||||
edit={edit || editToolbar}
|
edit={edit || editToolbar}
|
||||||
{index}
|
{index}
|
||||||
{readonly}
|
{readonly}
|
||||||
{specs}
|
specs={specs as Field}
|
||||||
type={sanitizeType(type)}
|
type={sanitizeType(type)}
|
||||||
bind:value
|
bind:value
|
||||||
/>
|
/>
|
||||||
|
|
@ -90,7 +92,7 @@
|
||||||
{editToolbar}
|
{editToolbar}
|
||||||
{index}
|
{index}
|
||||||
{readonly}
|
{readonly}
|
||||||
{specs}
|
specs={specs as ServiceInfos}
|
||||||
type={sanitizeType(type)}
|
type={sanitizeType(type)}
|
||||||
bind:value
|
bind:value
|
||||||
on:delete-this-service={(event) => dispatch("delete-this-service", event.detail)}
|
on:delete-this-service={(event) => dispatch("delete-this-service", event.detail)}
|
||||||
|
|
@ -101,7 +103,7 @@
|
||||||
edit={edit || editToolbar}
|
edit={edit || editToolbar}
|
||||||
{index}
|
{index}
|
||||||
{readonly}
|
{readonly}
|
||||||
{specs}
|
specs={specs as Field}
|
||||||
type={sanitizeType(type)}
|
type={sanitizeType(type)}
|
||||||
bind:value
|
bind:value
|
||||||
/>
|
/>
|
||||||
|
|
@ -111,7 +113,7 @@
|
||||||
{index}
|
{index}
|
||||||
{readonly}
|
{readonly}
|
||||||
{showDescription}
|
{showDescription}
|
||||||
{specs}
|
specs={specs as Field}
|
||||||
type={sanitizeType(type)}
|
type={sanitizeType(type)}
|
||||||
bind:value
|
bind:value
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
specs: Field;
|
specs: Field;
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
value: any;
|
value: any;
|
||||||
[key: string]: any;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
specs: Field;
|
specs: Field;
|
||||||
type: string;
|
type: string;
|
||||||
value: any;
|
value: Record<string, unknown>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
specs: Field;
|
specs: Field;
|
||||||
valuetype: string;
|
valuetype: string;
|
||||||
value: any;
|
value: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
specs: ServiceInfos;
|
specs: ServiceInfos;
|
||||||
type: string;
|
type: string;
|
||||||
value: any;
|
value: Record<string, unknown>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
specs?: Field;
|
specs?: Field;
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
value: any;
|
value: any;
|
||||||
[key: string]: any;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
let inputmax: number | undefined = $derived(computeInputmax(specs));
|
let inputmax: number | undefined = $derived(computeInputmax(specs));
|
||||||
let inputmin: number | undefined = $derived(computeInputmin(specs));
|
let inputmin: number | undefined = $derived(computeInputmin(specs));
|
||||||
|
|
||||||
function computeInputmax(specs: any) {
|
function computeInputmax(specs: Field) {
|
||||||
if (specs.type) {
|
if (specs.type) {
|
||||||
if (specs.type == "int8" || specs.type == "uint8") return 255;
|
if (specs.type == "int8" || specs.type == "uint8") return 255;
|
||||||
else if (specs.type == "int16" || specs.type == "uint16") return 65536;
|
else if (specs.type == "int16" || specs.type == "uint16") return 65536;
|
||||||
|
|
@ -99,7 +99,7 @@
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
function computeInputmin(specs: any) {
|
function computeInputmin(specs: Field) {
|
||||||
if (inputmax) {
|
if (inputmax) {
|
||||||
if (specs.type && specs.type.startsWith("uint")) return 0;
|
if (specs.type && specs.type.startsWith("uint")) return 0;
|
||||||
else return -inputmax - 1;
|
else return -inputmax - 1;
|
||||||
|
|
@ -117,12 +117,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
let feedback: string | undefined = $derived(computeFeedback(value));
|
let feedback: string | undefined = $derived(computeFeedback(value));
|
||||||
function computeFeedback(val: any) {
|
function computeFeedback(val: unknown) {
|
||||||
if (inputmax && val > inputmax) {
|
if (typeof val === "number") {
|
||||||
return t.get("errors.too-high", { max: inputmax });
|
if (inputmax && val > inputmax) {
|
||||||
} else if (inputmin && val < inputmin) {
|
return t.get("errors.too-high", { max: inputmax });
|
||||||
return t.get("errors.too-low", { min: inputmin });
|
} else if (inputmin && val < inputmin) {
|
||||||
} else if (
|
return t.get("errors.too-low", { min: inputmin });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
typeof val === "string" &&
|
||||||
specs.type &&
|
specs.type &&
|
||||||
(specs.type === "[]uint8" || specs.type === "[]byte") &&
|
(specs.type === "[]uint8" || specs.type === "[]byte") &&
|
||||||
!checkBase64(val)
|
!checkBase64(val)
|
||||||
|
|
|
||||||
|
|
@ -34,9 +34,9 @@
|
||||||
index: string;
|
index: string;
|
||||||
noDecorate?: boolean;
|
noDecorate?: boolean;
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
specs: any;
|
specs: Field;
|
||||||
type: string;
|
type: string;
|
||||||
value: any;
|
value: Array<Record<string, any>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
readonly = false,
|
readonly = false,
|
||||||
specs,
|
specs,
|
||||||
type,
|
type,
|
||||||
value = $bindable()
|
value = $bindable(),
|
||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
|
|
||||||
let linespecs: Array<Field> | null | undefined = $state(undefined);
|
let linespecs: Array<Field> | null | undefined = $state(undefined);
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
function addLine() {
|
function addLine() {
|
||||||
if (!value) value = [];
|
if (!value) value = [];
|
||||||
value.push(linespecs ? {} : "");
|
value.push(linespecs ? {} : ("" as any));
|
||||||
value = value;
|
value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { untrack } from 'svelte';
|
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Input,
|
Input,
|
||||||
|
|
@ -46,6 +45,7 @@
|
||||||
import type { Domain } from "$lib/model/domain";
|
import type { Domain } from "$lib/model/domain";
|
||||||
import { groups, domains, newlyGroups, refreshDomains } from "$lib/stores/domains";
|
import { groups, domains, newlyGroups, refreshDomains } from "$lib/stores/domains";
|
||||||
import { t } from "$lib/translations";
|
import { t } from "$lib/translations";
|
||||||
|
import type { HappydnsDomainUpdateInput } from "$lib/api-base";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
isOpen?: boolean;
|
isOpen?: boolean;
|
||||||
|
|
@ -66,15 +66,15 @@
|
||||||
if (newgroup.length && mygroups.indexOf(newgroup) < 0) {
|
if (newgroup.length && mygroups.indexOf(newgroup) < 0) {
|
||||||
mygroups.push(newgroup);
|
mygroups.push(newgroup);
|
||||||
mygroups = mygroups;
|
mygroups = mygroups;
|
||||||
newlyGroups.update((gs) => gs.includes(newgroup) ? gs : [...gs, newgroup]);
|
newlyGroups.update((gs) => (gs.includes(newgroup) ? gs : [...gs, newgroup]));
|
||||||
}
|
}
|
||||||
newgroup = "";
|
newgroup = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
async function changeGroup(event: Event, domain: Domain) {
|
async function changeGroup(event: Event, id: string, domain: HappydnsDomainUpdateInput) {
|
||||||
if (event.currentTarget && event.currentTarget instanceof HTMLSelectElement) {
|
if (event.currentTarget && event.currentTarget instanceof HTMLSelectElement) {
|
||||||
domain.group = event.currentTarget.value;
|
domain.group = event.currentTarget.value;
|
||||||
domain = await updateDomain(domain);
|
await updateDomain(id, domain);
|
||||||
refreshDomains();
|
refreshDomains();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -120,7 +120,7 @@
|
||||||
<Input
|
<Input
|
||||||
type="select"
|
type="select"
|
||||||
value={domain.group}
|
value={domain.group}
|
||||||
on:change={(event) => changeGroup(event, domain)}
|
on:change={(event) => changeGroup(event, domain.id, domain)}
|
||||||
>
|
>
|
||||||
<option value="">{$t("domaingroups.no-group")}</option>
|
<option value="">{$t("domaingroups.no-group")}</option>
|
||||||
{#each mygroups as group}
|
{#each mygroups as group}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
interface Props {
|
interface Props {
|
||||||
toggle: () => void;
|
toggle: () => void;
|
||||||
step: number;
|
step: number;
|
||||||
service?: ServiceCombined | null;
|
service?: ServiceCombined;
|
||||||
form?: string;
|
form?: string;
|
||||||
origin?: Domain | undefined;
|
origin?: Domain | undefined;
|
||||||
update?: boolean;
|
update?: boolean;
|
||||||
|
|
@ -49,7 +49,7 @@
|
||||||
let {
|
let {
|
||||||
toggle,
|
toggle,
|
||||||
step,
|
step,
|
||||||
service = $bindable(null),
|
service = $bindable(),
|
||||||
form = "addSvcForm",
|
form = "addSvcForm",
|
||||||
origin = undefined,
|
origin = undefined,
|
||||||
update = false,
|
update = false,
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
import { filterServices } from "$lib/components/services/service-filter";
|
import { filterServices } from "$lib/components/services/service-filter";
|
||||||
import { fqdn } from "$lib/dns";
|
import { fqdn } from "$lib/dns";
|
||||||
import type { Domain } from "$lib/model/domain";
|
import type { Domain } from "$lib/model/domain";
|
||||||
import type { ServiceCombined } from "$lib/model/service.svelte";
|
import type { HappydnsService } from "$lib/api-base/types.gen";
|
||||||
import { providers_idx } from "$lib/stores/providers";
|
import { providers_idx } from "$lib/stores/providers";
|
||||||
import { servicesSpecsList, servicesSpecsLoaded } from "$lib/stores/services";
|
import { servicesSpecsList, servicesSpecsLoaded } from "$lib/stores/services";
|
||||||
import { filteredName } from "$lib/stores/serviceSelector";
|
import { filteredName } from "$lib/stores/serviceSelector";
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
isOpen?: boolean;
|
isOpen?: boolean;
|
||||||
origin: Domain;
|
origin: Domain;
|
||||||
value?: string | null;
|
value?: string | null;
|
||||||
zservices: Record<string, Array<ServiceCombined>>;
|
zservices: Record<string, Array<HappydnsService>>;
|
||||||
}
|
}
|
||||||
let {
|
let {
|
||||||
isOpen = $bindable(false),
|
isOpen = $bindable(false),
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,8 @@
|
||||||
edit?: boolean;
|
edit?: boolean;
|
||||||
ptype: string;
|
ptype: string;
|
||||||
state: number;
|
state: number;
|
||||||
providerId?: string | null;
|
providerId?: string;
|
||||||
value?: ProviderSettingsState | null;
|
value?: ProviderSettingsState;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
|
@ -52,12 +52,12 @@
|
||||||
edit = false,
|
edit = false,
|
||||||
ptype,
|
ptype,
|
||||||
state: formstate,
|
state: formstate,
|
||||||
providerId = null,
|
providerId,
|
||||||
value = $bindable(null)
|
value = $bindable()
|
||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
|
|
||||||
//
|
//
|
||||||
function createProviderForm(ptype: string, providerId: string | null, value: ProviderSettingsState | null, edit: boolean): ProviderForm {
|
function createProviderForm(ptype: string, providerId: string | undefined, value: ProviderSettingsState | undefined, edit: boolean): ProviderForm {
|
||||||
const pf = new ProviderForm(
|
const pf = new ProviderForm(
|
||||||
ptype,
|
ptype,
|
||||||
() => refreshProviders().then(() => navigate("/?newProvider")),
|
() => refreshProviders().then(() => navigate("/?newProvider")),
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
interface Props {
|
interface Props {
|
||||||
autofocus?: boolean;
|
autofocus?: boolean;
|
||||||
noButton?: boolean;
|
noButton?: boolean;
|
||||||
[key: string]: any;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { autofocus = false, noButton = false, ...rest }: Props = $props();
|
let { autofocus = false, noButton = false, ...rest }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
filteredProvider?: Provider | null;
|
filteredProvider?: Provider | null;
|
||||||
[key: string]: any
|
[key: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
let { filteredProvider = $bindable(null), ...rest }: Props = $props();
|
let { filteredProvider = $bindable(null), ...rest }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
interface Props {
|
interface Props {
|
||||||
provider: Provider;
|
provider: Provider;
|
||||||
noDomainsList?: boolean;
|
noDomainsList?: boolean;
|
||||||
[key: string]: any
|
[key: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
let { provider, noDomainsList = $bindable(false), ...rest }: Props = $props();
|
let { provider, noDomainsList = $bindable(false), ...rest }: Props = $props();
|
||||||
|
|
@ -108,7 +108,7 @@
|
||||||
title: $t("domains.attached-new"),
|
title: $t("domains.attached-new"),
|
||||||
message: $t("domains.added-success", { domain: mydomain.domain }),
|
message: $t("domains.added-success", { domain: mydomain.domain }),
|
||||||
href: "/domains/" + mydomain.domain,
|
href: "/domains/" + mydomain.domain,
|
||||||
color: "success",
|
type: "success",
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
id_provider?: string | undefined;
|
id_provider?: string | undefined;
|
||||||
ptype?: string | undefined;
|
ptype?: string | undefined;
|
||||||
style?: string;
|
style?: string;
|
||||||
[key: string]: any;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,9 @@
|
||||||
noLabel?: boolean;
|
noLabel?: boolean;
|
||||||
noDropdown?: boolean;
|
noDropdown?: boolean;
|
||||||
selectedProvider?: Provider | null;
|
selectedProvider?: Provider | null;
|
||||||
items: Array<any>;
|
items: Array<Provider>;
|
||||||
toolbar?: boolean;
|
toolbar?: boolean;
|
||||||
[key: string]: any;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
|
|
||||||
|
|
@ -34,20 +34,20 @@
|
||||||
interface Props {
|
interface Props {
|
||||||
canDoNext?: boolean;
|
canDoNext?: boolean;
|
||||||
edit?: boolean;
|
edit?: boolean;
|
||||||
form?: CustomForm | null;
|
form?: CustomForm;
|
||||||
nextInProgress?: boolean;
|
nextInProgress?: boolean;
|
||||||
previousInProgress?: boolean;
|
previousInProgress?: boolean;
|
||||||
submitForm?: string | null;
|
submitForm?: string;
|
||||||
[key: string]: any
|
[key: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
canDoNext = true,
|
canDoNext = true,
|
||||||
edit = false,
|
edit = false,
|
||||||
form = null,
|
form,
|
||||||
nextInProgress = false,
|
nextInProgress = false,
|
||||||
previousInProgress = false,
|
previousInProgress = false,
|
||||||
submitForm = null,
|
submitForm,
|
||||||
...rest
|
...rest
|
||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
class?: ClassValue;
|
class?: ClassValue;
|
||||||
items: Array<any>;
|
items: Array<Provider>;
|
||||||
[key: string]: any;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { class: className = "", items, ...rest }: Props = $props();
|
let { class: className = "", items, ...rest }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
import { filteredName } from "$lib/stores/serviceSelector";
|
import { filteredName } from "$lib/stores/serviceSelector";
|
||||||
import { t } from "$lib/translations";
|
import { t } from "$lib/translations";
|
||||||
interface Props {
|
interface Props {
|
||||||
[key: string]: any;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { ...rest }: Props = $props();
|
let { ...rest }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
interface Props {
|
interface Props {
|
||||||
isPropagating?: boolean;
|
isPropagating?: boolean;
|
||||||
localeString?: string;
|
localeString?: string;
|
||||||
propagatedAt?: string | null;
|
propagatedAt?: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
|
@ -39,8 +39,6 @@
|
||||||
localeString = "service.propagation-remaining",
|
localeString = "service.propagation-remaining",
|
||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
|
|
||||||
let _propagatedAt = $derived(propagatedAt ? new Date(propagatedAt) : null);
|
|
||||||
|
|
||||||
let countdown = $state("");
|
let countdown = $state("");
|
||||||
let interval: ReturnType<typeof setInterval>;
|
let interval: ReturnType<typeof setInterval>;
|
||||||
|
|
||||||
|
|
@ -49,15 +47,15 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
if (_propagatedAt) {
|
if (propagatedAt) {
|
||||||
isPropagating = _propagatedAt > new Date();
|
isPropagating = propagatedAt > new Date();
|
||||||
|
|
||||||
if (interval) clearInterval(interval);
|
if (interval) clearInterval(interval);
|
||||||
|
|
||||||
countdown = formatCountdown(_propagatedAt);
|
countdown = formatCountdown(propagatedAt);
|
||||||
interval = setInterval(() => {
|
interval = setInterval(() => {
|
||||||
countdown = formatCountdown(_propagatedAt);
|
countdown = formatCountdown(propagatedAt!);
|
||||||
if (_propagatedAt <= new Date()) {
|
if (propagatedAt! <= new Date()) {
|
||||||
isPropagating = false;
|
isPropagating = false;
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,14 +28,12 @@
|
||||||
import PropagationCountdown from "./PropagationCountdown.svelte";
|
import PropagationCountdown from "./PropagationCountdown.svelte";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
propagatedAt?: string | null;
|
propagatedAt?: Date;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { propagatedAt }: Props = $props();
|
let { propagatedAt }: Props = $props();
|
||||||
|
|
||||||
let _propagatedAt = $derived(propagatedAt ? new Date(propagatedAt) : null);
|
let isPropagating = $derived(propagatedAt && propagatedAt > new Date());
|
||||||
|
|
||||||
let isPropagating = $derived(_propagatedAt && _propagatedAt > new Date());
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if isPropagating}
|
{#if isPropagating}
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
specs: ServiceSpec;
|
specs: ServiceSpec;
|
||||||
value: any;
|
value: Record<string, any>;
|
||||||
aservice: Snippet<[string, any]>;
|
aservice: Snippet<[string, unknown]>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { specs, value = $bindable(), aservice }: Props = $props();
|
let { specs, value = $bindable(), aservice }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
dn: string;
|
dn: string;
|
||||||
origin: Domain;
|
origin: Domain;
|
||||||
type: string;
|
type: string;
|
||||||
value: any;
|
value: Record<string, any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { dn, origin, type, value = $bindable({}) }: Props = $props();
|
let { dn, origin, type, value = $bindable({}) }: Props = $props();
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
const path = `./editors/${filename}`;
|
const path = `./editors/${filename}`;
|
||||||
|
|
||||||
if (editorModules[path]) {
|
if (editorModules[path]) {
|
||||||
const module = await editorModules[path]() as { default: any };
|
const module = await editorModules[path]() as { default: typeof OrphanEditor };
|
||||||
return module.default;
|
return module.default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
export let type: string;
|
export let type: string;
|
||||||
export let value: any;
|
export let value: any;
|
||||||
export let aservice: Snippet<[string, any]>;
|
export let aservice: Snippet<[string, unknown]>;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if type.startsWith("[]")}
|
{#if type.startsWith("[]")}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
import { filterServices } from "./service-filter";
|
import { filterServices } from "./service-filter";
|
||||||
import type { Domain } from "$lib/model/domain";
|
import type { Domain } from "$lib/model/domain";
|
||||||
import type { ProviderInfos } from "$lib/model/provider";
|
import type { ProviderInfos } from "$lib/model/provider";
|
||||||
import type { ServiceCombined } from "$lib/model/service.svelte";
|
import type { HappydnsService } from "$lib/api-base/types.gen";
|
||||||
import { providers_idx } from "$lib/stores/providers";
|
import { providers_idx } from "$lib/stores/providers";
|
||||||
import { servicesSpecsList, servicesSpecsLoaded } from "$lib/stores/services";
|
import { servicesSpecsList, servicesSpecsLoaded } from "$lib/stores/services";
|
||||||
import { filteredName } from "$lib/stores/serviceSelector";
|
import { filteredName } from "$lib/stores/serviceSelector";
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
dn: string;
|
dn: string;
|
||||||
origin: Domain;
|
origin: Domain;
|
||||||
value?: string | null;
|
value?: string | null;
|
||||||
zservices: Record<string, Array<ServiceCombined>>;
|
zservices: Record<string, Array<HappydnsService>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { dn, origin, value = $bindable(null), zservices }: Props = $props();
|
let { dn, origin, value = $bindable(null), zservices }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@
|
||||||
interface Props {
|
interface Props {
|
||||||
dn: string;
|
dn: string;
|
||||||
origin: Domain;
|
origin: Domain;
|
||||||
value: any;
|
value: Record<string, any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { dn, origin, value = $bindable({}) }: Props = $props();
|
let { dn, origin, value = $bindable({}) }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
interface Props {
|
interface Props {
|
||||||
dn: string;
|
dn: string;
|
||||||
origin: Domain;
|
origin: Domain;
|
||||||
value: any;
|
value: Record<string, any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { dn, origin, value = $bindable({}) }: Props = $props();
|
let { dn, origin, value = $bindable({}) }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
dn: string;
|
dn: string;
|
||||||
origin: Domain;
|
origin: Domain;
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
value: dnsResource;
|
value: Record<string, any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
let { dn, origin, readonly = false, value = $bindable({}) }: Props = $props();
|
let { dn, origin, readonly = false, value = $bindable({}) }: Props = $props();
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
f: fields.slice(1),
|
f: fields.slice(1),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
function stringifySPF(val: any) {
|
function stringifySPF(val: { v?: string; f: string[] }) {
|
||||||
return "v=" + (val["v"] ? val["v"] : "spf1") + " " + val.f.join(" ");
|
return "v=" + (val["v"] ? val["v"] : "spf1") + " " + val.f.join(" ");
|
||||||
}
|
}
|
||||||
let val = $state(parseSPF(value["txt"]?.Txt || "v=spf1 -all"));
|
let val = $state(parseSPF(value["txt"]?.Txt || "v=spf1 -all"));
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { nsrrtype } from "$lib/dns";
|
import { nsrrtype } from "$lib/dns";
|
||||||
import type { ServiceCombined } from "$lib/model/service.svelte";
|
import type { HappydnsService } from "$lib/api-base/types.gen";
|
||||||
import { passRestrictions, type ServiceInfos } from "$lib/model/service_specs.svelte";
|
import { passRestrictions, type ServiceInfos } from "$lib/model/service_specs.svelte";
|
||||||
import type { ProviderInfos } from "$lib/model/provider";
|
import type { ProviderInfos } from "$lib/model/provider";
|
||||||
|
|
||||||
|
|
@ -11,7 +11,7 @@ export interface FilteredServices {
|
||||||
export function filterServices(
|
export function filterServices(
|
||||||
servicesList: ServiceInfos[],
|
servicesList: ServiceInfos[],
|
||||||
providerSpecs: ProviderInfos,
|
providerSpecs: ProviderInfos,
|
||||||
zservices: Record<string, Array<ServiceCombined>>,
|
zservices: Record<string, Array<HappydnsService>>,
|
||||||
dn: string,
|
dn: string,
|
||||||
filteredName: string,
|
filteredName: string,
|
||||||
filteredFamily: string | null = null
|
filteredFamily: string | null = null
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@
|
||||||
});
|
});
|
||||||
dispatchSelectionSummary();
|
dispatchSelectionSummary();
|
||||||
},
|
},
|
||||||
(err: any) => {
|
(err: unknown) => {
|
||||||
dispatch("error", err);
|
dispatch("error", err);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createEventDispatcher } from "svelte";
|
import { createEventDispatcher, type Snippet } from "svelte";
|
||||||
|
|
||||||
import { Badge } from "@sveltestrap/sveltestrap";
|
import { Badge } from "@sveltestrap/sveltestrap";
|
||||||
import { ListGroup } from "@sveltestrap/sveltestrap";
|
import { ListGroup } from "@sveltestrap/sveltestrap";
|
||||||
|
|
@ -47,9 +47,9 @@
|
||||||
display_by_groups?: boolean;
|
display_by_groups?: boolean;
|
||||||
show_empty_groups?: boolean;
|
show_empty_groups?: boolean;
|
||||||
domains?: Array<ZoneListDomain>;
|
domains?: Array<ZoneListDomain>;
|
||||||
no_domain?: import("svelte").Snippet;
|
no_domain?: Snippet;
|
||||||
badges?: import("svelte").Snippet<[any]>;
|
badges?: Snippet<[{ domain: ZoneListDomain }]>;
|
||||||
[key: string]: any;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
let {
|
let {
|
||||||
|
|
@ -63,7 +63,12 @@
|
||||||
...rest
|
...rest
|
||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
|
|
||||||
function genGroups(domains: Array<ZoneListDomain>, display_by_groups: boolean, show_empty_groups: boolean, extraGroups: Array<string>) {
|
function genGroups(
|
||||||
|
domains: Array<ZoneListDomain>,
|
||||||
|
display_by_groups: boolean,
|
||||||
|
show_empty_groups: boolean,
|
||||||
|
extraGroups: Array<string>,
|
||||||
|
) {
|
||||||
if (!display_by_groups) {
|
if (!display_by_groups) {
|
||||||
return { "": domains };
|
return { "": domains };
|
||||||
}
|
}
|
||||||
|
|
@ -86,10 +91,7 @@
|
||||||
return groups;
|
return groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
let localDomains: Array<ZoneListDomain> = $state([...domains]);
|
let localDomains: Array<ZoneListDomain> = $derived([...domains]);
|
||||||
$effect(() => {
|
|
||||||
localDomains = [...domains];
|
|
||||||
});
|
|
||||||
|
|
||||||
let groups: Record<string, Array<ZoneListDomain>> = $derived(
|
let groups: Record<string, Array<ZoneListDomain>> = $derived(
|
||||||
genGroups(localDomains, display_by_groups, show_empty_groups, $newlyGroups),
|
genGroups(localDomains, display_by_groups, show_empty_groups, $newlyGroups),
|
||||||
|
|
@ -116,7 +118,7 @@
|
||||||
|
|
||||||
fullDomain.group = targetGroup;
|
fullDomain.group = targetGroup;
|
||||||
try {
|
try {
|
||||||
await updateDomain(fullDomain);
|
await updateDomain(fullDomain.id, { group: targetGroup });
|
||||||
refreshDomains();
|
refreshDomains();
|
||||||
} catch {
|
} catch {
|
||||||
// Revert on error
|
// Revert on error
|
||||||
|
|
@ -150,14 +152,15 @@
|
||||||
{@render no_domain?.()}
|
{@render no_domain?.()}
|
||||||
{:else}
|
{:else}
|
||||||
{#each Object.keys(groups).sort((a, b) => {
|
{#each Object.keys(groups).sort((a, b) => {
|
||||||
const aEmpty = groups[a].length === 0;
|
const aEmpty = groups[a].length === 0;
|
||||||
const bEmpty = groups[b].length === 0;
|
const bEmpty = groups[b].length === 0;
|
||||||
if (aEmpty !== bEmpty) return aEmpty ? 1 : -1;
|
if (aEmpty !== bEmpty) return aEmpty ? 1 : -1;
|
||||||
if (!a || !b) return !a ? 1 : -1;
|
if (!a || !b) return !a ? 1 : -1;
|
||||||
return a.toLowerCase().localeCompare(b.toLowerCase());
|
return a.toLowerCase().localeCompare(b.toLowerCase());
|
||||||
}) as gname}
|
}) as gname}
|
||||||
{@const gdomains = groups[gname]}
|
{@const gdomains = groups[gname]}
|
||||||
<div
|
<div
|
||||||
|
role="list"
|
||||||
class:mb-2={Object.keys(groups).length != 1}
|
class:mb-2={Object.keys(groups).length != 1}
|
||||||
class:drag-over={display_by_groups && dragOverGroup === gname}
|
class:drag-over={display_by_groups && dragOverGroup === gname}
|
||||||
ondragover={display_by_groups
|
ondragover={display_by_groups
|
||||||
|
|
@ -253,9 +256,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.draggable-item {
|
|
||||||
cursor: grab;
|
|
||||||
}
|
|
||||||
.drag-over {
|
.drag-over {
|
||||||
background-color: var(--bs-primary-bg-subtle, #cfe2ff);
|
background-color: var(--bs-primary-bg-subtle, #cfe2ff);
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
|
|
|
||||||
|
|
@ -502,7 +502,7 @@ function collectFieldRRs(type: string, value: any, rrs: dnsRR[]) {
|
||||||
type === "happydns.TXT" ||
|
type === "happydns.TXT" ||
|
||||||
type === "happydns.SPF"
|
type === "happydns.SPF"
|
||||||
) {
|
) {
|
||||||
rrs.push(value);
|
rrs.push(value as dnsRR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -517,7 +517,7 @@ function collectFieldRRs(type: string, value: any, rrs: dnsRR[]) {
|
||||||
* @param value - The service instance value (ServiceCombined.Service).
|
* @param value - The service instance value (ServiceCombined.Service).
|
||||||
* @returns An array of dnsRR objects contained in the service.
|
* @returns An array of dnsRR objects contained in the service.
|
||||||
*/
|
*/
|
||||||
export function collectRRs(fields: Array<{ type: string; id: string }> | null, value: any): dnsRR[] {
|
export function collectRRs(fields: Array<{ type: string; id: string }> | null, value: Record<string, unknown> | null | undefined): dnsRR[] {
|
||||||
if (!fields || !value) return [];
|
if (!fields || !value) return [];
|
||||||
const rrs: dnsRR[] = [];
|
const rrs: dnsRR[] = [];
|
||||||
for (const field of fields) {
|
for (const field of fields) {
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,8 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
export interface Correction {
|
import type { HappydnsCorrection } from "$lib/api-base/types.gen";
|
||||||
id?: string;
|
|
||||||
msg: string;
|
|
||||||
kind?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface FullCorrection {
|
export type Correction = Omit<HappydnsCorrection, 'kind'> & { kind?: number };
|
||||||
id: string;
|
|
||||||
msg: string;
|
export type FullCorrection = Required<Omit<HappydnsCorrection, 'kind'>> & { kind: number };
|
||||||
kind: number;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ export class CustomForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FormState {
|
export class FormState {
|
||||||
_id? = $state<any>();
|
_id? = $state<string>();
|
||||||
_comment? = $state<string>();
|
_comment? = $state<string>();
|
||||||
state = $state<number>(0);
|
state = $state<number>(0);
|
||||||
recall? = $state<string>();
|
recall? = $state<string>();
|
||||||
|
|
|
||||||
|
|
@ -19,15 +19,10 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
export interface ZoneHistory {
|
import type { HappydnsDomainLog, HappydnsDomainWithZoneMetadata, HappydnsZoneMeta } from "$lib/api-base/types.gen";
|
||||||
id: string;
|
|
||||||
id_author: string;
|
export type ZoneHistory = Omit<HappydnsZoneMeta, 'commit_message' | 'commit_date' | 'parent'>
|
||||||
default_ttl: number;
|
& { commit_message: string; commit_date: Date };
|
||||||
last_modified: Date;
|
|
||||||
commit_message: string;
|
|
||||||
commit_date: Date;
|
|
||||||
published?: Date;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface MiniDomain {
|
export interface MiniDomain {
|
||||||
id_provider: string;
|
id_provider: string;
|
||||||
|
|
@ -37,18 +32,10 @@ export interface MiniDomain {
|
||||||
wait?: boolean;
|
wait?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Domain extends MiniDomain {
|
export interface Domain extends Omit<HappydnsDomainWithZoneMetadata, 'zone_meta' | 'group'> {
|
||||||
id: string;
|
|
||||||
id_owner: string;
|
|
||||||
group: string;
|
group: string;
|
||||||
zone_history: Array<string>;
|
wait?: boolean;
|
||||||
zone_meta?: Record<string, ZoneHistory>;
|
zone_meta?: Record<string, ZoneHistory>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DomainLog {
|
export type DomainLog = HappydnsDomainLog;
|
||||||
id: string;
|
|
||||||
id_user: string;
|
|
||||||
date: Date;
|
|
||||||
content: string;
|
|
||||||
level: number;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,9 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
export interface ProviderInfos {
|
import type { HappydnsProviderInfos, HappydnsProviderMeta } from "$lib/api-base/types.gen";
|
||||||
name: string;
|
|
||||||
description: string;
|
export type ProviderInfos = Required<HappydnsProviderInfos>;
|
||||||
capabilities: Array<string>;
|
|
||||||
helplink: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getAvailableResourceTypes(pi: ProviderInfos): Array<number> {
|
export function getAvailableResourceTypes(pi: ProviderInfos): Array<number> {
|
||||||
const availableResourceTypes = [];
|
const availableResourceTypes = [];
|
||||||
|
|
@ -40,19 +37,12 @@ export function getAvailableResourceTypes(pi: ProviderInfos): Array<number> {
|
||||||
|
|
||||||
export type ProviderList = Record<string, ProviderInfos>;
|
export type ProviderList = Record<string, ProviderInfos>;
|
||||||
|
|
||||||
export interface ProviderMeta {
|
export interface ProviderMeta extends Omit<HappydnsProviderMeta, '_comment'> {
|
||||||
_srctype: string;
|
|
||||||
_id: string;
|
|
||||||
_ownerid: string;
|
|
||||||
_comment: string;
|
_comment: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProviderData extends ProviderMeta {
|
|
||||||
Provider: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Provider extends ProviderMeta {
|
export interface Provider extends ProviderMeta {
|
||||||
Provider: any;
|
Provider: Record<string, unknown>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isProvider(e: unknown): e is Provider {
|
export function isProvider(e: unknown): e is Provider {
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,7 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
export interface ResolverForm {
|
import type { HappydnsResolverRequest } from "$lib/api-base/types.gen";
|
||||||
domain: string;
|
|
||||||
type: string;
|
export type ResolverForm = Required<Pick<HappydnsResolverRequest, 'domain' | 'type' | 'resolver'>>
|
||||||
resolver: string;
|
& Pick<HappydnsResolverRequest, 'custom'>;
|
||||||
custom?: string;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -19,17 +19,28 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import type { HappydnsService } from "$lib/api-base/types.gen";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Narrows the generated HappydnsService.Service from `unknown` to its
|
||||||
|
* actual runtime shape so callers can bind and index into it safely.
|
||||||
|
*/
|
||||||
|
export interface ServiceWithValue extends HappydnsService {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- dynamic service value from Go backend
|
||||||
|
Service: Record<string, any>;
|
||||||
|
}
|
||||||
|
|
||||||
export class ServiceMeta {
|
export class ServiceMeta {
|
||||||
_svctype = $state<string>('');
|
_svctype = $state<string>("");
|
||||||
_id? = $state<string | undefined>(undefined);
|
_id? = $state<string | undefined>(undefined);
|
||||||
_ownerid? = $state<string | undefined>(undefined);
|
_ownerid? = $state<string | undefined>(undefined);
|
||||||
_domain = $state<string>('');
|
_domain = $state<string>("");
|
||||||
_ttl? = $state<number | undefined>(undefined);
|
_ttl = $state<number>(0);
|
||||||
_comment? = $state<string | undefined>(undefined);
|
_comment? = $state<string | undefined>(undefined);
|
||||||
_mycomment? = $state<string | undefined>(undefined);
|
_mycomment? = $state<string | undefined>(undefined);
|
||||||
_aliases? = $state<Array<string> | undefined>(undefined);
|
_aliases? = $state<Array<string> | undefined>(undefined);
|
||||||
_tmp_hint_nb? = $state<number | undefined>(undefined);
|
_tmp_hint_nb = $state<number>(0);
|
||||||
_propagated_at? = $state<string | undefined>(undefined);
|
_propagated_at? = $state<Date | undefined>(undefined);
|
||||||
|
|
||||||
constructor(init?: {
|
constructor(init?: {
|
||||||
_svctype: string;
|
_svctype: string;
|
||||||
|
|
@ -41,7 +52,7 @@ export class ServiceMeta {
|
||||||
_mycomment?: string;
|
_mycomment?: string;
|
||||||
_aliases?: Array<string>;
|
_aliases?: Array<string>;
|
||||||
_tmp_hint_nb?: number;
|
_tmp_hint_nb?: number;
|
||||||
_propagated_at?: string;
|
_propagated_at?: Date;
|
||||||
}) {
|
}) {
|
||||||
if (init) {
|
if (init) {
|
||||||
this._svctype = init._svctype;
|
this._svctype = init._svctype;
|
||||||
|
|
@ -74,7 +85,7 @@ export class ServiceMeta {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class ServiceCombined extends ServiceMeta {
|
export class ServiceCombined extends ServiceMeta {
|
||||||
Service = $state<any>(null);
|
Service = $state<Record<string, any>>({});
|
||||||
|
|
||||||
constructor(init?: {
|
constructor(init?: {
|
||||||
_svctype: string;
|
_svctype: string;
|
||||||
|
|
@ -86,8 +97,8 @@ export class ServiceCombined extends ServiceMeta {
|
||||||
_mycomment?: string;
|
_mycomment?: string;
|
||||||
_aliases?: Array<string>;
|
_aliases?: Array<string>;
|
||||||
_tmp_hint_nb?: number;
|
_tmp_hint_nb?: number;
|
||||||
_propagated_at?: string;
|
_propagated_at?: Date;
|
||||||
Service?: any;
|
Service?: Record<string, any>;
|
||||||
}) {
|
}) {
|
||||||
super(init);
|
super(init);
|
||||||
if (init?.Service !== undefined) {
|
if (init?.Service !== undefined) {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import { get } from "svelte/store";
|
||||||
import { getRrtype, newRR } from "$lib/dns_rr";
|
import { getRrtype, newRR } from "$lib/dns_rr";
|
||||||
import type { Field } from "$lib/model/custom_form.svelte";
|
import type { Field } from "$lib/model/custom_form.svelte";
|
||||||
import { getAvailableResourceTypes, type ProviderInfos } from "$lib/model/provider";
|
import { getAvailableResourceTypes, type ProviderInfos } from "$lib/model/provider";
|
||||||
import type { ServiceCombined } from "$lib/model/service.svelte";
|
import type { HappydnsService } from "$lib/api-base/types.gen";
|
||||||
import { servicesSpecs, servicesSpecsLoaded } from "$lib/stores/services";
|
import { servicesSpecs, servicesSpecsLoaded } from "$lib/stores/services";
|
||||||
|
|
||||||
export const SERVICE_FAMILY_ABSTRACT = "abstract";
|
export const SERVICE_FAMILY_ABSTRACT = "abstract";
|
||||||
|
|
@ -94,7 +94,7 @@ export class ServiceSpec {
|
||||||
export function passRestrictions(
|
export function passRestrictions(
|
||||||
svcinfo: ServiceInfos,
|
svcinfo: ServiceInfos,
|
||||||
provider_specs: ProviderInfos,
|
provider_specs: ProviderInfos,
|
||||||
zservices: Record<string, Array<ServiceCombined>>,
|
zservices: Record<string, Array<HappydnsService>>,
|
||||||
dn: string,
|
dn: string,
|
||||||
): null | string {
|
): null | string {
|
||||||
if (svcinfo.restrictions) {
|
if (svcinfo.restrictions) {
|
||||||
|
|
|
||||||
|
|
@ -19,15 +19,6 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
export interface Session {
|
import type { HappydnsSession } from "$lib/api-base/types.gen";
|
||||||
id: string;
|
|
||||||
login: string;
|
|
||||||
description: string;
|
|
||||||
time: Date;
|
|
||||||
exp: Date;
|
|
||||||
upd: Date;
|
|
||||||
content: string;
|
|
||||||
|
|
||||||
// Used by the interface
|
export type Session = Omit<HappydnsSession, 'content'> & { content: string };
|
||||||
delete_in_progress: boolean;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,13 @@
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import type { Color } from "@sveltestrap/sveltestrap";
|
import type { Color } from "@sveltestrap/sveltestrap";
|
||||||
|
import { navigate } from "$lib/stores/config";
|
||||||
|
|
||||||
export interface NewToast {
|
export interface NewToast {
|
||||||
type?: "info" | "success" | "warning" | "error";
|
type?: "info" | "success" | "warning" | "error";
|
||||||
title?: string;
|
title?: string;
|
||||||
message?: string;
|
message?: string;
|
||||||
|
href?: string;
|
||||||
timeout?: number | undefined;
|
timeout?: number | undefined;
|
||||||
onclick?: () => void;
|
onclick?: () => void;
|
||||||
}
|
}
|
||||||
|
|
@ -46,6 +48,16 @@ export class Toast implements NewToast {
|
||||||
if (obj.title !== undefined) this.title = obj.title;
|
if (obj.title !== undefined) this.title = obj.title;
|
||||||
if (obj.message !== undefined) this.message = obj.message;
|
if (obj.message !== undefined) this.message = obj.message;
|
||||||
if (obj.onclick !== undefined) this.onclick = obj.onclick;
|
if (obj.onclick !== undefined) this.onclick = obj.onclick;
|
||||||
|
if (obj.href !== undefined && this.onclick === undefined) {
|
||||||
|
const href = obj.href;
|
||||||
|
this.onclick = () => {
|
||||||
|
if (href.startsWith('/')) {
|
||||||
|
navigate(href);
|
||||||
|
} else {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
this.timeout = obj.timeout;
|
this.timeout = obj.timeout;
|
||||||
|
|
||||||
this.dismissFunc = dismiss;
|
this.dismissFunc = dismiss;
|
||||||
|
|
@ -61,7 +73,9 @@ export class Toast implements NewToast {
|
||||||
if (this.timeoutInterval === undefined) return;
|
if (this.timeoutInterval === undefined) return;
|
||||||
clearTimeout(this.timeoutInterval);
|
clearTimeout(this.timeoutInterval);
|
||||||
this.timeoutInterval = undefined;
|
this.timeoutInterval = undefined;
|
||||||
this.remainingTime = (this.remainingTime ?? this.timeout ?? 0) - (Date.now() - (this.startTime ?? Date.now()));
|
this.remainingTime =
|
||||||
|
(this.remainingTime ?? this.timeout ?? 0) -
|
||||||
|
(Date.now() - (this.startTime ?? Date.now()));
|
||||||
}
|
}
|
||||||
|
|
||||||
resume() {
|
resume() {
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
import type { HappydnsUser } from "$lib/api-base/types.gen";
|
||||||
import type { UserSettings } from "./usersettings";
|
import type { UserSettings } from "./usersettings";
|
||||||
|
|
||||||
export interface SignUpForm {
|
export interface SignUpForm {
|
||||||
|
|
@ -35,10 +36,4 @@ export interface LoginForm {
|
||||||
captcha_token?: string;
|
captcha_token?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface User {
|
export type User = Omit<HappydnsUser, 'settings'> & { settings: UserSettings };
|
||||||
id: string;
|
|
||||||
email: string;
|
|
||||||
created_at: Date;
|
|
||||||
last_seen: Date;
|
|
||||||
settings: UserSettings;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,6 @@ export const ApplyConfirmUnexpected = 0;
|
||||||
export const ApplyConfirmAlways = 1;
|
export const ApplyConfirmAlways = 1;
|
||||||
export const ApplyConfirmNever = 2;
|
export const ApplyConfirmNever = 2;
|
||||||
|
|
||||||
export interface UserSettings {
|
import type { HappydnsUserSettings } from "$lib/api-base/types.gen";
|
||||||
language: string;
|
|
||||||
newsletter: boolean;
|
export type UserSettings = Required<HappydnsUserSettings>;
|
||||||
fieldhint: number;
|
|
||||||
zoneview: number;
|
|
||||||
applyconfirm: number;
|
|
||||||
showrrtypes: boolean;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -19,26 +19,19 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import type { ServiceCombined } from "$lib/model/service.svelte";
|
import type { HappydnsZoneMeta } from "$lib/api-base/types.gen";
|
||||||
|
import type { ServiceWithValue } from "$lib/model/service.svelte";
|
||||||
|
|
||||||
export interface ServiceRecord {
|
export interface ServiceRecord {
|
||||||
str: string;
|
str: string;
|
||||||
rr: any; // dns.RR
|
rr: Record<string, unknown>; // dns.RR
|
||||||
|
|
||||||
// ui
|
// ui
|
||||||
edit?: boolean;
|
edit?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ZoneMeta {
|
export type ZoneMeta = HappydnsZoneMeta;
|
||||||
id: string;
|
|
||||||
id_author: string;
|
|
||||||
default_ttl: Number;
|
|
||||||
last_modified: Date;
|
|
||||||
commit_message?: string;
|
|
||||||
commit_date?: Date;
|
|
||||||
published?: Date;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Zone extends ZoneMeta {
|
export interface Zone extends ZoneMeta {
|
||||||
services: Record<string, Array<ServiceCombined>>;
|
services: Record<string, Array<ServiceWithValue>>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,11 +31,11 @@ export interface DKIMValue {
|
||||||
s?: string[];
|
s?: string[];
|
||||||
t?: string[];
|
t?: string[];
|
||||||
f?: string[];
|
f?: string[];
|
||||||
[key: string]: any;
|
[key: string]: string | string[] | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parseDKIM(val: string): DKIMValue {
|
export function parseDKIM(val: string): DKIMValue {
|
||||||
const kv = parseKeyValueTxt(val) as any;
|
const kv = parseKeyValueTxt(val);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...kv,
|
...kv,
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@ export const thisAliases = derived(thisZone, ($thisZone) => {
|
||||||
|
|
||||||
Object.entries($thisZone.services).forEach(([dn, services]) => {
|
Object.entries($thisZone.services).forEach(([dn, services]) => {
|
||||||
services?.forEach((svc) => {
|
services?.forEach((svc) => {
|
||||||
if (svc._svctype === "svcs.CNAME") {
|
if (svc._svctype === "svcs.CNAME" && svc.Service && typeof svc.Service === "object") {
|
||||||
const target = svc.Service.Target;
|
const target = (svc.Service as Record<string, unknown>).Target as string;
|
||||||
aliases[target] = [...(aliases[target] || []), dn];
|
aliases[target] = [...(aliases[target] || []), dn];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -55,4 +55,4 @@ function createToastsStore() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const toasts: any = createToastsStore();
|
export const toasts = createToastsStore();
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
* @returns A mock Response object
|
* @returns A mock Response object
|
||||||
*/
|
*/
|
||||||
export function createMockResponse(
|
export function createMockResponse(
|
||||||
data: any,
|
data: unknown,
|
||||||
status: number = 200,
|
status: number = 200,
|
||||||
statusText: string = "OK"
|
statusText: string = "OK"
|
||||||
): Response {
|
): Response {
|
||||||
|
|
@ -57,6 +57,6 @@ export function createMockResponse(
|
||||||
* @param status HTTP status code (default: 200)
|
* @param status HTTP status code (default: 200)
|
||||||
* @returns A mock fetch function
|
* @returns A mock fetch function
|
||||||
*/
|
*/
|
||||||
export function createMockFetch(data: any, status: number = 200) {
|
export function createMockFetch(data: unknown, status: number = 200) {
|
||||||
return () => Promise.resolve(createMockResponse(data, status));
|
return () => Promise.resolve(createMockResponse(data, status));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
import type { Field } from "$lib/model/custom_form.svelte";
|
import type { Field } from "$lib/model/custom_form.svelte";
|
||||||
|
|
||||||
export function fillUndefinedValues(value: any, spec: Field) {
|
export function fillUndefinedValues(value: Record<string, unknown>, spec: Field) {
|
||||||
if (value[spec.id] === undefined && spec.type.length) {
|
if (value[spec.id] === undefined && spec.type.length) {
|
||||||
let vartype = spec.type;
|
let vartype = spec.type;
|
||||||
if (vartype[0] == "*") vartype = vartype.substring(1);
|
if (vartype[0] == "*") vartype = vartype.substring(1);
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@
|
||||||
title: $t("domains.attached-new"),
|
title: $t("domains.attached-new"),
|
||||||
message: $t("domains.added-success", { domain: domain.domain }),
|
message: $t("domains.added-success", { domain: domain.domain }),
|
||||||
href: "/domains/" + domain.domain,
|
href: "/domains/" + domain.domain,
|
||||||
color: "success",
|
type: "success",
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
});
|
});
|
||||||
refreshDomains();
|
refreshDomains();
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue