From b2dee1d844ac8988ca5401b193d0decff11dc89d Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Tue, 12 Aug 2025 09:15:58 +0000 Subject: [PATCH 1/6] Preload missing resources There are some inconsistencies in the way the API returns some values for pools and scale sets. This is due to not preloading the appropriate relations. Signed-off-by: Gabriel Adrian Samfira --- database/sql/instances.go | 11 +++++++++-- database/sql/pools.go | 1 + database/sql/scaleset_instances.go | 5 ++++- database/sql/scalesets.go | 3 +++ database/sql/util.go | 13 ++++++++++++- 5 files changed, 29 insertions(+), 4 deletions(-) diff --git a/database/sql/instances.go b/database/sql/instances.go index dab81f10..c6c2d204 100644 --- a/database/sql/instances.go +++ b/database/sql/instances.go @@ -326,7 +326,10 @@ func (s *sqlDatabase) ListPoolInstances(_ context.Context, poolID string) ([]par } var instances []Instance - query := s.conn.Model(&Instance{}).Preload("Job").Where("pool_id = ?", u) + query := s.conn. + Preload("Pool"). + Preload("Job"). + Where("pool_id = ?", u) if err := query.Find(&instances); err.Error != nil { return nil, errors.Wrap(err.Error, "fetching instances") @@ -345,7 +348,11 @@ func (s *sqlDatabase) ListPoolInstances(_ context.Context, poolID string) ([]par func (s *sqlDatabase) ListAllInstances(_ context.Context) ([]params.Instance, error) { var instances []Instance - q := s.conn.Model(&Instance{}).Preload("Job").Find(&instances) + q := s.conn. + Preload("Pool"). + Preload("ScaleSet"). + Preload("Job"). + Find(&instances) if q.Error != nil { return nil, errors.Wrap(q.Error, "fetching instances") } diff --git a/database/sql/pools.go b/database/sql/pools.go index a4b3354e..350e1dc2 100644 --- a/database/sql/pools.go +++ b/database/sql/pools.go @@ -46,6 +46,7 @@ func (s *sqlDatabase) ListAllPools(_ context.Context) ([]params.Pool, error) { Preload("Enterprise"). Preload("Enterprise.Endpoint"). Omit("extra_specs"). + Omit("status_messages"). Find(&pools) if q.Error != nil { return nil, errors.Wrap(q.Error, "fetching all pools") diff --git a/database/sql/scaleset_instances.go b/database/sql/scaleset_instances.go index bbc4f593..61271e8b 100644 --- a/database/sql/scaleset_instances.go +++ b/database/sql/scaleset_instances.go @@ -66,7 +66,10 @@ func (s *sqlDatabase) CreateScaleSetInstance(_ context.Context, scaleSetID uint, func (s *sqlDatabase) ListScaleSetInstances(_ context.Context, scalesetID uint) ([]params.Instance, error) { var instances []Instance - query := s.conn.Model(&Instance{}).Preload("Job").Where("scale_set_fk_id = ?", scalesetID) + query := s.conn. + Preload("ScaleSet"). + Preload("Job"). + Where("scale_set_fk_id = ?", scalesetID) if err := query.Find(&instances); err.Error != nil { return nil, errors.Wrap(err.Error, "fetching instances") diff --git a/database/sql/scalesets.go b/database/sql/scalesets.go index 65a51ca0..752c7948 100644 --- a/database/sql/scalesets.go +++ b/database/sql/scalesets.go @@ -33,8 +33,11 @@ func (s *sqlDatabase) ListAllScaleSets(_ context.Context) ([]params.ScaleSet, er q := s.conn.Model(&ScaleSet{}). Preload("Organization"). + Preload("Organization.Endpoint"). Preload("Repository"). + Preload("Repository.Endpoint"). Preload("Enterprise"). + Preload("Enterprise.Endpoint"). Omit("extra_specs"). Omit("status_messages"). Find(&scaleSets) diff --git a/database/sql/util.go b/database/sql/util.go index 2b2a1de8..ebb3c57c 100644 --- a/database/sql/util.go +++ b/database/sql/util.go @@ -330,6 +330,8 @@ func (s *sqlDatabase) sqlToCommonPool(pool Pool) (params.Pool, error) { func (s *sqlDatabase) sqlToCommonScaleSet(scaleSet ScaleSet) (params.ScaleSet, error) { ret := params.ScaleSet{ ID: scaleSet.ID, + CreatedAt: scaleSet.CreatedAt, + UpdatedAt: scaleSet.UpdatedAt, ScaleSetID: scaleSet.ScaleSetID, Name: scaleSet.Name, DisableUpdate: scaleSet.DisableUpdate, @@ -355,24 +357,33 @@ func (s *sqlDatabase) sqlToCommonScaleSet(scaleSet ScaleSet) (params.ScaleSet, e DesiredRunnerCount: scaleSet.DesiredRunnerCount, } + var ep GithubEndpoint if scaleSet.RepoID != nil { ret.RepoID = scaleSet.RepoID.String() if scaleSet.Repository.Owner != "" && scaleSet.Repository.Name != "" { ret.RepoName = fmt.Sprintf("%s/%s", scaleSet.Repository.Owner, scaleSet.Repository.Name) } + ep = scaleSet.Repository.Endpoint } if scaleSet.OrgID != nil { ret.OrgID = scaleSet.OrgID.String() ret.OrgName = scaleSet.Organization.Name + ep = scaleSet.Organization.Endpoint } if scaleSet.EnterpriseID != nil { ret.EnterpriseID = scaleSet.EnterpriseID.String() ret.EnterpriseName = scaleSet.Enterprise.Name + ep = scaleSet.Enterprise.Endpoint } - var err error + endpoint, err := s.sqlToCommonGithubEndpoint(ep) + if err != nil { + return params.ScaleSet{}, errors.Wrap(err, "converting endpoint") + } + ret.Endpoint = endpoint + for idx, inst := range scaleSet.Instances { ret.Instances[idx], err = s.sqlToParamsInstance(inst) if err != nil { From 325bca4af391cf4966dec5518b578e6600fd936c Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Tue, 12 Aug 2025 09:17:16 +0000 Subject: [PATCH 2/6] Add swagger annotations and updates Add swagger annotations to models to allow generating a full swagger definition. This will help generate clients in other languages if needed. Signed-off-by: Gabriel Adrian Samfira --- apiserver/params/params.go | 1 + params/params.go | 37 ++++++++++++++++++++++++++++++++++++- params/requests.go | 21 +++++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/apiserver/params/params.go b/apiserver/params/params.go index 7aee3bd2..ec42fab6 100644 --- a/apiserver/params/params.go +++ b/apiserver/params/params.go @@ -14,6 +14,7 @@ package params +// swagger:model APIErrorResponse // APIErrorResponse holds information about an error, returned by the API type APIErrorResponse struct { Error string `json:"error"` diff --git a/params/params.go b/params/params.go index 9cd4fc83..50e26d26 100644 --- a/params/params.go +++ b/params/params.go @@ -172,6 +172,7 @@ const ( MessageTypeJobAvailable = "JobAvailable" ) +// swagger:model StatusMessage type StatusMessage struct { CreatedAt time.Time `json:"created_at,omitempty"` Message string `json:"message,omitempty"` @@ -179,6 +180,7 @@ type StatusMessage struct { EventLevel EventLevel `json:"event_level,omitempty"` } +// swagger:model EntityEvent type EntityEvent struct { ID uint `json:"id,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` @@ -188,6 +190,7 @@ type EntityEvent struct { Message string `json:"message,omitempty"` } +// swagger:model Instance type Instance struct { // ID is the database ID of this instance. ID string `json:"id,omitempty"` @@ -282,6 +285,7 @@ func (i Instance) GetID() string { } // used by swagger client generated code +// swagger:model Instances type Instances []Instance type BootstrapInstance struct { @@ -352,6 +356,7 @@ type Tag struct { Name string `json:"name,omitempty"` } +// swagger:model Pool type Pool struct { RunnerPrefix @@ -376,7 +381,7 @@ type Pool struct { EnterpriseID string `json:"enterprise_id,omitempty"` EnterpriseName string `json:"enterprise_name,omitempty"` - Endpoint ForgeEndpoint `json:"forge_type,omitempty"` + Endpoint ForgeEndpoint `json:"endpoint,omitempty"` RunnerBootstrapTimeout uint `json:"runner_bootstrap_timeout,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` @@ -487,11 +492,16 @@ func (p *Pool) HasRequiredLabels(set []string) bool { } // used by swagger client generated code +// swagger:model Pools type Pools []Pool +// swagger:model ScaleSet type ScaleSet struct { RunnerPrefix + CreatedAt time.Time `json:"created_at,omitempty"` + UpdatedAt time.Time `json:"updated_at,omitempty"` + ID uint `json:"id,omitempty"` ScaleSetID int `json:"scale_set_id,omitempty"` Name string `json:"name,omitempty"` @@ -511,6 +521,8 @@ type ScaleSet struct { Instances []Instance `json:"instances,omitempty"` DesiredRunnerCount int `json:"desired_runner_count,omitempty"` + Endpoint ForgeEndpoint `json:"endpoint,omitempty"` + RunnerBootstrapTimeout uint `json:"runner_bootstrap_timeout,omitempty"` // ExtraSpecs is an opaque raw json that gets sent to the provider // as part of the bootstrap params for instances. It can contain @@ -593,8 +605,10 @@ func (p *ScaleSet) RunnerTimeout() uint { } // used by swagger client generated code +// swagger:model ScaleSets type ScaleSets []ScaleSet +// swagger:model Repository type Repository struct { ID string `json:"id,omitempty"` Owner string `json:"owner,omitempty"` @@ -666,8 +680,10 @@ func (r Repository) String() string { } // used by swagger client generated code +// swagger:model Repositories type Repositories []Repository +// swagger:model Organization type Organization struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` @@ -724,8 +740,10 @@ func (o Organization) GetBalancerType() PoolBalancerType { } // used by swagger client generated code +// swagger:model Organizations type Organizations []Organization +// swagger:model Enterprise type Enterprise struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` @@ -782,9 +800,11 @@ func (e Enterprise) GetBalancerType() PoolBalancerType { } // used by swagger client generated code +// swagger:model Enterprises type Enterprises []Enterprise // Users holds information about a particular user +// swagger:model User type User struct { ID string `json:"id,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` @@ -801,10 +821,12 @@ type User struct { // JWTResponse holds the JWT token returned as a result of a // successful auth +// swagger:model JWTResponse type JWTResponse struct { Token string `json:"token,omitempty"` } +// swagger:model ControllerInfo type ControllerInfo struct { // ControllerID is the unique ID of this controller. This ID gets generated // automatically on controller init. @@ -857,6 +879,7 @@ func (c *ControllerInfo) JobBackoff() time.Duration { return time.Duration(int64(c.MinimumJobAgeBackoff)) } +// swagger:model GithubRateLimit type GithubRateLimit struct { Limit int `json:"limit,omitempty"` Used int `json:"used,omitempty"` @@ -875,6 +898,7 @@ func (g GithubRateLimit) ResetAt() time.Time { return time.Unix(g.Reset, 0) } +// swagger:model ForgeCredentials type ForgeCredentials struct { ID uint `json:"id,omitempty"` Name string `json:"name,omitempty"` @@ -1000,8 +1024,10 @@ func (g ForgeCredentials) RootCertificateBundle() (CertificateBundle, error) { } // used by swagger client generated code +// swagger:model Credentials type Credentials []ForgeCredentials +// swagger:model Provider type Provider struct { Name string `json:"name,omitempty"` ProviderType ProviderType `json:"type,omitempty"` @@ -1009,8 +1035,10 @@ type Provider struct { } // used by swagger client generated code +// swagger:model Providers type Providers []Provider +// swagger:model PoolManagerStatus type PoolManagerStatus struct { IsRunning bool `json:"running,omitempty"` FailureReason string `json:"failure_reason,omitempty"` @@ -1032,6 +1060,7 @@ func (p RunnerPrefix) GetRunnerPrefix() string { return p.Prefix } +// swagger:model Job type Job struct { // ID is the ID of the job. ID int64 `json:"id,omitempty"` @@ -1086,14 +1115,17 @@ type Job struct { UpdatedAt time.Time `json:"updated_at,omitempty"` } +// swagger:model Jobs // used by swagger client generated code type Jobs []Job +// swagger:model InstallWebhookParams type InstallWebhookParams struct { WebhookEndpointType WebhookEndpointType `json:"webhook_endpoint_type,omitempty"` InsecureSSL bool `json:"insecure_ssl,omitempty"` } +// swagger:model HookInfo type HookInfo struct { ID int64 `json:"id,omitempty"` URL string `json:"url,omitempty"` @@ -1106,6 +1138,7 @@ type CertificateBundle struct { RootCertificates map[string][]byte `json:"root_certificates,omitempty"` } +// swagger:model ForgeEntity type UpdateSystemInfoParams struct { OSName string `json:"os_name,omitempty"` OSVersion string `json:"os_version,omitempty"` @@ -1194,8 +1227,10 @@ func (g ForgeEntity) GetIDAsUUID() (uuid.UUID, error) { } // used by swagger client generated code +// swagger:model ForgeEndpoints type ForgeEndpoints []ForgeEndpoint +// swagger:model ForgeEndpoint type ForgeEndpoint struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` diff --git a/params/requests.go b/params/requests.go index 3f2fcfab..3f4e1737 100644 --- a/params/requests.go +++ b/params/requests.go @@ -39,6 +39,7 @@ type InstanceRequest struct { OSVersion string `json:"os_version"` } +// swagger:model CreateRepoParams type CreateRepoParams struct { Owner string `json:"owner,omitempty"` Name string `json:"name,omitempty"` @@ -80,6 +81,7 @@ func (c *CreateRepoParams) Validate() error { return nil } +// swagger:model CreateOrgParams type CreateOrgParams struct { Name string `json:"name,omitempty"` CredentialsName string `json:"credentials_name,omitempty"` @@ -115,6 +117,7 @@ func (c *CreateOrgParams) Validate() error { return nil } +// swagger:model CreateEnterpriseParams type CreateEnterpriseParams struct { Name string `json:"name,omitempty"` CredentialsName string `json:"credentials_name,omitempty"` @@ -143,6 +146,7 @@ func (c *CreateEnterpriseParams) Validate() error { // NewUserParams holds the needed information to create // a new user +// swagger:model NewUserParams type NewUserParams struct { Email string `json:"email,omitempty"` Username string `json:"username,omitempty"` @@ -152,6 +156,7 @@ type NewUserParams struct { Enabled bool `json:"-"` } +// swagger:model UpdatePoolParams type UpdatePoolParams struct { RunnerPrefix @@ -189,6 +194,7 @@ type CreateInstanceParams struct { JitConfiguration map[string]string `json:"jit_configuration,omitempty"` } +// swagger:model CreatePoolParams type CreatePoolParams struct { RunnerPrefix @@ -263,6 +269,7 @@ type UpdateUserParams struct { Enabled *bool `json:"enabled,omitempty"` } +// swagger:model PasswordLoginParams // PasswordLoginParams holds information used during // password authentication, that will be passed to a // password login function @@ -279,6 +286,7 @@ func (p PasswordLoginParams) Validate() error { return nil } +// swagger:model UpdateEntityParams type UpdateEntityParams struct { CredentialsName string `json:"credentials_name,omitempty"` WebhookSecret string `json:"webhook_secret,omitempty"` @@ -291,6 +299,7 @@ type InstanceUpdateMessage struct { AgentID *int64 `json:"agent_id,omitempty"` } +// swagger:model CreateGithubEndpointParams type CreateGithubEndpointParams struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` @@ -358,6 +367,7 @@ func (c CreateGithubEndpointParams) Validate() error { return nil } +// swagger:model UpdateGithubEndpointParams type UpdateGithubEndpointParams struct { Description *string `json:"description,omitempty"` APIBaseURL *string `json:"api_base_url,omitempty"` @@ -416,10 +426,12 @@ func (u UpdateGithubEndpointParams) Validate() error { return nil } +// swagger:model GithubPAT type GithubPAT struct { OAuth2Token string `json:"oauth2_token,omitempty"` } +// swagger:model GithubApp type GithubApp struct { AppID int64 `json:"app_id,omitempty"` InstallationID int64 `json:"installation_id,omitempty"` @@ -452,6 +464,7 @@ func (g GithubApp) Validate() error { return nil } +// swagger:model CreateGithubCredentialsParams type CreateGithubCredentialsParams struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` @@ -491,6 +504,7 @@ func (c CreateGithubCredentialsParams) Validate() error { return nil } +// swagger:model UpdateGithubCredentialsParams type UpdateGithubCredentialsParams struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` @@ -518,6 +532,7 @@ func (u UpdateGithubCredentialsParams) Validate() error { return nil } +// swagger:model UpdateControllerParams type UpdateControllerParams struct { MetadataURL *string `json:"metadata_url,omitempty"` CallbackURL *string `json:"callback_url,omitempty"` @@ -550,6 +565,7 @@ func (u UpdateControllerParams) Validate() error { return nil } +// swagger:model CreateScaleSetParams type CreateScaleSetParams struct { RunnerPrefix @@ -602,6 +618,7 @@ func (s *CreateScaleSetParams) Validate() error { return nil } +// swagger:model UpdateScaleSetParams type UpdateScaleSetParams struct { RunnerPrefix @@ -623,6 +640,7 @@ type UpdateScaleSetParams struct { ExtendedState *string `json:"extended_state"` } +// swagger:model CreateGiteaEndpointParams type CreateGiteaEndpointParams struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` @@ -674,6 +692,7 @@ func (c CreateGiteaEndpointParams) Validate() error { return nil } +// swagger:model UpdateGiteaEndpointParams type UpdateGiteaEndpointParams struct { Description *string `json:"description,omitempty"` APIBaseURL *string `json:"api_base_url,omitempty"` @@ -719,6 +738,7 @@ func (u UpdateGiteaEndpointParams) Validate() error { return nil } +// swagger:model CreateGiteaCredentialsParams type CreateGiteaCredentialsParams struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` @@ -752,6 +772,7 @@ func (c CreateGiteaCredentialsParams) Validate() error { return nil } +// swagger:model UpdateGiteaCredentialsParams type UpdateGiteaCredentialsParams struct { Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` From 5a6ac121183d6453b717f664524b53b693b1f606 Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Tue, 12 Aug 2025 09:21:43 +0000 Subject: [PATCH 3/6] Fix for gitea tools and scale set cleanup Filter out gitea tools to only consider archived downloads. This should help in situations where bandwidth is more important than CPU time used to unarchive the tools. Also a drive by fix for scale sets cleanup. Signed-off-by: Gabriel Adrian Samfira --- doc/events.md | 4 +++- workers/cache/gitea_tools.go | 4 ++++ workers/scaleset/scaleset.go | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/events.md b/doc/events.md index 6bc61a9d..e643a5c2 100644 --- a/doc/events.md +++ b/doc/events.md @@ -88,7 +88,9 @@ The filter is defined as a JSON that you write over the websocket connections. T "job", "controller", "github_credentials", - "github_endpoint" + "gitea_credentials", + "github_endpoint", + "scaleset" ], "title": "entity type", "description": "The type of entity to filter on", diff --git a/workers/cache/gitea_tools.go b/workers/cache/gitea_tools.go index 43fd86ba..8410a826 100644 --- a/workers/cache/gitea_tools.go +++ b/workers/cache/gitea_tools.go @@ -180,6 +180,10 @@ func getTools(ctx context.Context) ([]commonParams.RunnerApplicationDownload, er slog.InfoContext(ctx, "ignoring unrecognized tools os", "tool", asset.Name) continue } + if !strings.HasSuffix(asset.DownloadURL, ".xz") { + // filter out non compressed versions. + continue + } ret = append(ret, commonParams.RunnerApplicationDownload{ OS: os, Architecture: arch, diff --git a/workers/scaleset/scaleset.go b/workers/scaleset/scaleset.go index f5b34400..03a93387 100644 --- a/workers/scaleset/scaleset.go +++ b/workers/scaleset/scaleset.go @@ -193,6 +193,12 @@ func (w *Worker) Start() (err error) { return fmt.Errorf("updating runner %s: %w", instance.Name, err) } } + } else if instance.Status == commonParams.InstanceDeleted { + if err := w.handleInstanceCleanup(instance); err != nil { + locking.Unlock(instance.Name, false) + return fmt.Errorf("failed to remove database entry for %s: %w", instance.Name, err) + } + continue } w.runners[instance.ID] = instance locking.Unlock(instance.Name, false) From 98a769b8d190ff71a1288235b46e76cc460f1a13 Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Tue, 12 Aug 2025 09:23:22 +0000 Subject: [PATCH 4/6] Allow cookie login to API endpoints This change considers cookies as a source for the JWT token. Signed-off-by: Gabriel Adrian Samfira --- auth/jwt.go | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/auth/jwt.go b/auth/jwt.go index e9b5745f..52fce0c9 100644 --- a/auth/jwt.go +++ b/auth/jwt.go @@ -97,26 +97,37 @@ func invalidAuthResponse(ctx context.Context, w http.ResponseWriter) { } } +func (amw *jwtMiddleware) getTokenFromRequest(r *http.Request) (string, error) { + authorizationHeader := r.Header.Get("authorization") + if authorizationHeader == "" { + cookie, err := r.Cookie("garm_token") + if err != nil { + return "", fmt.Errorf("failed to get cookie: %w", err) + } + return cookie.Value, nil + } + + bearerToken := strings.Split(authorizationHeader, " ") + if len(bearerToken) != 2 { + return "", fmt.Errorf("invalid auth header") + } + return bearerToken[1], nil +} + // Middleware implements the middleware interface func (amw *jwtMiddleware) Middleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // nolint:golangci-lint,godox // TODO: Log error details when authentication fails ctx := r.Context() - authorizationHeader := r.Header.Get("authorization") - if authorizationHeader == "" { + authToken, err := amw.getTokenFromRequest(r) + if err != nil { + slog.ErrorContext(ctx, "failed to get auth token", "error", err) invalidAuthResponse(ctx, w) return } - - bearerToken := strings.Split(authorizationHeader, " ") - if len(bearerToken) != 2 { - invalidAuthResponse(ctx, w) - return - } - claims := &JWTClaims{} - token, err := jwt.ParseWithClaims(bearerToken[1], claims, func(token *jwt.Token) (interface{}, error) { + token, err := jwt.ParseWithClaims(authToken, claims, func(token *jwt.Token) (interface{}, error) { if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok { return nil, fmt.Errorf("invalid signing method") } From a811d129d00ed4073d2b0c07891d499226db98bb Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Tue, 12 Aug 2025 09:25:21 +0000 Subject: [PATCH 5/6] Update .gitignore Signed-off-by: Gabriel Adrian Samfira --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 97f747e2..4e8b3d79 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,7 @@ bin/ cmd/temp build/ release/ +node_modules/ +.svelte-kit/ +debug.html +git_push.sh From eec158b32c1cd89c94eaafdea14c3e6e7a127343 Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Tue, 12 Aug 2025 09:28:21 +0000 Subject: [PATCH 6/6] Add SPA UI for GARM This change adds a single page application front-end to GARM. It uses a generated REST client, built from the swagger definitions, the websocket interface for live updates of entities and eager loading of everything except runners, as users may have many runners and we don't want to load hundreds of runners in memory. Proper pagination should be implemented in the API, in future commits, to avoid loading lots of elements for no reason. Signed-off-by: Gabriel Adrian Samfira --- .gitignore | 2 + .mockery.yaml | 27 + Makefile | 16 + README.md | 12 + apiserver/controllers/controllers.go | 29 +- apiserver/routers/routers.go | 28 +- auth/init_required.go | 4 +- build-webapp.sh | 16 + cmd/garm/main.go | 5 +- config/config.go | 21 + database/common/mocks/Store.go | 2689 +++- database/common/store.go | 2 +- database/sql/pools.go | 10 +- database/sql/scalesets.go | 19 +- database/watcher/watcher_store_test.go | 5 + doc/building_from_source.md | 66 +- doc/config.md | 2 + doc/quickstart.md | 3 + go.mod | 6 +- go.sum | 11 +- runner/common/mocks/GithubClient.go | 413 +- runner/common/mocks/GithubEntityOperations.go | 382 +- runner/common/mocks/PoolManager.go | 368 +- runner/common/mocks/Provider.go | 273 +- runner/common/mocks/RateLimitClient.go | 38 +- runner/common/pool.go | 2 +- runner/common/provider.go | 2 +- runner/common/util.go | 2 +- runner/interfaces.go | 2 +- runner/mocks/PoolManagerController.go | 352 +- testdata/config.toml | 2 + util/util.go | 68 + util/util_test.go | 394 + .../go-openapi/jsonpointer/.golangci.yml | 108 +- .../go-openapi/jsonpointer/pointer.go | 10 + vendor/github.com/mattn/go-sqlite3/README.md | 2 + .../mattn/go-sqlite3/sqlite3-binding.c | 4728 ++++--- .../mattn/go-sqlite3/sqlite3-binding.h | 316 +- .../mattn/go-sqlite3/sqlite3_opt_userauth.go | 153 +- .../github.com/mattn/go-sqlite3/sqlite3ext.h | 4 + vendor/github.com/spf13/pflag/README.md | 27 + vendor/github.com/spf13/pflag/bool_func.go | 40 + vendor/github.com/spf13/pflag/count.go | 2 +- vendor/github.com/spf13/pflag/errors.go | 149 + vendor/github.com/spf13/pflag/flag.go | 85 +- vendor/github.com/spf13/pflag/func.go | 37 + vendor/github.com/spf13/pflag/golangflag.go | 22 + vendor/github.com/spf13/pflag/ipnet_slice.go | 2 +- vendor/github.com/spf13/pflag/text.go | 81 + vendor/github.com/spf13/pflag/time.go | 118 + vendor/modules.txt | 6 +- webapp/.env.development | 2 + webapp/.env.example | 8 + webapp/DEV_SETUP.md | 79 + webapp/README.md | 102 + webapp/assets/_app/env.js | 1 + .../_app/immutable/assets/0.BPrCR_r7.css | 1 + .../immutable/assets/_layout.BPrCR_r7.css | 1 + .../assets/_app/immutable/chunks/5WA7h8uK.js | 1 + .../assets/_app/immutable/chunks/B3Pzt0F_.js | 1 + .../assets/_app/immutable/chunks/B7ITzBt8.js | 1 + .../assets/_app/immutable/chunks/BAg1iRPq.js | 1 + .../assets/_app/immutable/chunks/BE4wujub.js | 1 + .../assets/_app/immutable/chunks/BEkVdVE1.js | 1 + .../assets/_app/immutable/chunks/BGVHQGl-.js | 4 + .../assets/_app/immutable/chunks/BmGWMSQm.js | 1 + .../assets/_app/immutable/chunks/C41YH50Q.js | 1 + .../assets/_app/immutable/chunks/C6k1Q4We.js | 1 + .../assets/_app/immutable/chunks/C89fcOde.js | 1 + .../assets/_app/immutable/chunks/C9DJVOi1.js | 1 + .../assets/_app/immutable/chunks/CCSWcuVN.js | 1 + .../assets/_app/immutable/chunks/CGpPw4EW.js | 1 + .../assets/_app/immutable/chunks/CLYUNKnN.js | 1 + .../assets/_app/immutable/chunks/CNMHKIIK.js | 1 + .../assets/_app/immutable/chunks/CO4LUyTP.js | 1 + .../assets/_app/immutable/chunks/CTf6mQoE.js | 3 + .../assets/_app/immutable/chunks/CclkODgu.js | 1 + .../assets/_app/immutable/chunks/CiE1LlKV.js | 7 + .../assets/_app/immutable/chunks/CoIRRsD9.js | 1 + .../assets/_app/immutable/chunks/CwqI2jFH.js | 1 + .../assets/_app/immutable/chunks/D4Caz1gY.js | 1 + .../assets/_app/immutable/chunks/D8EpLgQ1.js | 2 + .../assets/_app/immutable/chunks/DDhBTdDt.js | 1 + .../assets/_app/immutable/chunks/DQP15tlf.js | 1 + .../assets/_app/immutable/chunks/DZblzgqm.js | 4 + .../assets/_app/immutable/chunks/Dbd6PPbz.js | 1 + .../assets/_app/immutable/chunks/DsnmJJEf.js | 1 + .../assets/_app/immutable/chunks/KQ2xQpA3.js | 1 + .../assets/_app/immutable/chunks/duD3WMbl.js | 1 + .../assets/_app/immutable/chunks/ow_oMtSd.js | 1 + .../assets/_app/immutable/chunks/qB7B8uiS.js | 1 + .../assets/_app/immutable/chunks/u94nIB4-.js | 1 + .../assets/_app/immutable/chunks/wyaP0EDu.js | 1 + .../_app/immutable/entry/app.kAVAdeq9.js | 2 + .../_app/immutable/entry/start.CI0Cdear.js | 1 + .../assets/_app/immutable/nodes/0.DINiyk_8.js | 13 + .../assets/_app/immutable/nodes/1.DcR4nNsi.js | 1 + .../_app/immutable/nodes/10.LnrIJgIa.js | 1 + .../_app/immutable/nodes/11.Bsn67lBa.js | 1 + .../_app/immutable/nodes/12.B-vC_cmu.js | 1 + .../_app/immutable/nodes/13.Br7HzjXP.js | 1 + .../_app/immutable/nodes/14.Cd0DOn96.js | 1 + .../_app/immutable/nodes/15.CkHQugXH.js | 1 + .../_app/immutable/nodes/16.B35VVkOd.js | 1 + .../_app/immutable/nodes/17.CCltcs-Z.js | 1 + .../_app/immutable/nodes/18.iVIhGVtu.js | 1 + .../assets/_app/immutable/nodes/2.CiT4lj0D.js | 1 + .../assets/_app/immutable/nodes/3.BSFz0YHn.js | 7 + .../assets/_app/immutable/nodes/4.XnVoh6ca.js | 3 + .../assets/_app/immutable/nodes/5.rvsSG-AQ.js | 1 + .../assets/_app/immutable/nodes/6.CtGX0qgG.js | 1 + .../assets/_app/immutable/nodes/7.0w3i9VHx.js | 1 + .../assets/_app/immutable/nodes/8.BiZNKYxk.js | 1 + .../assets/_app/immutable/nodes/9.DpSfMRgo.js | 1 + webapp/assets/_app/version.json | 1 + webapp/assets/assets.go | 83 + webapp/assets/assets/garm-dark.svg | 37 + webapp/assets/assets/garm-light.svg | 36 + webapp/assets/assets/gitea.svg | 1 + webapp/assets/assets/github-mark-white.svg | 1 + webapp/assets/assets/github-mark.svg | 1 + webapp/assets/favicon-dark.png | Bin 0 -> 3506 bytes webapp/assets/favicon-light.png | Bin 0 -> 3506 bytes webapp/assets/index.html | 105 + webapp/assets/openapitools.json | 7 + webapp/openapitools.json | 7 + webapp/package-lock.json | 5603 ++++++++ webapp/package.json | 43 + webapp/postcss.config.js | 6 + webapp/src/app.css | 18 + webapp/src/app.d.ts | 10 + webapp/src/app.html | 78 + webapp/src/lib/api/client.ts | 77 + webapp/src/lib/api/generated-client.ts | 596 + webapp/src/lib/api/generated/.gitignore | 4 + webapp/src/lib/api/generated/.npmignore | 1 + .../api/generated/.openapi-generator-ignore | 23 + .../api/generated/.openapi-generator/FILES | 70 + .../api/generated/.openapi-generator/VERSION | 1 + webapp/src/lib/api/generated/api.ts | 11684 ++++++++++++++++ webapp/src/lib/api/generated/base.ts | 86 + webapp/src/lib/api/generated/common.ts | 150 + webapp/src/lib/api/generated/configuration.ts | 115 + webapp/src/lib/api/generated/index.ts | 18 + webapp/src/lib/components/ActionButton.svelte | 68 + webapp/src/lib/components/Badge.svelte | 48 + webapp/src/lib/components/Button.svelte | 82 + .../lib/components/ControllerInfoCard.svelte | 403 + .../components/CreateEnterpriseModal.svelte | 213 + .../components/CreateOrganizationModal.svelte | 271 + .../src/lib/components/CreatePoolModal.svelte | 541 + .../components/CreateRepositoryModal.svelte | 294 + .../lib/components/CreateScaleSetModal.svelte | 472 + webapp/src/lib/components/DataTable.svelte | 237 + webapp/src/lib/components/DeleteModal.svelte | 57 + webapp/src/lib/components/DetailHeader.svelte | 56 + webapp/src/lib/components/EmptyState.svelte | 37 + .../lib/components/EntityInformation.svelte | 103 + webapp/src/lib/components/ErrorState.svelte | 37 + .../src/lib/components/EventsSection.svelte | 47 + .../lib/components/ForgeTypeSelector.svelte | 40 + webapp/src/lib/components/Icons.svelte | 51 + .../lib/components/InstancesSection.svelte | 114 + webapp/src/lib/components/JsonEditor.svelte | 48 + webapp/src/lib/components/LoadingState.svelte | 8 + webapp/src/lib/components/MobileCard.svelte | 254 + webapp/src/lib/components/Modal.svelte | 40 + webapp/src/lib/components/Navigation.svelte | 406 + webapp/src/lib/components/PageHeader.svelte | 39 + webapp/src/lib/components/PoolsSection.svelte | 136 + webapp/src/lib/components/SearchBar.svelte | 30 + .../src/lib/components/SearchFilterBar.svelte | 55 + .../src/lib/components/TablePagination.svelte | 98 + webapp/src/lib/components/Toast.svelte | 107 + webapp/src/lib/components/Tooltip.svelte | 29 + .../components/UpdateEnterpriseModal.svelte | 207 + .../lib/components/UpdateEntityModal.svelte | 265 + .../components/UpdateOrganizationModal.svelte | 210 + .../src/lib/components/UpdatePoolModal.svelte | 426 + .../components/UpdateRepositoryModal.svelte | 146 + .../lib/components/UpdateScaleSetModal.svelte | 339 + .../src/lib/components/WebhookSection.svelte | 172 + .../lib/components/cells/ActionsCell.svelte | 46 + .../lib/components/cells/EndpointCell.svelte | 15 + .../lib/components/cells/EntityCell.svelte | 84 + .../lib/components/cells/GenericCell.svelte | 59 + .../components/cells/InstancePoolCell.svelte | 19 + .../components/cells/PoolEntityCell.svelte | 16 + .../lib/components/cells/StatusCell.svelte | 118 + webapp/src/lib/components/cells/index.ts | 8 + webapp/src/lib/stores/auth.ts | 281 + webapp/src/lib/stores/eager-cache.ts | 609 + webapp/src/lib/stores/toast.ts | 58 + webapp/src/lib/stores/websocket.ts | 367 + webapp/src/lib/utils/common.ts | 296 + webapp/src/lib/utils/status.ts | 90 + webapp/src/openapitools.json | 7 + webapp/src/routes/+layout.svelte | 87 + webapp/src/routes/+layout.ts | 13 + webapp/src/routes/+page.svelte | 321 + webapp/src/routes/credentials/+page.svelte | 1022 ++ webapp/src/routes/endpoints/+page.svelte | 838 ++ webapp/src/routes/enterprises/+page.svelte | 329 + .../src/routes/enterprises/[id]/+page.svelte | 381 + webapp/src/routes/init/+page.svelte | 431 + webapp/src/routes/instances/+page.svelte | 284 + webapp/src/routes/instances/[id]/+page.svelte | 344 + webapp/src/routes/login/+page.svelte | 159 + webapp/src/routes/organizations/+page.svelte | 364 + .../routes/organizations/[id]/+page.svelte | 392 + webapp/src/routes/pools/+page.svelte | 339 + webapp/src/routes/pools/[id]/+page.svelte | 398 + webapp/src/routes/repositories/+page.svelte | 339 + .../src/routes/repositories/[id]/+page.svelte | 392 + webapp/src/routes/scalesets/+page.svelte | 316 + webapp/src/routes/scalesets/[id]/+page.svelte | 383 + webapp/static/assets/garm-dark.svg | 37 + webapp/static/assets/garm-light.svg | 36 + webapp/static/assets/gitea.svg | 1 + webapp/static/assets/github-mark-white.svg | 1 + webapp/static/assets/github-mark.svg | 1 + webapp/static/favicon-dark.png | Bin 0 -> 3506 bytes webapp/static/favicon-light.png | Bin 0 -> 3506 bytes webapp/svelte.config.js | 25 + webapp/swagger.yaml | 3469 +++++ webapp/tailwind.config.js | 34 + webapp/tsconfig.json | 14 + webapp/vite.config.ts | 36 + workers/entity/worker.go | 8 + workers/scaleset/scaleset.go | 7 +- 230 files changed, 47324 insertions(+), 2045 deletions(-) create mode 100644 .mockery.yaml create mode 100755 build-webapp.sh create mode 100644 util/util_test.go create mode 100644 vendor/github.com/spf13/pflag/bool_func.go create mode 100644 vendor/github.com/spf13/pflag/errors.go create mode 100644 vendor/github.com/spf13/pflag/func.go create mode 100644 vendor/github.com/spf13/pflag/text.go create mode 100644 vendor/github.com/spf13/pflag/time.go create mode 100644 webapp/.env.development create mode 100644 webapp/.env.example create mode 100644 webapp/DEV_SETUP.md create mode 100644 webapp/README.md create mode 100644 webapp/assets/_app/env.js create mode 100644 webapp/assets/_app/immutable/assets/0.BPrCR_r7.css create mode 100644 webapp/assets/_app/immutable/assets/_layout.BPrCR_r7.css create mode 100644 webapp/assets/_app/immutable/chunks/5WA7h8uK.js create mode 100644 webapp/assets/_app/immutable/chunks/B3Pzt0F_.js create mode 100644 webapp/assets/_app/immutable/chunks/B7ITzBt8.js create mode 100644 webapp/assets/_app/immutable/chunks/BAg1iRPq.js create mode 100644 webapp/assets/_app/immutable/chunks/BE4wujub.js create mode 100644 webapp/assets/_app/immutable/chunks/BEkVdVE1.js create mode 100644 webapp/assets/_app/immutable/chunks/BGVHQGl-.js create mode 100644 webapp/assets/_app/immutable/chunks/BmGWMSQm.js create mode 100644 webapp/assets/_app/immutable/chunks/C41YH50Q.js create mode 100644 webapp/assets/_app/immutable/chunks/C6k1Q4We.js create mode 100644 webapp/assets/_app/immutable/chunks/C89fcOde.js create mode 100644 webapp/assets/_app/immutable/chunks/C9DJVOi1.js create mode 100644 webapp/assets/_app/immutable/chunks/CCSWcuVN.js create mode 100644 webapp/assets/_app/immutable/chunks/CGpPw4EW.js create mode 100644 webapp/assets/_app/immutable/chunks/CLYUNKnN.js create mode 100644 webapp/assets/_app/immutable/chunks/CNMHKIIK.js create mode 100644 webapp/assets/_app/immutable/chunks/CO4LUyTP.js create mode 100644 webapp/assets/_app/immutable/chunks/CTf6mQoE.js create mode 100644 webapp/assets/_app/immutable/chunks/CclkODgu.js create mode 100644 webapp/assets/_app/immutable/chunks/CiE1LlKV.js create mode 100644 webapp/assets/_app/immutable/chunks/CoIRRsD9.js create mode 100644 webapp/assets/_app/immutable/chunks/CwqI2jFH.js create mode 100644 webapp/assets/_app/immutable/chunks/D4Caz1gY.js create mode 100644 webapp/assets/_app/immutable/chunks/D8EpLgQ1.js create mode 100644 webapp/assets/_app/immutable/chunks/DDhBTdDt.js create mode 100644 webapp/assets/_app/immutable/chunks/DQP15tlf.js create mode 100644 webapp/assets/_app/immutable/chunks/DZblzgqm.js create mode 100644 webapp/assets/_app/immutable/chunks/Dbd6PPbz.js create mode 100644 webapp/assets/_app/immutable/chunks/DsnmJJEf.js create mode 100644 webapp/assets/_app/immutable/chunks/KQ2xQpA3.js create mode 100644 webapp/assets/_app/immutable/chunks/duD3WMbl.js create mode 100644 webapp/assets/_app/immutable/chunks/ow_oMtSd.js create mode 100644 webapp/assets/_app/immutable/chunks/qB7B8uiS.js create mode 100644 webapp/assets/_app/immutable/chunks/u94nIB4-.js create mode 100644 webapp/assets/_app/immutable/chunks/wyaP0EDu.js create mode 100644 webapp/assets/_app/immutable/entry/app.kAVAdeq9.js create mode 100644 webapp/assets/_app/immutable/entry/start.CI0Cdear.js create mode 100644 webapp/assets/_app/immutable/nodes/0.DINiyk_8.js create mode 100644 webapp/assets/_app/immutable/nodes/1.DcR4nNsi.js create mode 100644 webapp/assets/_app/immutable/nodes/10.LnrIJgIa.js create mode 100644 webapp/assets/_app/immutable/nodes/11.Bsn67lBa.js create mode 100644 webapp/assets/_app/immutable/nodes/12.B-vC_cmu.js create mode 100644 webapp/assets/_app/immutable/nodes/13.Br7HzjXP.js create mode 100644 webapp/assets/_app/immutable/nodes/14.Cd0DOn96.js create mode 100644 webapp/assets/_app/immutable/nodes/15.CkHQugXH.js create mode 100644 webapp/assets/_app/immutable/nodes/16.B35VVkOd.js create mode 100644 webapp/assets/_app/immutable/nodes/17.CCltcs-Z.js create mode 100644 webapp/assets/_app/immutable/nodes/18.iVIhGVtu.js create mode 100644 webapp/assets/_app/immutable/nodes/2.CiT4lj0D.js create mode 100644 webapp/assets/_app/immutable/nodes/3.BSFz0YHn.js create mode 100644 webapp/assets/_app/immutable/nodes/4.XnVoh6ca.js create mode 100644 webapp/assets/_app/immutable/nodes/5.rvsSG-AQ.js create mode 100644 webapp/assets/_app/immutable/nodes/6.CtGX0qgG.js create mode 100644 webapp/assets/_app/immutable/nodes/7.0w3i9VHx.js create mode 100644 webapp/assets/_app/immutable/nodes/8.BiZNKYxk.js create mode 100644 webapp/assets/_app/immutable/nodes/9.DpSfMRgo.js create mode 100644 webapp/assets/_app/version.json create mode 100644 webapp/assets/assets.go create mode 100644 webapp/assets/assets/garm-dark.svg create mode 100644 webapp/assets/assets/garm-light.svg create mode 100644 webapp/assets/assets/gitea.svg create mode 100644 webapp/assets/assets/github-mark-white.svg create mode 100644 webapp/assets/assets/github-mark.svg create mode 100644 webapp/assets/favicon-dark.png create mode 100644 webapp/assets/favicon-light.png create mode 100644 webapp/assets/index.html create mode 100644 webapp/assets/openapitools.json create mode 100644 webapp/openapitools.json create mode 100644 webapp/package-lock.json create mode 100644 webapp/package.json create mode 100644 webapp/postcss.config.js create mode 100644 webapp/src/app.css create mode 100644 webapp/src/app.d.ts create mode 100644 webapp/src/app.html create mode 100644 webapp/src/lib/api/client.ts create mode 100644 webapp/src/lib/api/generated-client.ts create mode 100644 webapp/src/lib/api/generated/.gitignore create mode 100644 webapp/src/lib/api/generated/.npmignore create mode 100644 webapp/src/lib/api/generated/.openapi-generator-ignore create mode 100644 webapp/src/lib/api/generated/.openapi-generator/FILES create mode 100644 webapp/src/lib/api/generated/.openapi-generator/VERSION create mode 100644 webapp/src/lib/api/generated/api.ts create mode 100644 webapp/src/lib/api/generated/base.ts create mode 100644 webapp/src/lib/api/generated/common.ts create mode 100644 webapp/src/lib/api/generated/configuration.ts create mode 100644 webapp/src/lib/api/generated/index.ts create mode 100644 webapp/src/lib/components/ActionButton.svelte create mode 100644 webapp/src/lib/components/Badge.svelte create mode 100644 webapp/src/lib/components/Button.svelte create mode 100644 webapp/src/lib/components/ControllerInfoCard.svelte create mode 100644 webapp/src/lib/components/CreateEnterpriseModal.svelte create mode 100644 webapp/src/lib/components/CreateOrganizationModal.svelte create mode 100644 webapp/src/lib/components/CreatePoolModal.svelte create mode 100644 webapp/src/lib/components/CreateRepositoryModal.svelte create mode 100644 webapp/src/lib/components/CreateScaleSetModal.svelte create mode 100644 webapp/src/lib/components/DataTable.svelte create mode 100644 webapp/src/lib/components/DeleteModal.svelte create mode 100644 webapp/src/lib/components/DetailHeader.svelte create mode 100644 webapp/src/lib/components/EmptyState.svelte create mode 100644 webapp/src/lib/components/EntityInformation.svelte create mode 100644 webapp/src/lib/components/ErrorState.svelte create mode 100644 webapp/src/lib/components/EventsSection.svelte create mode 100644 webapp/src/lib/components/ForgeTypeSelector.svelte create mode 100644 webapp/src/lib/components/Icons.svelte create mode 100644 webapp/src/lib/components/InstancesSection.svelte create mode 100644 webapp/src/lib/components/JsonEditor.svelte create mode 100644 webapp/src/lib/components/LoadingState.svelte create mode 100644 webapp/src/lib/components/MobileCard.svelte create mode 100644 webapp/src/lib/components/Modal.svelte create mode 100644 webapp/src/lib/components/Navigation.svelte create mode 100644 webapp/src/lib/components/PageHeader.svelte create mode 100644 webapp/src/lib/components/PoolsSection.svelte create mode 100644 webapp/src/lib/components/SearchBar.svelte create mode 100644 webapp/src/lib/components/SearchFilterBar.svelte create mode 100644 webapp/src/lib/components/TablePagination.svelte create mode 100644 webapp/src/lib/components/Toast.svelte create mode 100644 webapp/src/lib/components/Tooltip.svelte create mode 100644 webapp/src/lib/components/UpdateEnterpriseModal.svelte create mode 100644 webapp/src/lib/components/UpdateEntityModal.svelte create mode 100644 webapp/src/lib/components/UpdateOrganizationModal.svelte create mode 100644 webapp/src/lib/components/UpdatePoolModal.svelte create mode 100644 webapp/src/lib/components/UpdateRepositoryModal.svelte create mode 100644 webapp/src/lib/components/UpdateScaleSetModal.svelte create mode 100644 webapp/src/lib/components/WebhookSection.svelte create mode 100644 webapp/src/lib/components/cells/ActionsCell.svelte create mode 100644 webapp/src/lib/components/cells/EndpointCell.svelte create mode 100644 webapp/src/lib/components/cells/EntityCell.svelte create mode 100644 webapp/src/lib/components/cells/GenericCell.svelte create mode 100644 webapp/src/lib/components/cells/InstancePoolCell.svelte create mode 100644 webapp/src/lib/components/cells/PoolEntityCell.svelte create mode 100644 webapp/src/lib/components/cells/StatusCell.svelte create mode 100644 webapp/src/lib/components/cells/index.ts create mode 100644 webapp/src/lib/stores/auth.ts create mode 100644 webapp/src/lib/stores/eager-cache.ts create mode 100644 webapp/src/lib/stores/toast.ts create mode 100644 webapp/src/lib/stores/websocket.ts create mode 100644 webapp/src/lib/utils/common.ts create mode 100644 webapp/src/lib/utils/status.ts create mode 100644 webapp/src/openapitools.json create mode 100644 webapp/src/routes/+layout.svelte create mode 100644 webapp/src/routes/+layout.ts create mode 100644 webapp/src/routes/+page.svelte create mode 100644 webapp/src/routes/credentials/+page.svelte create mode 100644 webapp/src/routes/endpoints/+page.svelte create mode 100644 webapp/src/routes/enterprises/+page.svelte create mode 100644 webapp/src/routes/enterprises/[id]/+page.svelte create mode 100644 webapp/src/routes/init/+page.svelte create mode 100644 webapp/src/routes/instances/+page.svelte create mode 100644 webapp/src/routes/instances/[id]/+page.svelte create mode 100644 webapp/src/routes/login/+page.svelte create mode 100644 webapp/src/routes/organizations/+page.svelte create mode 100644 webapp/src/routes/organizations/[id]/+page.svelte create mode 100644 webapp/src/routes/pools/+page.svelte create mode 100644 webapp/src/routes/pools/[id]/+page.svelte create mode 100644 webapp/src/routes/repositories/+page.svelte create mode 100644 webapp/src/routes/repositories/[id]/+page.svelte create mode 100644 webapp/src/routes/scalesets/+page.svelte create mode 100644 webapp/src/routes/scalesets/[id]/+page.svelte create mode 100644 webapp/static/assets/garm-dark.svg create mode 100644 webapp/static/assets/garm-light.svg create mode 100644 webapp/static/assets/gitea.svg create mode 100644 webapp/static/assets/github-mark-white.svg create mode 100644 webapp/static/assets/github-mark.svg create mode 100644 webapp/static/favicon-dark.png create mode 100644 webapp/static/favicon-light.png create mode 100644 webapp/svelte.config.js create mode 100644 webapp/swagger.yaml create mode 100644 webapp/tailwind.config.js create mode 100644 webapp/tsconfig.json create mode 100644 webapp/vite.config.ts diff --git a/.gitignore b/.gitignore index 4e8b3d79..54c931c8 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,5 @@ node_modules/ .svelte-kit/ debug.html git_push.sh +webapp/src/lib/api/generated/docs +.env diff --git a/.mockery.yaml b/.mockery.yaml new file mode 100644 index 00000000..b7858821 --- /dev/null +++ b/.mockery.yaml @@ -0,0 +1,27 @@ +with-expecter: true +dir: "mocks" +mockname: "{{ .InterfaceName }}" +outpkg: "mocks" +filename: "{{ .InterfaceName }}.go" +# V3 compatibility settings +resolve-type-alias: false +disable-version-string: true +issue-845-fix: true +packages: + # Database store interfaces + github.com/cloudbase/garm/database/common: + interfaces: + Store: + config: + dir: "{{ .InterfaceDir }}/mocks" + # Runner interfaces + github.com/cloudbase/garm/runner: + interfaces: + PoolManagerController: + config: + dir: "{{ .InterfaceDir }}/mocks" + # Runner common interfaces (generate all interfaces in this package) + github.com/cloudbase/garm/runner/common: + config: + dir: "{{ .InterfaceDir }}/mocks" + all: true \ No newline at end of file diff --git a/Makefile b/Makefile index 9a09e999..56d2d7c9 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ export SHELLOPTS:=$(if $(SHELLOPTS),$(SHELLOPTS):)pipefail:errexit GEN_PASSWORD=$(shell (/usr/bin/apg -n1 -m32)) IMAGE_TAG = garm-build +HAS_TAILWINDCSS=$(shell (which tailwindcss || echo "no")) IMAGE_BUILDER=$(shell (which docker || which podman)) IS_PODMAN=$(shell (($(IMAGE_BUILDER) --version | grep -q podman) && echo "yes" || echo "no")) USER_ID=$(if $(filter yes,$(IS_PODMAN)),0,$(shell id -u)) @@ -55,6 +56,21 @@ build: ## Build garm @$(GO) build -ldflags "-s -w -X github.com/cloudbase/garm/util/appdefaults.Version=${VERSION}" -tags osusergo,netgo,sqlite_omit_load_extension -o bin/garm-cli ./cmd/garm-cli @echo Binaries are available in $(PWD)/bin +.PHONY: build-webui +build-webui: + @echo Building GARM web ui + ./build-webapp.sh + rm -rf webapp/assets/_app + cp -r webapp/build/* webapp/assets/ + +.PHONY: generate +generate: ## Run go generate after checking required tools are in PATH + @echo Checking required tools... + @which openapi-generator-cli > /dev/null || (echo "Error: openapi-generator-cli not found in PATH" && exit 1) + @which tailwindcss > /dev/null || (echo "Error: tailwindcss not found in PATH" && exit 1) + @echo Running go generate + @$(GO) generate ./... + test: verify go-test ## Run tests ##@ Release diff --git a/README.md b/README.md index 5d09135f..24fbbcc4 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ - [Installing on Kubernetes](#installing-on-kubernetes) - [Configuring GARM for GHES](#configuring-garm-for-ghes) - [Configuring GARM for Gitea](#configuring-garm-for-gitea) + - [Enabling the web UI](#enabling-the-web-ui) - [Using GARM](#using-garm) - [Supported providers](#supported-providers) - [Installing external providers](#installing-external-providers) @@ -78,6 +79,17 @@ GARM supports creating pools and scale sets in either GitHub itself or in your o GARM now has support for Gitea (>=1.24.0). For information on getting started with Gitea, see the [Gitea quickstart](/doc/gitea.md) document. +## Enabling the web UI + +GARM now ships with a single page application. To enable it, add the following to your GARM config: + +```toml +[apiserver.webui] + enable = true +``` + +Check the [README.md](/webapp/README.md) file for details on the web UI. + ## Using GARM GARM is designed with simplicity in mind. At least we try to keep it as simple as possible. We're aware that adding a new tool in your workflow can be painful, especially when you already have to deal with so many. The cognitive load for OPS has reached a level where it feels overwhelming at times to even wrap your head around a new tool. As such, we believe that tools should be simple, should take no more than a few hours to understand and set up and if you absolutely need to interact with the tool, it should be as intuitive as possible. Although we try our best to make this happen, we're aware that GARM has some rough edges, especially for new users. If you encounter issues or feel like the setup process was too complicated, please let us know. We're always looking to improve the user experience. diff --git a/apiserver/controllers/controllers.go b/apiserver/controllers/controllers.go index 2a57f9cf..0c610c38 100644 --- a/apiserver/controllers/controllers.go +++ b/apiserver/controllers/controllers.go @@ -20,6 +20,7 @@ import ( "io" "log/slog" "net/http" + "net/url" "strings" "github.com/gorilla/mux" @@ -31,17 +32,42 @@ import ( "github.com/cloudbase/garm/apiserver/events" "github.com/cloudbase/garm/apiserver/params" "github.com/cloudbase/garm/auth" + "github.com/cloudbase/garm/config" "github.com/cloudbase/garm/metrics" runnerParams "github.com/cloudbase/garm/params" "github.com/cloudbase/garm/runner" //nolint:typecheck + garmUtil "github.com/cloudbase/garm/util" wsWriter "github.com/cloudbase/garm/websocket" ) -func NewAPIController(r *runner.Runner, authenticator *auth.Authenticator, hub *wsWriter.Hub) (*APIController, error) { +func NewAPIController(r *runner.Runner, authenticator *auth.Authenticator, hub *wsWriter.Hub, apiCfg config.APIServer) (*APIController, error) { controllerInfo, err := r.GetControllerInfo(auth.GetAdminContext(context.Background())) if err != nil { return nil, errors.Wrap(err, "failed to get controller info") } + var checkOrigin func(r *http.Request) bool + if len(apiCfg.CORSOrigins) > 0 { + checkOrigin = func(r *http.Request) bool { + origin := r.Header["Origin"] + if len(origin) == 0 { + return true + } + u, err := url.Parse(origin[0]) + if err != nil { + return false + } + for _, val := range apiCfg.CORSOrigins { + corsVal, err := url.Parse(val) + if err != nil { + continue + } + if garmUtil.ASCIIEqualFold(u.Host, corsVal.Host) { + return true + } + } + return false + } + } return &APIController{ r: r, auth: authenticator, @@ -49,6 +75,7 @@ func NewAPIController(r *runner.Runner, authenticator *auth.Authenticator, hub * upgrader: websocket.Upgrader{ ReadBufferSize: 1024, WriteBufferSize: 16384, + CheckOrigin: checkOrigin, }, controllerID: controllerInfo.ControllerID.String(), }, nil diff --git a/apiserver/routers/routers.go b/apiserver/routers/routers.go index 2036b5f1..ff241165 100644 --- a/apiserver/routers/routers.go +++ b/apiserver/routers/routers.go @@ -57,6 +57,8 @@ import ( "github.com/cloudbase/garm/apiserver/controllers" "github.com/cloudbase/garm/auth" + "github.com/cloudbase/garm/config" + spaAssets "github.com/cloudbase/garm/webapp/assets" ) func WithMetricsRouter(parentRouter *mux.Router, disableAuth bool, metricsMiddlerware auth.Middleware) *mux.Router { @@ -82,6 +84,30 @@ func WithDebugServer(parentRouter *mux.Router) *mux.Router { return parentRouter } +func WithWebUI(parentRouter *mux.Router, apiConfig config.APIServer) *mux.Router { + if parentRouter == nil { + return nil + } + + if apiConfig.WebUI.EnableWebUI { + slog.Info("WebUI is enabled, adding webapp routes") + webappPath := apiConfig.WebUI.GetWebappPath() + slog.Info("Using webapp path", "path", webappPath) + // Accessing / should redirect to the UI + parentRouter.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + http.Redirect(w, r, webappPath, http.StatusMovedPermanently) // 301 + }) + // Serve the SPA with dynamic path + parentRouter.PathPrefix(webappPath).HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + spaAssets.ServeSPAWithPath(w, r, webappPath) + }).Methods("GET") + } else { + slog.Info("WebUI is disabled, skipping webapp routes") + } + + return parentRouter +} + func requestLogger(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // gathers metrics from the upstream handlers @@ -505,7 +531,7 @@ func NewAPIRouter(han *controllers.APIController, authMiddleware, initMiddleware apiRouter.Handle("/ws/events/", http.HandlerFunc(han.EventsHandler)).Methods("GET") apiRouter.Handle("/ws/events", http.HandlerFunc(han.EventsHandler)).Methods("GET") - // NotFound handler + // NotFound handler - this should be last apiRouter.PathPrefix("/").HandlerFunc(han.NotFoundHandler).Methods("GET", "POST", "PUT", "DELETE", "OPTIONS") return router } diff --git a/auth/init_required.go b/auth/init_required.go index 2d3e1715..3ef31d70 100644 --- a/auth/init_required.go +++ b/auth/init_required.go @@ -38,8 +38,8 @@ type initRequired struct { func (i *initRequired) Middleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ctx := r.Context() - ctrlInfo, err := i.store.ControllerInfo() - if err != nil || ctrlInfo.ControllerID.String() == "" { + + if !i.store.HasAdminUser(ctx) { w.Header().Add("Content-Type", "application/json") w.WriteHeader(http.StatusConflict) if err := json.NewEncoder(w).Encode(params.InitializationRequired); err != nil { diff --git a/build-webapp.sh b/build-webapp.sh new file mode 100755 index 00000000..01b13c04 --- /dev/null +++ b/build-webapp.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +echo "Building GARM SPA (SvelteKit)..." + +# Navigate to webapp directory +cd webapp + +# Install dependencies if node_modules doesn't exist +npm install + +# Build the SPA +echo "Building SPA..." +npm run build +echo "SPA built successfully!" diff --git a/cmd/garm/main.go b/cmd/garm/main.go index f0cca079..226a9e2a 100644 --- a/cmd/garm/main.go +++ b/cmd/garm/main.go @@ -283,7 +283,7 @@ func main() { } authenticator := auth.NewAuthenticator(cfg.JWTAuth, db) - controller, err := controllers.NewAPIController(runner, authenticator, hub) + controller, err := controllers.NewAPIController(runner, authenticator, hub, cfg.APIServer) if err != nil { log.Fatalf("failed to create controller: %+v", err) } @@ -315,6 +315,9 @@ func main() { router := routers.NewAPIRouter(controller, jwtMiddleware, initMiddleware, urlsRequiredMiddleware, instanceMiddleware, cfg.Default.EnableWebhookManagement) + // Add WebUI routes + router = routers.WithWebUI(router, cfg.APIServer) + // start the metrics collector if cfg.Metrics.Enable { slog.InfoContext(ctx, "setting up metric routes") diff --git a/config/config.go b/config/config.go index 57ec0e80..cdbec393 100644 --- a/config/config.go +++ b/config/config.go @@ -663,6 +663,21 @@ func (m *Metrics) Duration() time.Duration { return duration } +// WebUI holds configuration for the web UI +type WebUI struct { + EnableWebUI bool `toml:"enable" json:"enable"` +} + +// Validate validates the WebUI config +func (w *WebUI) Validate() error { + return nil +} + +// GetWebappPath returns the webapp path with proper formatting +func (w *WebUI) GetWebappPath() string { + return "/ui/" +} + // APIServer holds configuration for the API server // worker type APIServer struct { @@ -671,6 +686,7 @@ type APIServer struct { UseTLS bool `toml:"use_tls" json:"use-tls"` TLSConfig TLSConfig `toml:"tls" json:"tls"` CORSOrigins []string `toml:"cors_origins" json:"cors-origins"` + WebUI WebUI `toml:"webui" json:"webui"` } // BindAddress returns a host:port string. @@ -696,6 +712,11 @@ func (a *APIServer) Validate() error { // when we try to bind to it. return fmt.Errorf("invalid IP address") } + + if err := a.WebUI.Validate(); err != nil { + return fmt.Errorf("invalid webui config: %w", err) + } + return nil } diff --git a/database/common/mocks/Store.go b/database/common/mocks/Store.go index ec107854..26a80b0a 100644 --- a/database/common/mocks/Store.go +++ b/database/common/mocks/Store.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.3. DO NOT EDIT. +// Code generated by mockery. DO NOT EDIT. package mocks @@ -14,6 +14,14 @@ type Store struct { mock.Mock } +type Store_Expecter struct { + mock *mock.Mock +} + +func (_m *Store) EXPECT() *Store_Expecter { + return &Store_Expecter{mock: &_m.Mock} +} + // AddEntityEvent provides a mock function with given fields: ctx, entity, event, eventLevel, statusMessage, maxEvents func (_m *Store) AddEntityEvent(ctx context.Context, entity params.ForgeEntity, event params.EventType, eventLevel params.EventLevel, statusMessage string, maxEvents int) error { ret := _m.Called(ctx, entity, event, eventLevel, statusMessage, maxEvents) @@ -32,6 +40,39 @@ func (_m *Store) AddEntityEvent(ctx context.Context, entity params.ForgeEntity, return r0 } +// Store_AddEntityEvent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddEntityEvent' +type Store_AddEntityEvent_Call struct { + *mock.Call +} + +// AddEntityEvent is a helper method to define mock.On call +// - ctx context.Context +// - entity params.ForgeEntity +// - event params.EventType +// - eventLevel params.EventLevel +// - statusMessage string +// - maxEvents int +func (_e *Store_Expecter) AddEntityEvent(ctx interface{}, entity interface{}, event interface{}, eventLevel interface{}, statusMessage interface{}, maxEvents interface{}) *Store_AddEntityEvent_Call { + return &Store_AddEntityEvent_Call{Call: _e.mock.On("AddEntityEvent", ctx, entity, event, eventLevel, statusMessage, maxEvents)} +} + +func (_c *Store_AddEntityEvent_Call) Run(run func(ctx context.Context, entity params.ForgeEntity, event params.EventType, eventLevel params.EventLevel, statusMessage string, maxEvents int)) *Store_AddEntityEvent_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.ForgeEntity), args[2].(params.EventType), args[3].(params.EventLevel), args[4].(string), args[5].(int)) + }) + return _c +} + +func (_c *Store_AddEntityEvent_Call) Return(_a0 error) *Store_AddEntityEvent_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_AddEntityEvent_Call) RunAndReturn(run func(context.Context, params.ForgeEntity, params.EventType, params.EventLevel, string, int) error) *Store_AddEntityEvent_Call { + _c.Call.Return(run) + return _c +} + // AddInstanceEvent provides a mock function with given fields: ctx, instanceName, event, eventLevel, eventMessage func (_m *Store) AddInstanceEvent(ctx context.Context, instanceName string, event params.EventType, eventLevel params.EventLevel, eventMessage string) error { ret := _m.Called(ctx, instanceName, event, eventLevel, eventMessage) @@ -50,6 +91,38 @@ func (_m *Store) AddInstanceEvent(ctx context.Context, instanceName string, even return r0 } +// Store_AddInstanceEvent_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AddInstanceEvent' +type Store_AddInstanceEvent_Call struct { + *mock.Call +} + +// AddInstanceEvent is a helper method to define mock.On call +// - ctx context.Context +// - instanceName string +// - event params.EventType +// - eventLevel params.EventLevel +// - eventMessage string +func (_e *Store_Expecter) AddInstanceEvent(ctx interface{}, instanceName interface{}, event interface{}, eventLevel interface{}, eventMessage interface{}) *Store_AddInstanceEvent_Call { + return &Store_AddInstanceEvent_Call{Call: _e.mock.On("AddInstanceEvent", ctx, instanceName, event, eventLevel, eventMessage)} +} + +func (_c *Store_AddInstanceEvent_Call) Run(run func(ctx context.Context, instanceName string, event params.EventType, eventLevel params.EventLevel, eventMessage string)) *Store_AddInstanceEvent_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(params.EventType), args[3].(params.EventLevel), args[4].(string)) + }) + return _c +} + +func (_c *Store_AddInstanceEvent_Call) Return(_a0 error) *Store_AddInstanceEvent_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_AddInstanceEvent_Call) RunAndReturn(run func(context.Context, string, params.EventType, params.EventLevel, string) error) *Store_AddInstanceEvent_Call { + _c.Call.Return(run) + return _c +} + // BreakLockJobIsQueued provides a mock function with given fields: ctx, jobID func (_m *Store) BreakLockJobIsQueued(ctx context.Context, jobID int64) error { ret := _m.Called(ctx, jobID) @@ -68,6 +141,35 @@ func (_m *Store) BreakLockJobIsQueued(ctx context.Context, jobID int64) error { return r0 } +// Store_BreakLockJobIsQueued_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'BreakLockJobIsQueued' +type Store_BreakLockJobIsQueued_Call struct { + *mock.Call +} + +// BreakLockJobIsQueued is a helper method to define mock.On call +// - ctx context.Context +// - jobID int64 +func (_e *Store_Expecter) BreakLockJobIsQueued(ctx interface{}, jobID interface{}) *Store_BreakLockJobIsQueued_Call { + return &Store_BreakLockJobIsQueued_Call{Call: _e.mock.On("BreakLockJobIsQueued", ctx, jobID)} +} + +func (_c *Store_BreakLockJobIsQueued_Call) Run(run func(ctx context.Context, jobID int64)) *Store_BreakLockJobIsQueued_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *Store_BreakLockJobIsQueued_Call) Return(_a0 error) *Store_BreakLockJobIsQueued_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_BreakLockJobIsQueued_Call) RunAndReturn(run func(context.Context, int64) error) *Store_BreakLockJobIsQueued_Call { + _c.Call.Return(run) + return _c +} + // ControllerInfo provides a mock function with no fields func (_m *Store) ControllerInfo() (params.ControllerInfo, error) { ret := _m.Called() @@ -96,6 +198,33 @@ func (_m *Store) ControllerInfo() (params.ControllerInfo, error) { return r0, r1 } +// Store_ControllerInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ControllerInfo' +type Store_ControllerInfo_Call struct { + *mock.Call +} + +// ControllerInfo is a helper method to define mock.On call +func (_e *Store_Expecter) ControllerInfo() *Store_ControllerInfo_Call { + return &Store_ControllerInfo_Call{Call: _e.mock.On("ControllerInfo")} +} + +func (_c *Store_ControllerInfo_Call) Run(run func()) *Store_ControllerInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Store_ControllerInfo_Call) Return(_a0 params.ControllerInfo, _a1 error) *Store_ControllerInfo_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ControllerInfo_Call) RunAndReturn(run func() (params.ControllerInfo, error)) *Store_ControllerInfo_Call { + _c.Call.Return(run) + return _c +} + // CreateEnterprise provides a mock function with given fields: ctx, name, credentialsName, webhookSecret, poolBalancerType func (_m *Store) CreateEnterprise(ctx context.Context, name string, credentialsName params.ForgeCredentials, webhookSecret string, poolBalancerType params.PoolBalancerType) (params.Enterprise, error) { ret := _m.Called(ctx, name, credentialsName, webhookSecret, poolBalancerType) @@ -124,6 +253,38 @@ func (_m *Store) CreateEnterprise(ctx context.Context, name string, credentialsN return r0, r1 } +// Store_CreateEnterprise_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEnterprise' +type Store_CreateEnterprise_Call struct { + *mock.Call +} + +// CreateEnterprise is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - credentialsName params.ForgeCredentials +// - webhookSecret string +// - poolBalancerType params.PoolBalancerType +func (_e *Store_Expecter) CreateEnterprise(ctx interface{}, name interface{}, credentialsName interface{}, webhookSecret interface{}, poolBalancerType interface{}) *Store_CreateEnterprise_Call { + return &Store_CreateEnterprise_Call{Call: _e.mock.On("CreateEnterprise", ctx, name, credentialsName, webhookSecret, poolBalancerType)} +} + +func (_c *Store_CreateEnterprise_Call) Run(run func(ctx context.Context, name string, credentialsName params.ForgeCredentials, webhookSecret string, poolBalancerType params.PoolBalancerType)) *Store_CreateEnterprise_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(params.ForgeCredentials), args[3].(string), args[4].(params.PoolBalancerType)) + }) + return _c +} + +func (_c *Store_CreateEnterprise_Call) Return(_a0 params.Enterprise, _a1 error) *Store_CreateEnterprise_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_CreateEnterprise_Call) RunAndReturn(run func(context.Context, string, params.ForgeCredentials, string, params.PoolBalancerType) (params.Enterprise, error)) *Store_CreateEnterprise_Call { + _c.Call.Return(run) + return _c +} + // CreateEntityPool provides a mock function with given fields: ctx, entity, param func (_m *Store) CreateEntityPool(ctx context.Context, entity params.ForgeEntity, param params.CreatePoolParams) (params.Pool, error) { ret := _m.Called(ctx, entity, param) @@ -152,6 +313,36 @@ func (_m *Store) CreateEntityPool(ctx context.Context, entity params.ForgeEntity return r0, r1 } +// Store_CreateEntityPool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEntityPool' +type Store_CreateEntityPool_Call struct { + *mock.Call +} + +// CreateEntityPool is a helper method to define mock.On call +// - ctx context.Context +// - entity params.ForgeEntity +// - param params.CreatePoolParams +func (_e *Store_Expecter) CreateEntityPool(ctx interface{}, entity interface{}, param interface{}) *Store_CreateEntityPool_Call { + return &Store_CreateEntityPool_Call{Call: _e.mock.On("CreateEntityPool", ctx, entity, param)} +} + +func (_c *Store_CreateEntityPool_Call) Run(run func(ctx context.Context, entity params.ForgeEntity, param params.CreatePoolParams)) *Store_CreateEntityPool_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.ForgeEntity), args[2].(params.CreatePoolParams)) + }) + return _c +} + +func (_c *Store_CreateEntityPool_Call) Return(_a0 params.Pool, _a1 error) *Store_CreateEntityPool_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_CreateEntityPool_Call) RunAndReturn(run func(context.Context, params.ForgeEntity, params.CreatePoolParams) (params.Pool, error)) *Store_CreateEntityPool_Call { + _c.Call.Return(run) + return _c +} + // CreateEntityScaleSet provides a mock function with given fields: _a0, entity, param func (_m *Store) CreateEntityScaleSet(_a0 context.Context, entity params.ForgeEntity, param params.CreateScaleSetParams) (params.ScaleSet, error) { ret := _m.Called(_a0, entity, param) @@ -180,6 +371,36 @@ func (_m *Store) CreateEntityScaleSet(_a0 context.Context, entity params.ForgeEn return r0, r1 } +// Store_CreateEntityScaleSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEntityScaleSet' +type Store_CreateEntityScaleSet_Call struct { + *mock.Call +} + +// CreateEntityScaleSet is a helper method to define mock.On call +// - _a0 context.Context +// - entity params.ForgeEntity +// - param params.CreateScaleSetParams +func (_e *Store_Expecter) CreateEntityScaleSet(_a0 interface{}, entity interface{}, param interface{}) *Store_CreateEntityScaleSet_Call { + return &Store_CreateEntityScaleSet_Call{Call: _e.mock.On("CreateEntityScaleSet", _a0, entity, param)} +} + +func (_c *Store_CreateEntityScaleSet_Call) Run(run func(_a0 context.Context, entity params.ForgeEntity, param params.CreateScaleSetParams)) *Store_CreateEntityScaleSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.ForgeEntity), args[2].(params.CreateScaleSetParams)) + }) + return _c +} + +func (_c *Store_CreateEntityScaleSet_Call) Return(scaleSet params.ScaleSet, err error) *Store_CreateEntityScaleSet_Call { + _c.Call.Return(scaleSet, err) + return _c +} + +func (_c *Store_CreateEntityScaleSet_Call) RunAndReturn(run func(context.Context, params.ForgeEntity, params.CreateScaleSetParams) (params.ScaleSet, error)) *Store_CreateEntityScaleSet_Call { + _c.Call.Return(run) + return _c +} + // CreateGiteaCredentials provides a mock function with given fields: ctx, param func (_m *Store) CreateGiteaCredentials(ctx context.Context, param params.CreateGiteaCredentialsParams) (params.ForgeCredentials, error) { ret := _m.Called(ctx, param) @@ -208,6 +429,35 @@ func (_m *Store) CreateGiteaCredentials(ctx context.Context, param params.Create return r0, r1 } +// Store_CreateGiteaCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateGiteaCredentials' +type Store_CreateGiteaCredentials_Call struct { + *mock.Call +} + +// CreateGiteaCredentials is a helper method to define mock.On call +// - ctx context.Context +// - param params.CreateGiteaCredentialsParams +func (_e *Store_Expecter) CreateGiteaCredentials(ctx interface{}, param interface{}) *Store_CreateGiteaCredentials_Call { + return &Store_CreateGiteaCredentials_Call{Call: _e.mock.On("CreateGiteaCredentials", ctx, param)} +} + +func (_c *Store_CreateGiteaCredentials_Call) Run(run func(ctx context.Context, param params.CreateGiteaCredentialsParams)) *Store_CreateGiteaCredentials_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.CreateGiteaCredentialsParams)) + }) + return _c +} + +func (_c *Store_CreateGiteaCredentials_Call) Return(gtCreds params.ForgeCredentials, err error) *Store_CreateGiteaCredentials_Call { + _c.Call.Return(gtCreds, err) + return _c +} + +func (_c *Store_CreateGiteaCredentials_Call) RunAndReturn(run func(context.Context, params.CreateGiteaCredentialsParams) (params.ForgeCredentials, error)) *Store_CreateGiteaCredentials_Call { + _c.Call.Return(run) + return _c +} + // CreateGiteaEndpoint provides a mock function with given fields: _a0, param func (_m *Store) CreateGiteaEndpoint(_a0 context.Context, param params.CreateGiteaEndpointParams) (params.ForgeEndpoint, error) { ret := _m.Called(_a0, param) @@ -236,6 +486,35 @@ func (_m *Store) CreateGiteaEndpoint(_a0 context.Context, param params.CreateGit return r0, r1 } +// Store_CreateGiteaEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateGiteaEndpoint' +type Store_CreateGiteaEndpoint_Call struct { + *mock.Call +} + +// CreateGiteaEndpoint is a helper method to define mock.On call +// - _a0 context.Context +// - param params.CreateGiteaEndpointParams +func (_e *Store_Expecter) CreateGiteaEndpoint(_a0 interface{}, param interface{}) *Store_CreateGiteaEndpoint_Call { + return &Store_CreateGiteaEndpoint_Call{Call: _e.mock.On("CreateGiteaEndpoint", _a0, param)} +} + +func (_c *Store_CreateGiteaEndpoint_Call) Run(run func(_a0 context.Context, param params.CreateGiteaEndpointParams)) *Store_CreateGiteaEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.CreateGiteaEndpointParams)) + }) + return _c +} + +func (_c *Store_CreateGiteaEndpoint_Call) Return(ghEndpoint params.ForgeEndpoint, err error) *Store_CreateGiteaEndpoint_Call { + _c.Call.Return(ghEndpoint, err) + return _c +} + +func (_c *Store_CreateGiteaEndpoint_Call) RunAndReturn(run func(context.Context, params.CreateGiteaEndpointParams) (params.ForgeEndpoint, error)) *Store_CreateGiteaEndpoint_Call { + _c.Call.Return(run) + return _c +} + // CreateGithubCredentials provides a mock function with given fields: ctx, param func (_m *Store) CreateGithubCredentials(ctx context.Context, param params.CreateGithubCredentialsParams) (params.ForgeCredentials, error) { ret := _m.Called(ctx, param) @@ -264,6 +543,35 @@ func (_m *Store) CreateGithubCredentials(ctx context.Context, param params.Creat return r0, r1 } +// Store_CreateGithubCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateGithubCredentials' +type Store_CreateGithubCredentials_Call struct { + *mock.Call +} + +// CreateGithubCredentials is a helper method to define mock.On call +// - ctx context.Context +// - param params.CreateGithubCredentialsParams +func (_e *Store_Expecter) CreateGithubCredentials(ctx interface{}, param interface{}) *Store_CreateGithubCredentials_Call { + return &Store_CreateGithubCredentials_Call{Call: _e.mock.On("CreateGithubCredentials", ctx, param)} +} + +func (_c *Store_CreateGithubCredentials_Call) Run(run func(ctx context.Context, param params.CreateGithubCredentialsParams)) *Store_CreateGithubCredentials_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.CreateGithubCredentialsParams)) + }) + return _c +} + +func (_c *Store_CreateGithubCredentials_Call) Return(_a0 params.ForgeCredentials, _a1 error) *Store_CreateGithubCredentials_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_CreateGithubCredentials_Call) RunAndReturn(run func(context.Context, params.CreateGithubCredentialsParams) (params.ForgeCredentials, error)) *Store_CreateGithubCredentials_Call { + _c.Call.Return(run) + return _c +} + // CreateGithubEndpoint provides a mock function with given fields: ctx, param func (_m *Store) CreateGithubEndpoint(ctx context.Context, param params.CreateGithubEndpointParams) (params.ForgeEndpoint, error) { ret := _m.Called(ctx, param) @@ -292,6 +600,35 @@ func (_m *Store) CreateGithubEndpoint(ctx context.Context, param params.CreateGi return r0, r1 } +// Store_CreateGithubEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateGithubEndpoint' +type Store_CreateGithubEndpoint_Call struct { + *mock.Call +} + +// CreateGithubEndpoint is a helper method to define mock.On call +// - ctx context.Context +// - param params.CreateGithubEndpointParams +func (_e *Store_Expecter) CreateGithubEndpoint(ctx interface{}, param interface{}) *Store_CreateGithubEndpoint_Call { + return &Store_CreateGithubEndpoint_Call{Call: _e.mock.On("CreateGithubEndpoint", ctx, param)} +} + +func (_c *Store_CreateGithubEndpoint_Call) Run(run func(ctx context.Context, param params.CreateGithubEndpointParams)) *Store_CreateGithubEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.CreateGithubEndpointParams)) + }) + return _c +} + +func (_c *Store_CreateGithubEndpoint_Call) Return(_a0 params.ForgeEndpoint, _a1 error) *Store_CreateGithubEndpoint_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_CreateGithubEndpoint_Call) RunAndReturn(run func(context.Context, params.CreateGithubEndpointParams) (params.ForgeEndpoint, error)) *Store_CreateGithubEndpoint_Call { + _c.Call.Return(run) + return _c +} + // CreateInstance provides a mock function with given fields: ctx, poolID, param func (_m *Store) CreateInstance(ctx context.Context, poolID string, param params.CreateInstanceParams) (params.Instance, error) { ret := _m.Called(ctx, poolID, param) @@ -320,6 +657,36 @@ func (_m *Store) CreateInstance(ctx context.Context, poolID string, param params return r0, r1 } +// Store_CreateInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateInstance' +type Store_CreateInstance_Call struct { + *mock.Call +} + +// CreateInstance is a helper method to define mock.On call +// - ctx context.Context +// - poolID string +// - param params.CreateInstanceParams +func (_e *Store_Expecter) CreateInstance(ctx interface{}, poolID interface{}, param interface{}) *Store_CreateInstance_Call { + return &Store_CreateInstance_Call{Call: _e.mock.On("CreateInstance", ctx, poolID, param)} +} + +func (_c *Store_CreateInstance_Call) Run(run func(ctx context.Context, poolID string, param params.CreateInstanceParams)) *Store_CreateInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(params.CreateInstanceParams)) + }) + return _c +} + +func (_c *Store_CreateInstance_Call) Return(_a0 params.Instance, _a1 error) *Store_CreateInstance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_CreateInstance_Call) RunAndReturn(run func(context.Context, string, params.CreateInstanceParams) (params.Instance, error)) *Store_CreateInstance_Call { + _c.Call.Return(run) + return _c +} + // CreateOrUpdateJob provides a mock function with given fields: ctx, job func (_m *Store) CreateOrUpdateJob(ctx context.Context, job params.Job) (params.Job, error) { ret := _m.Called(ctx, job) @@ -348,6 +715,35 @@ func (_m *Store) CreateOrUpdateJob(ctx context.Context, job params.Job) (params. return r0, r1 } +// Store_CreateOrUpdateJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOrUpdateJob' +type Store_CreateOrUpdateJob_Call struct { + *mock.Call +} + +// CreateOrUpdateJob is a helper method to define mock.On call +// - ctx context.Context +// - job params.Job +func (_e *Store_Expecter) CreateOrUpdateJob(ctx interface{}, job interface{}) *Store_CreateOrUpdateJob_Call { + return &Store_CreateOrUpdateJob_Call{Call: _e.mock.On("CreateOrUpdateJob", ctx, job)} +} + +func (_c *Store_CreateOrUpdateJob_Call) Run(run func(ctx context.Context, job params.Job)) *Store_CreateOrUpdateJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.Job)) + }) + return _c +} + +func (_c *Store_CreateOrUpdateJob_Call) Return(_a0 params.Job, _a1 error) *Store_CreateOrUpdateJob_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_CreateOrUpdateJob_Call) RunAndReturn(run func(context.Context, params.Job) (params.Job, error)) *Store_CreateOrUpdateJob_Call { + _c.Call.Return(run) + return _c +} + // CreateOrganization provides a mock function with given fields: ctx, name, credentials, webhookSecret, poolBalancerType func (_m *Store) CreateOrganization(ctx context.Context, name string, credentials params.ForgeCredentials, webhookSecret string, poolBalancerType params.PoolBalancerType) (params.Organization, error) { ret := _m.Called(ctx, name, credentials, webhookSecret, poolBalancerType) @@ -376,6 +772,38 @@ func (_m *Store) CreateOrganization(ctx context.Context, name string, credential return r0, r1 } +// Store_CreateOrganization_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOrganization' +type Store_CreateOrganization_Call struct { + *mock.Call +} + +// CreateOrganization is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - credentials params.ForgeCredentials +// - webhookSecret string +// - poolBalancerType params.PoolBalancerType +func (_e *Store_Expecter) CreateOrganization(ctx interface{}, name interface{}, credentials interface{}, webhookSecret interface{}, poolBalancerType interface{}) *Store_CreateOrganization_Call { + return &Store_CreateOrganization_Call{Call: _e.mock.On("CreateOrganization", ctx, name, credentials, webhookSecret, poolBalancerType)} +} + +func (_c *Store_CreateOrganization_Call) Run(run func(ctx context.Context, name string, credentials params.ForgeCredentials, webhookSecret string, poolBalancerType params.PoolBalancerType)) *Store_CreateOrganization_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(params.ForgeCredentials), args[3].(string), args[4].(params.PoolBalancerType)) + }) + return _c +} + +func (_c *Store_CreateOrganization_Call) Return(org params.Organization, err error) *Store_CreateOrganization_Call { + _c.Call.Return(org, err) + return _c +} + +func (_c *Store_CreateOrganization_Call) RunAndReturn(run func(context.Context, string, params.ForgeCredentials, string, params.PoolBalancerType) (params.Organization, error)) *Store_CreateOrganization_Call { + _c.Call.Return(run) + return _c +} + // CreateRepository provides a mock function with given fields: ctx, owner, name, credentials, webhookSecret, poolBalancerType func (_m *Store) CreateRepository(ctx context.Context, owner string, name string, credentials params.ForgeCredentials, webhookSecret string, poolBalancerType params.PoolBalancerType) (params.Repository, error) { ret := _m.Called(ctx, owner, name, credentials, webhookSecret, poolBalancerType) @@ -404,6 +832,39 @@ func (_m *Store) CreateRepository(ctx context.Context, owner string, name string return r0, r1 } +// Store_CreateRepository_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRepository' +type Store_CreateRepository_Call struct { + *mock.Call +} + +// CreateRepository is a helper method to define mock.On call +// - ctx context.Context +// - owner string +// - name string +// - credentials params.ForgeCredentials +// - webhookSecret string +// - poolBalancerType params.PoolBalancerType +func (_e *Store_Expecter) CreateRepository(ctx interface{}, owner interface{}, name interface{}, credentials interface{}, webhookSecret interface{}, poolBalancerType interface{}) *Store_CreateRepository_Call { + return &Store_CreateRepository_Call{Call: _e.mock.On("CreateRepository", ctx, owner, name, credentials, webhookSecret, poolBalancerType)} +} + +func (_c *Store_CreateRepository_Call) Run(run func(ctx context.Context, owner string, name string, credentials params.ForgeCredentials, webhookSecret string, poolBalancerType params.PoolBalancerType)) *Store_CreateRepository_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(params.ForgeCredentials), args[4].(string), args[5].(params.PoolBalancerType)) + }) + return _c +} + +func (_c *Store_CreateRepository_Call) Return(param params.Repository, err error) *Store_CreateRepository_Call { + _c.Call.Return(param, err) + return _c +} + +func (_c *Store_CreateRepository_Call) RunAndReturn(run func(context.Context, string, string, params.ForgeCredentials, string, params.PoolBalancerType) (params.Repository, error)) *Store_CreateRepository_Call { + _c.Call.Return(run) + return _c +} + // CreateScaleSetInstance provides a mock function with given fields: _a0, scaleSetID, param func (_m *Store) CreateScaleSetInstance(_a0 context.Context, scaleSetID uint, param params.CreateInstanceParams) (params.Instance, error) { ret := _m.Called(_a0, scaleSetID, param) @@ -432,6 +893,36 @@ func (_m *Store) CreateScaleSetInstance(_a0 context.Context, scaleSetID uint, pa return r0, r1 } +// Store_CreateScaleSetInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateScaleSetInstance' +type Store_CreateScaleSetInstance_Call struct { + *mock.Call +} + +// CreateScaleSetInstance is a helper method to define mock.On call +// - _a0 context.Context +// - scaleSetID uint +// - param params.CreateInstanceParams +func (_e *Store_Expecter) CreateScaleSetInstance(_a0 interface{}, scaleSetID interface{}, param interface{}) *Store_CreateScaleSetInstance_Call { + return &Store_CreateScaleSetInstance_Call{Call: _e.mock.On("CreateScaleSetInstance", _a0, scaleSetID, param)} +} + +func (_c *Store_CreateScaleSetInstance_Call) Run(run func(_a0 context.Context, scaleSetID uint, param params.CreateInstanceParams)) *Store_CreateScaleSetInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint), args[2].(params.CreateInstanceParams)) + }) + return _c +} + +func (_c *Store_CreateScaleSetInstance_Call) Return(instance params.Instance, err error) *Store_CreateScaleSetInstance_Call { + _c.Call.Return(instance, err) + return _c +} + +func (_c *Store_CreateScaleSetInstance_Call) RunAndReturn(run func(context.Context, uint, params.CreateInstanceParams) (params.Instance, error)) *Store_CreateScaleSetInstance_Call { + _c.Call.Return(run) + return _c +} + // CreateUser provides a mock function with given fields: ctx, user func (_m *Store) CreateUser(ctx context.Context, user params.NewUserParams) (params.User, error) { ret := _m.Called(ctx, user) @@ -460,6 +951,35 @@ func (_m *Store) CreateUser(ctx context.Context, user params.NewUserParams) (par return r0, r1 } +// Store_CreateUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateUser' +type Store_CreateUser_Call struct { + *mock.Call +} + +// CreateUser is a helper method to define mock.On call +// - ctx context.Context +// - user params.NewUserParams +func (_e *Store_Expecter) CreateUser(ctx interface{}, user interface{}) *Store_CreateUser_Call { + return &Store_CreateUser_Call{Call: _e.mock.On("CreateUser", ctx, user)} +} + +func (_c *Store_CreateUser_Call) Run(run func(ctx context.Context, user params.NewUserParams)) *Store_CreateUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.NewUserParams)) + }) + return _c +} + +func (_c *Store_CreateUser_Call) Return(_a0 params.User, _a1 error) *Store_CreateUser_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_CreateUser_Call) RunAndReturn(run func(context.Context, params.NewUserParams) (params.User, error)) *Store_CreateUser_Call { + _c.Call.Return(run) + return _c +} + // DeleteCompletedJobs provides a mock function with given fields: ctx func (_m *Store) DeleteCompletedJobs(ctx context.Context) error { ret := _m.Called(ctx) @@ -478,6 +998,34 @@ func (_m *Store) DeleteCompletedJobs(ctx context.Context) error { return r0 } +// Store_DeleteCompletedJobs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteCompletedJobs' +type Store_DeleteCompletedJobs_Call struct { + *mock.Call +} + +// DeleteCompletedJobs is a helper method to define mock.On call +// - ctx context.Context +func (_e *Store_Expecter) DeleteCompletedJobs(ctx interface{}) *Store_DeleteCompletedJobs_Call { + return &Store_DeleteCompletedJobs_Call{Call: _e.mock.On("DeleteCompletedJobs", ctx)} +} + +func (_c *Store_DeleteCompletedJobs_Call) Run(run func(ctx context.Context)) *Store_DeleteCompletedJobs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Store_DeleteCompletedJobs_Call) Return(_a0 error) *Store_DeleteCompletedJobs_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_DeleteCompletedJobs_Call) RunAndReturn(run func(context.Context) error) *Store_DeleteCompletedJobs_Call { + _c.Call.Return(run) + return _c +} + // DeleteEnterprise provides a mock function with given fields: ctx, enterpriseID func (_m *Store) DeleteEnterprise(ctx context.Context, enterpriseID string) error { ret := _m.Called(ctx, enterpriseID) @@ -496,6 +1044,35 @@ func (_m *Store) DeleteEnterprise(ctx context.Context, enterpriseID string) erro return r0 } +// Store_DeleteEnterprise_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteEnterprise' +type Store_DeleteEnterprise_Call struct { + *mock.Call +} + +// DeleteEnterprise is a helper method to define mock.On call +// - ctx context.Context +// - enterpriseID string +func (_e *Store_Expecter) DeleteEnterprise(ctx interface{}, enterpriseID interface{}) *Store_DeleteEnterprise_Call { + return &Store_DeleteEnterprise_Call{Call: _e.mock.On("DeleteEnterprise", ctx, enterpriseID)} +} + +func (_c *Store_DeleteEnterprise_Call) Run(run func(ctx context.Context, enterpriseID string)) *Store_DeleteEnterprise_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_DeleteEnterprise_Call) Return(_a0 error) *Store_DeleteEnterprise_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_DeleteEnterprise_Call) RunAndReturn(run func(context.Context, string) error) *Store_DeleteEnterprise_Call { + _c.Call.Return(run) + return _c +} + // DeleteEntityPool provides a mock function with given fields: ctx, entity, poolID func (_m *Store) DeleteEntityPool(ctx context.Context, entity params.ForgeEntity, poolID string) error { ret := _m.Called(ctx, entity, poolID) @@ -514,6 +1091,36 @@ func (_m *Store) DeleteEntityPool(ctx context.Context, entity params.ForgeEntity return r0 } +// Store_DeleteEntityPool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteEntityPool' +type Store_DeleteEntityPool_Call struct { + *mock.Call +} + +// DeleteEntityPool is a helper method to define mock.On call +// - ctx context.Context +// - entity params.ForgeEntity +// - poolID string +func (_e *Store_Expecter) DeleteEntityPool(ctx interface{}, entity interface{}, poolID interface{}) *Store_DeleteEntityPool_Call { + return &Store_DeleteEntityPool_Call{Call: _e.mock.On("DeleteEntityPool", ctx, entity, poolID)} +} + +func (_c *Store_DeleteEntityPool_Call) Run(run func(ctx context.Context, entity params.ForgeEntity, poolID string)) *Store_DeleteEntityPool_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.ForgeEntity), args[2].(string)) + }) + return _c +} + +func (_c *Store_DeleteEntityPool_Call) Return(_a0 error) *Store_DeleteEntityPool_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_DeleteEntityPool_Call) RunAndReturn(run func(context.Context, params.ForgeEntity, string) error) *Store_DeleteEntityPool_Call { + _c.Call.Return(run) + return _c +} + // DeleteGiteaCredentials provides a mock function with given fields: ctx, id func (_m *Store) DeleteGiteaCredentials(ctx context.Context, id uint) error { ret := _m.Called(ctx, id) @@ -532,6 +1139,35 @@ func (_m *Store) DeleteGiteaCredentials(ctx context.Context, id uint) error { return r0 } +// Store_DeleteGiteaCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteGiteaCredentials' +type Store_DeleteGiteaCredentials_Call struct { + *mock.Call +} + +// DeleteGiteaCredentials is a helper method to define mock.On call +// - ctx context.Context +// - id uint +func (_e *Store_Expecter) DeleteGiteaCredentials(ctx interface{}, id interface{}) *Store_DeleteGiteaCredentials_Call { + return &Store_DeleteGiteaCredentials_Call{Call: _e.mock.On("DeleteGiteaCredentials", ctx, id)} +} + +func (_c *Store_DeleteGiteaCredentials_Call) Run(run func(ctx context.Context, id uint)) *Store_DeleteGiteaCredentials_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint)) + }) + return _c +} + +func (_c *Store_DeleteGiteaCredentials_Call) Return(err error) *Store_DeleteGiteaCredentials_Call { + _c.Call.Return(err) + return _c +} + +func (_c *Store_DeleteGiteaCredentials_Call) RunAndReturn(run func(context.Context, uint) error) *Store_DeleteGiteaCredentials_Call { + _c.Call.Return(run) + return _c +} + // DeleteGiteaEndpoint provides a mock function with given fields: _a0, name func (_m *Store) DeleteGiteaEndpoint(_a0 context.Context, name string) error { ret := _m.Called(_a0, name) @@ -550,6 +1186,35 @@ func (_m *Store) DeleteGiteaEndpoint(_a0 context.Context, name string) error { return r0 } +// Store_DeleteGiteaEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteGiteaEndpoint' +type Store_DeleteGiteaEndpoint_Call struct { + *mock.Call +} + +// DeleteGiteaEndpoint is a helper method to define mock.On call +// - _a0 context.Context +// - name string +func (_e *Store_Expecter) DeleteGiteaEndpoint(_a0 interface{}, name interface{}) *Store_DeleteGiteaEndpoint_Call { + return &Store_DeleteGiteaEndpoint_Call{Call: _e.mock.On("DeleteGiteaEndpoint", _a0, name)} +} + +func (_c *Store_DeleteGiteaEndpoint_Call) Run(run func(_a0 context.Context, name string)) *Store_DeleteGiteaEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_DeleteGiteaEndpoint_Call) Return(err error) *Store_DeleteGiteaEndpoint_Call { + _c.Call.Return(err) + return _c +} + +func (_c *Store_DeleteGiteaEndpoint_Call) RunAndReturn(run func(context.Context, string) error) *Store_DeleteGiteaEndpoint_Call { + _c.Call.Return(run) + return _c +} + // DeleteGithubCredentials provides a mock function with given fields: ctx, id func (_m *Store) DeleteGithubCredentials(ctx context.Context, id uint) error { ret := _m.Called(ctx, id) @@ -568,6 +1233,35 @@ func (_m *Store) DeleteGithubCredentials(ctx context.Context, id uint) error { return r0 } +// Store_DeleteGithubCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteGithubCredentials' +type Store_DeleteGithubCredentials_Call struct { + *mock.Call +} + +// DeleteGithubCredentials is a helper method to define mock.On call +// - ctx context.Context +// - id uint +func (_e *Store_Expecter) DeleteGithubCredentials(ctx interface{}, id interface{}) *Store_DeleteGithubCredentials_Call { + return &Store_DeleteGithubCredentials_Call{Call: _e.mock.On("DeleteGithubCredentials", ctx, id)} +} + +func (_c *Store_DeleteGithubCredentials_Call) Run(run func(ctx context.Context, id uint)) *Store_DeleteGithubCredentials_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint)) + }) + return _c +} + +func (_c *Store_DeleteGithubCredentials_Call) Return(_a0 error) *Store_DeleteGithubCredentials_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_DeleteGithubCredentials_Call) RunAndReturn(run func(context.Context, uint) error) *Store_DeleteGithubCredentials_Call { + _c.Call.Return(run) + return _c +} + // DeleteGithubEndpoint provides a mock function with given fields: ctx, name func (_m *Store) DeleteGithubEndpoint(ctx context.Context, name string) error { ret := _m.Called(ctx, name) @@ -586,6 +1280,35 @@ func (_m *Store) DeleteGithubEndpoint(ctx context.Context, name string) error { return r0 } +// Store_DeleteGithubEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteGithubEndpoint' +type Store_DeleteGithubEndpoint_Call struct { + *mock.Call +} + +// DeleteGithubEndpoint is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *Store_Expecter) DeleteGithubEndpoint(ctx interface{}, name interface{}) *Store_DeleteGithubEndpoint_Call { + return &Store_DeleteGithubEndpoint_Call{Call: _e.mock.On("DeleteGithubEndpoint", ctx, name)} +} + +func (_c *Store_DeleteGithubEndpoint_Call) Run(run func(ctx context.Context, name string)) *Store_DeleteGithubEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_DeleteGithubEndpoint_Call) Return(_a0 error) *Store_DeleteGithubEndpoint_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_DeleteGithubEndpoint_Call) RunAndReturn(run func(context.Context, string) error) *Store_DeleteGithubEndpoint_Call { + _c.Call.Return(run) + return _c +} + // DeleteInstance provides a mock function with given fields: ctx, poolID, instanceName func (_m *Store) DeleteInstance(ctx context.Context, poolID string, instanceName string) error { ret := _m.Called(ctx, poolID, instanceName) @@ -604,6 +1327,36 @@ func (_m *Store) DeleteInstance(ctx context.Context, poolID string, instanceName return r0 } +// Store_DeleteInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteInstance' +type Store_DeleteInstance_Call struct { + *mock.Call +} + +// DeleteInstance is a helper method to define mock.On call +// - ctx context.Context +// - poolID string +// - instanceName string +func (_e *Store_Expecter) DeleteInstance(ctx interface{}, poolID interface{}, instanceName interface{}) *Store_DeleteInstance_Call { + return &Store_DeleteInstance_Call{Call: _e.mock.On("DeleteInstance", ctx, poolID, instanceName)} +} + +func (_c *Store_DeleteInstance_Call) Run(run func(ctx context.Context, poolID string, instanceName string)) *Store_DeleteInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Store_DeleteInstance_Call) Return(_a0 error) *Store_DeleteInstance_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_DeleteInstance_Call) RunAndReturn(run func(context.Context, string, string) error) *Store_DeleteInstance_Call { + _c.Call.Return(run) + return _c +} + // DeleteInstanceByName provides a mock function with given fields: ctx, instanceName func (_m *Store) DeleteInstanceByName(ctx context.Context, instanceName string) error { ret := _m.Called(ctx, instanceName) @@ -622,6 +1375,35 @@ func (_m *Store) DeleteInstanceByName(ctx context.Context, instanceName string) return r0 } +// Store_DeleteInstanceByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteInstanceByName' +type Store_DeleteInstanceByName_Call struct { + *mock.Call +} + +// DeleteInstanceByName is a helper method to define mock.On call +// - ctx context.Context +// - instanceName string +func (_e *Store_Expecter) DeleteInstanceByName(ctx interface{}, instanceName interface{}) *Store_DeleteInstanceByName_Call { + return &Store_DeleteInstanceByName_Call{Call: _e.mock.On("DeleteInstanceByName", ctx, instanceName)} +} + +func (_c *Store_DeleteInstanceByName_Call) Run(run func(ctx context.Context, instanceName string)) *Store_DeleteInstanceByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_DeleteInstanceByName_Call) Return(_a0 error) *Store_DeleteInstanceByName_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_DeleteInstanceByName_Call) RunAndReturn(run func(context.Context, string) error) *Store_DeleteInstanceByName_Call { + _c.Call.Return(run) + return _c +} + // DeleteJob provides a mock function with given fields: ctx, jobID func (_m *Store) DeleteJob(ctx context.Context, jobID int64) error { ret := _m.Called(ctx, jobID) @@ -640,6 +1422,35 @@ func (_m *Store) DeleteJob(ctx context.Context, jobID int64) error { return r0 } +// Store_DeleteJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteJob' +type Store_DeleteJob_Call struct { + *mock.Call +} + +// DeleteJob is a helper method to define mock.On call +// - ctx context.Context +// - jobID int64 +func (_e *Store_Expecter) DeleteJob(ctx interface{}, jobID interface{}) *Store_DeleteJob_Call { + return &Store_DeleteJob_Call{Call: _e.mock.On("DeleteJob", ctx, jobID)} +} + +func (_c *Store_DeleteJob_Call) Run(run func(ctx context.Context, jobID int64)) *Store_DeleteJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *Store_DeleteJob_Call) Return(_a0 error) *Store_DeleteJob_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_DeleteJob_Call) RunAndReturn(run func(context.Context, int64) error) *Store_DeleteJob_Call { + _c.Call.Return(run) + return _c +} + // DeleteOrganization provides a mock function with given fields: ctx, orgID func (_m *Store) DeleteOrganization(ctx context.Context, orgID string) error { ret := _m.Called(ctx, orgID) @@ -658,6 +1469,35 @@ func (_m *Store) DeleteOrganization(ctx context.Context, orgID string) error { return r0 } +// Store_DeleteOrganization_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteOrganization' +type Store_DeleteOrganization_Call struct { + *mock.Call +} + +// DeleteOrganization is a helper method to define mock.On call +// - ctx context.Context +// - orgID string +func (_e *Store_Expecter) DeleteOrganization(ctx interface{}, orgID interface{}) *Store_DeleteOrganization_Call { + return &Store_DeleteOrganization_Call{Call: _e.mock.On("DeleteOrganization", ctx, orgID)} +} + +func (_c *Store_DeleteOrganization_Call) Run(run func(ctx context.Context, orgID string)) *Store_DeleteOrganization_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_DeleteOrganization_Call) Return(_a0 error) *Store_DeleteOrganization_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_DeleteOrganization_Call) RunAndReturn(run func(context.Context, string) error) *Store_DeleteOrganization_Call { + _c.Call.Return(run) + return _c +} + // DeletePoolByID provides a mock function with given fields: ctx, poolID func (_m *Store) DeletePoolByID(ctx context.Context, poolID string) error { ret := _m.Called(ctx, poolID) @@ -676,6 +1516,35 @@ func (_m *Store) DeletePoolByID(ctx context.Context, poolID string) error { return r0 } +// Store_DeletePoolByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeletePoolByID' +type Store_DeletePoolByID_Call struct { + *mock.Call +} + +// DeletePoolByID is a helper method to define mock.On call +// - ctx context.Context +// - poolID string +func (_e *Store_Expecter) DeletePoolByID(ctx interface{}, poolID interface{}) *Store_DeletePoolByID_Call { + return &Store_DeletePoolByID_Call{Call: _e.mock.On("DeletePoolByID", ctx, poolID)} +} + +func (_c *Store_DeletePoolByID_Call) Run(run func(ctx context.Context, poolID string)) *Store_DeletePoolByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_DeletePoolByID_Call) Return(_a0 error) *Store_DeletePoolByID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_DeletePoolByID_Call) RunAndReturn(run func(context.Context, string) error) *Store_DeletePoolByID_Call { + _c.Call.Return(run) + return _c +} + // DeleteRepository provides a mock function with given fields: ctx, repoID func (_m *Store) DeleteRepository(ctx context.Context, repoID string) error { ret := _m.Called(ctx, repoID) @@ -694,6 +1563,35 @@ func (_m *Store) DeleteRepository(ctx context.Context, repoID string) error { return r0 } +// Store_DeleteRepository_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteRepository' +type Store_DeleteRepository_Call struct { + *mock.Call +} + +// DeleteRepository is a helper method to define mock.On call +// - ctx context.Context +// - repoID string +func (_e *Store_Expecter) DeleteRepository(ctx interface{}, repoID interface{}) *Store_DeleteRepository_Call { + return &Store_DeleteRepository_Call{Call: _e.mock.On("DeleteRepository", ctx, repoID)} +} + +func (_c *Store_DeleteRepository_Call) Run(run func(ctx context.Context, repoID string)) *Store_DeleteRepository_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_DeleteRepository_Call) Return(_a0 error) *Store_DeleteRepository_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_DeleteRepository_Call) RunAndReturn(run func(context.Context, string) error) *Store_DeleteRepository_Call { + _c.Call.Return(run) + return _c +} + // DeleteScaleSetByID provides a mock function with given fields: ctx, scaleSetID func (_m *Store) DeleteScaleSetByID(ctx context.Context, scaleSetID uint) error { ret := _m.Called(ctx, scaleSetID) @@ -712,6 +1610,35 @@ func (_m *Store) DeleteScaleSetByID(ctx context.Context, scaleSetID uint) error return r0 } +// Store_DeleteScaleSetByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteScaleSetByID' +type Store_DeleteScaleSetByID_Call struct { + *mock.Call +} + +// DeleteScaleSetByID is a helper method to define mock.On call +// - ctx context.Context +// - scaleSetID uint +func (_e *Store_Expecter) DeleteScaleSetByID(ctx interface{}, scaleSetID interface{}) *Store_DeleteScaleSetByID_Call { + return &Store_DeleteScaleSetByID_Call{Call: _e.mock.On("DeleteScaleSetByID", ctx, scaleSetID)} +} + +func (_c *Store_DeleteScaleSetByID_Call) Run(run func(ctx context.Context, scaleSetID uint)) *Store_DeleteScaleSetByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint)) + }) + return _c +} + +func (_c *Store_DeleteScaleSetByID_Call) Return(err error) *Store_DeleteScaleSetByID_Call { + _c.Call.Return(err) + return _c +} + +func (_c *Store_DeleteScaleSetByID_Call) RunAndReturn(run func(context.Context, uint) error) *Store_DeleteScaleSetByID_Call { + _c.Call.Return(run) + return _c +} + // FindPoolsMatchingAllTags provides a mock function with given fields: ctx, entityType, entityID, tags func (_m *Store) FindPoolsMatchingAllTags(ctx context.Context, entityType params.ForgeEntityType, entityID string, tags []string) ([]params.Pool, error) { ret := _m.Called(ctx, entityType, entityID, tags) @@ -742,6 +1669,37 @@ func (_m *Store) FindPoolsMatchingAllTags(ctx context.Context, entityType params return r0, r1 } +// Store_FindPoolsMatchingAllTags_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindPoolsMatchingAllTags' +type Store_FindPoolsMatchingAllTags_Call struct { + *mock.Call +} + +// FindPoolsMatchingAllTags is a helper method to define mock.On call +// - ctx context.Context +// - entityType params.ForgeEntityType +// - entityID string +// - tags []string +func (_e *Store_Expecter) FindPoolsMatchingAllTags(ctx interface{}, entityType interface{}, entityID interface{}, tags interface{}) *Store_FindPoolsMatchingAllTags_Call { + return &Store_FindPoolsMatchingAllTags_Call{Call: _e.mock.On("FindPoolsMatchingAllTags", ctx, entityType, entityID, tags)} +} + +func (_c *Store_FindPoolsMatchingAllTags_Call) Run(run func(ctx context.Context, entityType params.ForgeEntityType, entityID string, tags []string)) *Store_FindPoolsMatchingAllTags_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.ForgeEntityType), args[2].(string), args[3].([]string)) + }) + return _c +} + +func (_c *Store_FindPoolsMatchingAllTags_Call) Return(_a0 []params.Pool, _a1 error) *Store_FindPoolsMatchingAllTags_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_FindPoolsMatchingAllTags_Call) RunAndReturn(run func(context.Context, params.ForgeEntityType, string, []string) ([]params.Pool, error)) *Store_FindPoolsMatchingAllTags_Call { + _c.Call.Return(run) + return _c +} + // GetAdminUser provides a mock function with given fields: ctx func (_m *Store) GetAdminUser(ctx context.Context) (params.User, error) { ret := _m.Called(ctx) @@ -770,6 +1728,34 @@ func (_m *Store) GetAdminUser(ctx context.Context) (params.User, error) { return r0, r1 } +// Store_GetAdminUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAdminUser' +type Store_GetAdminUser_Call struct { + *mock.Call +} + +// GetAdminUser is a helper method to define mock.On call +// - ctx context.Context +func (_e *Store_Expecter) GetAdminUser(ctx interface{}) *Store_GetAdminUser_Call { + return &Store_GetAdminUser_Call{Call: _e.mock.On("GetAdminUser", ctx)} +} + +func (_c *Store_GetAdminUser_Call) Run(run func(ctx context.Context)) *Store_GetAdminUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Store_GetAdminUser_Call) Return(_a0 params.User, _a1 error) *Store_GetAdminUser_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetAdminUser_Call) RunAndReturn(run func(context.Context) (params.User, error)) *Store_GetAdminUser_Call { + _c.Call.Return(run) + return _c +} + // GetEnterprise provides a mock function with given fields: ctx, name, endpointName func (_m *Store) GetEnterprise(ctx context.Context, name string, endpointName string) (params.Enterprise, error) { ret := _m.Called(ctx, name, endpointName) @@ -798,6 +1784,36 @@ func (_m *Store) GetEnterprise(ctx context.Context, name string, endpointName st return r0, r1 } +// Store_GetEnterprise_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEnterprise' +type Store_GetEnterprise_Call struct { + *mock.Call +} + +// GetEnterprise is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - endpointName string +func (_e *Store_Expecter) GetEnterprise(ctx interface{}, name interface{}, endpointName interface{}) *Store_GetEnterprise_Call { + return &Store_GetEnterprise_Call{Call: _e.mock.On("GetEnterprise", ctx, name, endpointName)} +} + +func (_c *Store_GetEnterprise_Call) Run(run func(ctx context.Context, name string, endpointName string)) *Store_GetEnterprise_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Store_GetEnterprise_Call) Return(_a0 params.Enterprise, _a1 error) *Store_GetEnterprise_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetEnterprise_Call) RunAndReturn(run func(context.Context, string, string) (params.Enterprise, error)) *Store_GetEnterprise_Call { + _c.Call.Return(run) + return _c +} + // GetEnterpriseByID provides a mock function with given fields: ctx, enterpriseID func (_m *Store) GetEnterpriseByID(ctx context.Context, enterpriseID string) (params.Enterprise, error) { ret := _m.Called(ctx, enterpriseID) @@ -826,6 +1842,35 @@ func (_m *Store) GetEnterpriseByID(ctx context.Context, enterpriseID string) (pa return r0, r1 } +// Store_GetEnterpriseByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEnterpriseByID' +type Store_GetEnterpriseByID_Call struct { + *mock.Call +} + +// GetEnterpriseByID is a helper method to define mock.On call +// - ctx context.Context +// - enterpriseID string +func (_e *Store_Expecter) GetEnterpriseByID(ctx interface{}, enterpriseID interface{}) *Store_GetEnterpriseByID_Call { + return &Store_GetEnterpriseByID_Call{Call: _e.mock.On("GetEnterpriseByID", ctx, enterpriseID)} +} + +func (_c *Store_GetEnterpriseByID_Call) Run(run func(ctx context.Context, enterpriseID string)) *Store_GetEnterpriseByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_GetEnterpriseByID_Call) Return(_a0 params.Enterprise, _a1 error) *Store_GetEnterpriseByID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetEnterpriseByID_Call) RunAndReturn(run func(context.Context, string) (params.Enterprise, error)) *Store_GetEnterpriseByID_Call { + _c.Call.Return(run) + return _c +} + // GetEntityPool provides a mock function with given fields: ctx, entity, poolID func (_m *Store) GetEntityPool(ctx context.Context, entity params.ForgeEntity, poolID string) (params.Pool, error) { ret := _m.Called(ctx, entity, poolID) @@ -854,6 +1899,36 @@ func (_m *Store) GetEntityPool(ctx context.Context, entity params.ForgeEntity, p return r0, r1 } +// Store_GetEntityPool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEntityPool' +type Store_GetEntityPool_Call struct { + *mock.Call +} + +// GetEntityPool is a helper method to define mock.On call +// - ctx context.Context +// - entity params.ForgeEntity +// - poolID string +func (_e *Store_Expecter) GetEntityPool(ctx interface{}, entity interface{}, poolID interface{}) *Store_GetEntityPool_Call { + return &Store_GetEntityPool_Call{Call: _e.mock.On("GetEntityPool", ctx, entity, poolID)} +} + +func (_c *Store_GetEntityPool_Call) Run(run func(ctx context.Context, entity params.ForgeEntity, poolID string)) *Store_GetEntityPool_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.ForgeEntity), args[2].(string)) + }) + return _c +} + +func (_c *Store_GetEntityPool_Call) Return(_a0 params.Pool, _a1 error) *Store_GetEntityPool_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetEntityPool_Call) RunAndReturn(run func(context.Context, params.ForgeEntity, string) (params.Pool, error)) *Store_GetEntityPool_Call { + _c.Call.Return(run) + return _c +} + // GetForgeEntity provides a mock function with given fields: _a0, entityType, entityID func (_m *Store) GetForgeEntity(_a0 context.Context, entityType params.ForgeEntityType, entityID string) (params.ForgeEntity, error) { ret := _m.Called(_a0, entityType, entityID) @@ -882,6 +1957,36 @@ func (_m *Store) GetForgeEntity(_a0 context.Context, entityType params.ForgeEnti return r0, r1 } +// Store_GetForgeEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetForgeEntity' +type Store_GetForgeEntity_Call struct { + *mock.Call +} + +// GetForgeEntity is a helper method to define mock.On call +// - _a0 context.Context +// - entityType params.ForgeEntityType +// - entityID string +func (_e *Store_Expecter) GetForgeEntity(_a0 interface{}, entityType interface{}, entityID interface{}) *Store_GetForgeEntity_Call { + return &Store_GetForgeEntity_Call{Call: _e.mock.On("GetForgeEntity", _a0, entityType, entityID)} +} + +func (_c *Store_GetForgeEntity_Call) Run(run func(_a0 context.Context, entityType params.ForgeEntityType, entityID string)) *Store_GetForgeEntity_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.ForgeEntityType), args[2].(string)) + }) + return _c +} + +func (_c *Store_GetForgeEntity_Call) Return(_a0 params.ForgeEntity, _a1 error) *Store_GetForgeEntity_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetForgeEntity_Call) RunAndReturn(run func(context.Context, params.ForgeEntityType, string) (params.ForgeEntity, error)) *Store_GetForgeEntity_Call { + _c.Call.Return(run) + return _c +} + // GetGiteaCredentials provides a mock function with given fields: ctx, id, detailed func (_m *Store) GetGiteaCredentials(ctx context.Context, id uint, detailed bool) (params.ForgeCredentials, error) { ret := _m.Called(ctx, id, detailed) @@ -910,6 +2015,36 @@ func (_m *Store) GetGiteaCredentials(ctx context.Context, id uint, detailed bool return r0, r1 } +// Store_GetGiteaCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGiteaCredentials' +type Store_GetGiteaCredentials_Call struct { + *mock.Call +} + +// GetGiteaCredentials is a helper method to define mock.On call +// - ctx context.Context +// - id uint +// - detailed bool +func (_e *Store_Expecter) GetGiteaCredentials(ctx interface{}, id interface{}, detailed interface{}) *Store_GetGiteaCredentials_Call { + return &Store_GetGiteaCredentials_Call{Call: _e.mock.On("GetGiteaCredentials", ctx, id, detailed)} +} + +func (_c *Store_GetGiteaCredentials_Call) Run(run func(ctx context.Context, id uint, detailed bool)) *Store_GetGiteaCredentials_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint), args[2].(bool)) + }) + return _c +} + +func (_c *Store_GetGiteaCredentials_Call) Return(_a0 params.ForgeCredentials, _a1 error) *Store_GetGiteaCredentials_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetGiteaCredentials_Call) RunAndReturn(run func(context.Context, uint, bool) (params.ForgeCredentials, error)) *Store_GetGiteaCredentials_Call { + _c.Call.Return(run) + return _c +} + // GetGiteaCredentialsByName provides a mock function with given fields: ctx, name, detailed func (_m *Store) GetGiteaCredentialsByName(ctx context.Context, name string, detailed bool) (params.ForgeCredentials, error) { ret := _m.Called(ctx, name, detailed) @@ -938,6 +2073,36 @@ func (_m *Store) GetGiteaCredentialsByName(ctx context.Context, name string, det return r0, r1 } +// Store_GetGiteaCredentialsByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGiteaCredentialsByName' +type Store_GetGiteaCredentialsByName_Call struct { + *mock.Call +} + +// GetGiteaCredentialsByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - detailed bool +func (_e *Store_Expecter) GetGiteaCredentialsByName(ctx interface{}, name interface{}, detailed interface{}) *Store_GetGiteaCredentialsByName_Call { + return &Store_GetGiteaCredentialsByName_Call{Call: _e.mock.On("GetGiteaCredentialsByName", ctx, name, detailed)} +} + +func (_c *Store_GetGiteaCredentialsByName_Call) Run(run func(ctx context.Context, name string, detailed bool)) *Store_GetGiteaCredentialsByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(bool)) + }) + return _c +} + +func (_c *Store_GetGiteaCredentialsByName_Call) Return(_a0 params.ForgeCredentials, _a1 error) *Store_GetGiteaCredentialsByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetGiteaCredentialsByName_Call) RunAndReturn(run func(context.Context, string, bool) (params.ForgeCredentials, error)) *Store_GetGiteaCredentialsByName_Call { + _c.Call.Return(run) + return _c +} + // GetGiteaEndpoint provides a mock function with given fields: _a0, name func (_m *Store) GetGiteaEndpoint(_a0 context.Context, name string) (params.ForgeEndpoint, error) { ret := _m.Called(_a0, name) @@ -966,6 +2131,35 @@ func (_m *Store) GetGiteaEndpoint(_a0 context.Context, name string) (params.Forg return r0, r1 } +// Store_GetGiteaEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGiteaEndpoint' +type Store_GetGiteaEndpoint_Call struct { + *mock.Call +} + +// GetGiteaEndpoint is a helper method to define mock.On call +// - _a0 context.Context +// - name string +func (_e *Store_Expecter) GetGiteaEndpoint(_a0 interface{}, name interface{}) *Store_GetGiteaEndpoint_Call { + return &Store_GetGiteaEndpoint_Call{Call: _e.mock.On("GetGiteaEndpoint", _a0, name)} +} + +func (_c *Store_GetGiteaEndpoint_Call) Run(run func(_a0 context.Context, name string)) *Store_GetGiteaEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_GetGiteaEndpoint_Call) Return(_a0 params.ForgeEndpoint, _a1 error) *Store_GetGiteaEndpoint_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetGiteaEndpoint_Call) RunAndReturn(run func(context.Context, string) (params.ForgeEndpoint, error)) *Store_GetGiteaEndpoint_Call { + _c.Call.Return(run) + return _c +} + // GetGithubCredentials provides a mock function with given fields: ctx, id, detailed func (_m *Store) GetGithubCredentials(ctx context.Context, id uint, detailed bool) (params.ForgeCredentials, error) { ret := _m.Called(ctx, id, detailed) @@ -994,6 +2188,36 @@ func (_m *Store) GetGithubCredentials(ctx context.Context, id uint, detailed boo return r0, r1 } +// Store_GetGithubCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGithubCredentials' +type Store_GetGithubCredentials_Call struct { + *mock.Call +} + +// GetGithubCredentials is a helper method to define mock.On call +// - ctx context.Context +// - id uint +// - detailed bool +func (_e *Store_Expecter) GetGithubCredentials(ctx interface{}, id interface{}, detailed interface{}) *Store_GetGithubCredentials_Call { + return &Store_GetGithubCredentials_Call{Call: _e.mock.On("GetGithubCredentials", ctx, id, detailed)} +} + +func (_c *Store_GetGithubCredentials_Call) Run(run func(ctx context.Context, id uint, detailed bool)) *Store_GetGithubCredentials_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint), args[2].(bool)) + }) + return _c +} + +func (_c *Store_GetGithubCredentials_Call) Return(_a0 params.ForgeCredentials, _a1 error) *Store_GetGithubCredentials_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetGithubCredentials_Call) RunAndReturn(run func(context.Context, uint, bool) (params.ForgeCredentials, error)) *Store_GetGithubCredentials_Call { + _c.Call.Return(run) + return _c +} + // GetGithubCredentialsByName provides a mock function with given fields: ctx, name, detailed func (_m *Store) GetGithubCredentialsByName(ctx context.Context, name string, detailed bool) (params.ForgeCredentials, error) { ret := _m.Called(ctx, name, detailed) @@ -1022,6 +2246,36 @@ func (_m *Store) GetGithubCredentialsByName(ctx context.Context, name string, de return r0, r1 } +// Store_GetGithubCredentialsByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGithubCredentialsByName' +type Store_GetGithubCredentialsByName_Call struct { + *mock.Call +} + +// GetGithubCredentialsByName is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - detailed bool +func (_e *Store_Expecter) GetGithubCredentialsByName(ctx interface{}, name interface{}, detailed interface{}) *Store_GetGithubCredentialsByName_Call { + return &Store_GetGithubCredentialsByName_Call{Call: _e.mock.On("GetGithubCredentialsByName", ctx, name, detailed)} +} + +func (_c *Store_GetGithubCredentialsByName_Call) Run(run func(ctx context.Context, name string, detailed bool)) *Store_GetGithubCredentialsByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(bool)) + }) + return _c +} + +func (_c *Store_GetGithubCredentialsByName_Call) Return(_a0 params.ForgeCredentials, _a1 error) *Store_GetGithubCredentialsByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetGithubCredentialsByName_Call) RunAndReturn(run func(context.Context, string, bool) (params.ForgeCredentials, error)) *Store_GetGithubCredentialsByName_Call { + _c.Call.Return(run) + return _c +} + // GetGithubEndpoint provides a mock function with given fields: ctx, name func (_m *Store) GetGithubEndpoint(ctx context.Context, name string) (params.ForgeEndpoint, error) { ret := _m.Called(ctx, name) @@ -1050,6 +2304,35 @@ func (_m *Store) GetGithubEndpoint(ctx context.Context, name string) (params.For return r0, r1 } +// Store_GetGithubEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetGithubEndpoint' +type Store_GetGithubEndpoint_Call struct { + *mock.Call +} + +// GetGithubEndpoint is a helper method to define mock.On call +// - ctx context.Context +// - name string +func (_e *Store_Expecter) GetGithubEndpoint(ctx interface{}, name interface{}) *Store_GetGithubEndpoint_Call { + return &Store_GetGithubEndpoint_Call{Call: _e.mock.On("GetGithubEndpoint", ctx, name)} +} + +func (_c *Store_GetGithubEndpoint_Call) Run(run func(ctx context.Context, name string)) *Store_GetGithubEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_GetGithubEndpoint_Call) Return(_a0 params.ForgeEndpoint, _a1 error) *Store_GetGithubEndpoint_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetGithubEndpoint_Call) RunAndReturn(run func(context.Context, string) (params.ForgeEndpoint, error)) *Store_GetGithubEndpoint_Call { + _c.Call.Return(run) + return _c +} + // GetInstanceByName provides a mock function with given fields: ctx, instanceName func (_m *Store) GetInstanceByName(ctx context.Context, instanceName string) (params.Instance, error) { ret := _m.Called(ctx, instanceName) @@ -1078,6 +2361,35 @@ func (_m *Store) GetInstanceByName(ctx context.Context, instanceName string) (pa return r0, r1 } +// Store_GetInstanceByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInstanceByName' +type Store_GetInstanceByName_Call struct { + *mock.Call +} + +// GetInstanceByName is a helper method to define mock.On call +// - ctx context.Context +// - instanceName string +func (_e *Store_Expecter) GetInstanceByName(ctx interface{}, instanceName interface{}) *Store_GetInstanceByName_Call { + return &Store_GetInstanceByName_Call{Call: _e.mock.On("GetInstanceByName", ctx, instanceName)} +} + +func (_c *Store_GetInstanceByName_Call) Run(run func(ctx context.Context, instanceName string)) *Store_GetInstanceByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_GetInstanceByName_Call) Return(_a0 params.Instance, _a1 error) *Store_GetInstanceByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetInstanceByName_Call) RunAndReturn(run func(context.Context, string) (params.Instance, error)) *Store_GetInstanceByName_Call { + _c.Call.Return(run) + return _c +} + // GetJobByID provides a mock function with given fields: ctx, jobID func (_m *Store) GetJobByID(ctx context.Context, jobID int64) (params.Job, error) { ret := _m.Called(ctx, jobID) @@ -1106,6 +2418,35 @@ func (_m *Store) GetJobByID(ctx context.Context, jobID int64) (params.Job, error return r0, r1 } +// Store_GetJobByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetJobByID' +type Store_GetJobByID_Call struct { + *mock.Call +} + +// GetJobByID is a helper method to define mock.On call +// - ctx context.Context +// - jobID int64 +func (_e *Store_Expecter) GetJobByID(ctx interface{}, jobID interface{}) *Store_GetJobByID_Call { + return &Store_GetJobByID_Call{Call: _e.mock.On("GetJobByID", ctx, jobID)} +} + +func (_c *Store_GetJobByID_Call) Run(run func(ctx context.Context, jobID int64)) *Store_GetJobByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *Store_GetJobByID_Call) Return(_a0 params.Job, _a1 error) *Store_GetJobByID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetJobByID_Call) RunAndReturn(run func(context.Context, int64) (params.Job, error)) *Store_GetJobByID_Call { + _c.Call.Return(run) + return _c +} + // GetOrganization provides a mock function with given fields: ctx, name, endpointName func (_m *Store) GetOrganization(ctx context.Context, name string, endpointName string) (params.Organization, error) { ret := _m.Called(ctx, name, endpointName) @@ -1134,6 +2475,36 @@ func (_m *Store) GetOrganization(ctx context.Context, name string, endpointName return r0, r1 } +// Store_GetOrganization_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrganization' +type Store_GetOrganization_Call struct { + *mock.Call +} + +// GetOrganization is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - endpointName string +func (_e *Store_Expecter) GetOrganization(ctx interface{}, name interface{}, endpointName interface{}) *Store_GetOrganization_Call { + return &Store_GetOrganization_Call{Call: _e.mock.On("GetOrganization", ctx, name, endpointName)} +} + +func (_c *Store_GetOrganization_Call) Run(run func(ctx context.Context, name string, endpointName string)) *Store_GetOrganization_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Store_GetOrganization_Call) Return(_a0 params.Organization, _a1 error) *Store_GetOrganization_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetOrganization_Call) RunAndReturn(run func(context.Context, string, string) (params.Organization, error)) *Store_GetOrganization_Call { + _c.Call.Return(run) + return _c +} + // GetOrganizationByID provides a mock function with given fields: ctx, orgID func (_m *Store) GetOrganizationByID(ctx context.Context, orgID string) (params.Organization, error) { ret := _m.Called(ctx, orgID) @@ -1162,6 +2533,35 @@ func (_m *Store) GetOrganizationByID(ctx context.Context, orgID string) (params. return r0, r1 } +// Store_GetOrganizationByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrganizationByID' +type Store_GetOrganizationByID_Call struct { + *mock.Call +} + +// GetOrganizationByID is a helper method to define mock.On call +// - ctx context.Context +// - orgID string +func (_e *Store_Expecter) GetOrganizationByID(ctx interface{}, orgID interface{}) *Store_GetOrganizationByID_Call { + return &Store_GetOrganizationByID_Call{Call: _e.mock.On("GetOrganizationByID", ctx, orgID)} +} + +func (_c *Store_GetOrganizationByID_Call) Run(run func(ctx context.Context, orgID string)) *Store_GetOrganizationByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_GetOrganizationByID_Call) Return(_a0 params.Organization, _a1 error) *Store_GetOrganizationByID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetOrganizationByID_Call) RunAndReturn(run func(context.Context, string) (params.Organization, error)) *Store_GetOrganizationByID_Call { + _c.Call.Return(run) + return _c +} + // GetPoolByID provides a mock function with given fields: ctx, poolID func (_m *Store) GetPoolByID(ctx context.Context, poolID string) (params.Pool, error) { ret := _m.Called(ctx, poolID) @@ -1190,6 +2590,35 @@ func (_m *Store) GetPoolByID(ctx context.Context, poolID string) (params.Pool, e return r0, r1 } +// Store_GetPoolByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPoolByID' +type Store_GetPoolByID_Call struct { + *mock.Call +} + +// GetPoolByID is a helper method to define mock.On call +// - ctx context.Context +// - poolID string +func (_e *Store_Expecter) GetPoolByID(ctx interface{}, poolID interface{}) *Store_GetPoolByID_Call { + return &Store_GetPoolByID_Call{Call: _e.mock.On("GetPoolByID", ctx, poolID)} +} + +func (_c *Store_GetPoolByID_Call) Run(run func(ctx context.Context, poolID string)) *Store_GetPoolByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_GetPoolByID_Call) Return(_a0 params.Pool, _a1 error) *Store_GetPoolByID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetPoolByID_Call) RunAndReturn(run func(context.Context, string) (params.Pool, error)) *Store_GetPoolByID_Call { + _c.Call.Return(run) + return _c +} + // GetPoolInstanceByName provides a mock function with given fields: ctx, poolID, instanceName func (_m *Store) GetPoolInstanceByName(ctx context.Context, poolID string, instanceName string) (params.Instance, error) { ret := _m.Called(ctx, poolID, instanceName) @@ -1218,6 +2647,36 @@ func (_m *Store) GetPoolInstanceByName(ctx context.Context, poolID string, insta return r0, r1 } +// Store_GetPoolInstanceByName_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetPoolInstanceByName' +type Store_GetPoolInstanceByName_Call struct { + *mock.Call +} + +// GetPoolInstanceByName is a helper method to define mock.On call +// - ctx context.Context +// - poolID string +// - instanceName string +func (_e *Store_Expecter) GetPoolInstanceByName(ctx interface{}, poolID interface{}, instanceName interface{}) *Store_GetPoolInstanceByName_Call { + return &Store_GetPoolInstanceByName_Call{Call: _e.mock.On("GetPoolInstanceByName", ctx, poolID, instanceName)} +} + +func (_c *Store_GetPoolInstanceByName_Call) Run(run func(ctx context.Context, poolID string, instanceName string)) *Store_GetPoolInstanceByName_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string)) + }) + return _c +} + +func (_c *Store_GetPoolInstanceByName_Call) Return(_a0 params.Instance, _a1 error) *Store_GetPoolInstanceByName_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetPoolInstanceByName_Call) RunAndReturn(run func(context.Context, string, string) (params.Instance, error)) *Store_GetPoolInstanceByName_Call { + _c.Call.Return(run) + return _c +} + // GetRepository provides a mock function with given fields: ctx, owner, name, endpointName func (_m *Store) GetRepository(ctx context.Context, owner string, name string, endpointName string) (params.Repository, error) { ret := _m.Called(ctx, owner, name, endpointName) @@ -1246,6 +2705,37 @@ func (_m *Store) GetRepository(ctx context.Context, owner string, name string, e return r0, r1 } +// Store_GetRepository_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepository' +type Store_GetRepository_Call struct { + *mock.Call +} + +// GetRepository is a helper method to define mock.On call +// - ctx context.Context +// - owner string +// - name string +// - endpointName string +func (_e *Store_Expecter) GetRepository(ctx interface{}, owner interface{}, name interface{}, endpointName interface{}) *Store_GetRepository_Call { + return &Store_GetRepository_Call{Call: _e.mock.On("GetRepository", ctx, owner, name, endpointName)} +} + +func (_c *Store_GetRepository_Call) Run(run func(ctx context.Context, owner string, name string, endpointName string)) *Store_GetRepository_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(string)) + }) + return _c +} + +func (_c *Store_GetRepository_Call) Return(_a0 params.Repository, _a1 error) *Store_GetRepository_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetRepository_Call) RunAndReturn(run func(context.Context, string, string, string) (params.Repository, error)) *Store_GetRepository_Call { + _c.Call.Return(run) + return _c +} + // GetRepositoryByID provides a mock function with given fields: ctx, repoID func (_m *Store) GetRepositoryByID(ctx context.Context, repoID string) (params.Repository, error) { ret := _m.Called(ctx, repoID) @@ -1274,6 +2764,35 @@ func (_m *Store) GetRepositoryByID(ctx context.Context, repoID string) (params.R return r0, r1 } +// Store_GetRepositoryByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepositoryByID' +type Store_GetRepositoryByID_Call struct { + *mock.Call +} + +// GetRepositoryByID is a helper method to define mock.On call +// - ctx context.Context +// - repoID string +func (_e *Store_Expecter) GetRepositoryByID(ctx interface{}, repoID interface{}) *Store_GetRepositoryByID_Call { + return &Store_GetRepositoryByID_Call{Call: _e.mock.On("GetRepositoryByID", ctx, repoID)} +} + +func (_c *Store_GetRepositoryByID_Call) Run(run func(ctx context.Context, repoID string)) *Store_GetRepositoryByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_GetRepositoryByID_Call) Return(_a0 params.Repository, _a1 error) *Store_GetRepositoryByID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetRepositoryByID_Call) RunAndReturn(run func(context.Context, string) (params.Repository, error)) *Store_GetRepositoryByID_Call { + _c.Call.Return(run) + return _c +} + // GetScaleSetByID provides a mock function with given fields: ctx, scaleSet func (_m *Store) GetScaleSetByID(ctx context.Context, scaleSet uint) (params.ScaleSet, error) { ret := _m.Called(ctx, scaleSet) @@ -1302,6 +2821,35 @@ func (_m *Store) GetScaleSetByID(ctx context.Context, scaleSet uint) (params.Sca return r0, r1 } +// Store_GetScaleSetByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetScaleSetByID' +type Store_GetScaleSetByID_Call struct { + *mock.Call +} + +// GetScaleSetByID is a helper method to define mock.On call +// - ctx context.Context +// - scaleSet uint +func (_e *Store_Expecter) GetScaleSetByID(ctx interface{}, scaleSet interface{}) *Store_GetScaleSetByID_Call { + return &Store_GetScaleSetByID_Call{Call: _e.mock.On("GetScaleSetByID", ctx, scaleSet)} +} + +func (_c *Store_GetScaleSetByID_Call) Run(run func(ctx context.Context, scaleSet uint)) *Store_GetScaleSetByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint)) + }) + return _c +} + +func (_c *Store_GetScaleSetByID_Call) Return(_a0 params.ScaleSet, _a1 error) *Store_GetScaleSetByID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetScaleSetByID_Call) RunAndReturn(run func(context.Context, uint) (params.ScaleSet, error)) *Store_GetScaleSetByID_Call { + _c.Call.Return(run) + return _c +} + // GetUser provides a mock function with given fields: ctx, user func (_m *Store) GetUser(ctx context.Context, user string) (params.User, error) { ret := _m.Called(ctx, user) @@ -1330,6 +2878,35 @@ func (_m *Store) GetUser(ctx context.Context, user string) (params.User, error) return r0, r1 } +// Store_GetUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUser' +type Store_GetUser_Call struct { + *mock.Call +} + +// GetUser is a helper method to define mock.On call +// - ctx context.Context +// - user string +func (_e *Store_Expecter) GetUser(ctx interface{}, user interface{}) *Store_GetUser_Call { + return &Store_GetUser_Call{Call: _e.mock.On("GetUser", ctx, user)} +} + +func (_c *Store_GetUser_Call) Run(run func(ctx context.Context, user string)) *Store_GetUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_GetUser_Call) Return(_a0 params.User, _a1 error) *Store_GetUser_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetUser_Call) RunAndReturn(run func(context.Context, string) (params.User, error)) *Store_GetUser_Call { + _c.Call.Return(run) + return _c +} + // GetUserByID provides a mock function with given fields: ctx, userID func (_m *Store) GetUserByID(ctx context.Context, userID string) (params.User, error) { ret := _m.Called(ctx, userID) @@ -1358,6 +2935,35 @@ func (_m *Store) GetUserByID(ctx context.Context, userID string) (params.User, e return r0, r1 } +// Store_GetUserByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetUserByID' +type Store_GetUserByID_Call struct { + *mock.Call +} + +// GetUserByID is a helper method to define mock.On call +// - ctx context.Context +// - userID string +func (_e *Store_Expecter) GetUserByID(ctx interface{}, userID interface{}) *Store_GetUserByID_Call { + return &Store_GetUserByID_Call{Call: _e.mock.On("GetUserByID", ctx, userID)} +} + +func (_c *Store_GetUserByID_Call) Run(run func(ctx context.Context, userID string)) *Store_GetUserByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_GetUserByID_Call) Return(_a0 params.User, _a1 error) *Store_GetUserByID_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_GetUserByID_Call) RunAndReturn(run func(context.Context, string) (params.User, error)) *Store_GetUserByID_Call { + _c.Call.Return(run) + return _c +} + // HasAdminUser provides a mock function with given fields: ctx func (_m *Store) HasAdminUser(ctx context.Context) bool { ret := _m.Called(ctx) @@ -1376,6 +2982,34 @@ func (_m *Store) HasAdminUser(ctx context.Context) bool { return r0 } +// Store_HasAdminUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HasAdminUser' +type Store_HasAdminUser_Call struct { + *mock.Call +} + +// HasAdminUser is a helper method to define mock.On call +// - ctx context.Context +func (_e *Store_Expecter) HasAdminUser(ctx interface{}) *Store_HasAdminUser_Call { + return &Store_HasAdminUser_Call{Call: _e.mock.On("HasAdminUser", ctx)} +} + +func (_c *Store_HasAdminUser_Call) Run(run func(ctx context.Context)) *Store_HasAdminUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Store_HasAdminUser_Call) Return(_a0 bool) *Store_HasAdminUser_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_HasAdminUser_Call) RunAndReturn(run func(context.Context) bool) *Store_HasAdminUser_Call { + _c.Call.Return(run) + return _c +} + // InitController provides a mock function with no fields func (_m *Store) InitController() (params.ControllerInfo, error) { ret := _m.Called() @@ -1404,6 +3038,33 @@ func (_m *Store) InitController() (params.ControllerInfo, error) { return r0, r1 } +// Store_InitController_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InitController' +type Store_InitController_Call struct { + *mock.Call +} + +// InitController is a helper method to define mock.On call +func (_e *Store_Expecter) InitController() *Store_InitController_Call { + return &Store_InitController_Call{Call: _e.mock.On("InitController")} +} + +func (_c *Store_InitController_Call) Run(run func()) *Store_InitController_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Store_InitController_Call) Return(_a0 params.ControllerInfo, _a1 error) *Store_InitController_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_InitController_Call) RunAndReturn(run func() (params.ControllerInfo, error)) *Store_InitController_Call { + _c.Call.Return(run) + return _c +} + // ListAllInstances provides a mock function with given fields: ctx func (_m *Store) ListAllInstances(ctx context.Context) ([]params.Instance, error) { ret := _m.Called(ctx) @@ -1434,6 +3095,34 @@ func (_m *Store) ListAllInstances(ctx context.Context) ([]params.Instance, error return r0, r1 } +// Store_ListAllInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAllInstances' +type Store_ListAllInstances_Call struct { + *mock.Call +} + +// ListAllInstances is a helper method to define mock.On call +// - ctx context.Context +func (_e *Store_Expecter) ListAllInstances(ctx interface{}) *Store_ListAllInstances_Call { + return &Store_ListAllInstances_Call{Call: _e.mock.On("ListAllInstances", ctx)} +} + +func (_c *Store_ListAllInstances_Call) Run(run func(ctx context.Context)) *Store_ListAllInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Store_ListAllInstances_Call) Return(_a0 []params.Instance, _a1 error) *Store_ListAllInstances_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListAllInstances_Call) RunAndReturn(run func(context.Context) ([]params.Instance, error)) *Store_ListAllInstances_Call { + _c.Call.Return(run) + return _c +} + // ListAllJobs provides a mock function with given fields: ctx func (_m *Store) ListAllJobs(ctx context.Context) ([]params.Job, error) { ret := _m.Called(ctx) @@ -1464,6 +3153,34 @@ func (_m *Store) ListAllJobs(ctx context.Context) ([]params.Job, error) { return r0, r1 } +// Store_ListAllJobs_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAllJobs' +type Store_ListAllJobs_Call struct { + *mock.Call +} + +// ListAllJobs is a helper method to define mock.On call +// - ctx context.Context +func (_e *Store_Expecter) ListAllJobs(ctx interface{}) *Store_ListAllJobs_Call { + return &Store_ListAllJobs_Call{Call: _e.mock.On("ListAllJobs", ctx)} +} + +func (_c *Store_ListAllJobs_Call) Run(run func(ctx context.Context)) *Store_ListAllJobs_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Store_ListAllJobs_Call) Return(_a0 []params.Job, _a1 error) *Store_ListAllJobs_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListAllJobs_Call) RunAndReturn(run func(context.Context) ([]params.Job, error)) *Store_ListAllJobs_Call { + _c.Call.Return(run) + return _c +} + // ListAllPools provides a mock function with given fields: ctx func (_m *Store) ListAllPools(ctx context.Context) ([]params.Pool, error) { ret := _m.Called(ctx) @@ -1494,6 +3211,34 @@ func (_m *Store) ListAllPools(ctx context.Context) ([]params.Pool, error) { return r0, r1 } +// Store_ListAllPools_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAllPools' +type Store_ListAllPools_Call struct { + *mock.Call +} + +// ListAllPools is a helper method to define mock.On call +// - ctx context.Context +func (_e *Store_Expecter) ListAllPools(ctx interface{}) *Store_ListAllPools_Call { + return &Store_ListAllPools_Call{Call: _e.mock.On("ListAllPools", ctx)} +} + +func (_c *Store_ListAllPools_Call) Run(run func(ctx context.Context)) *Store_ListAllPools_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Store_ListAllPools_Call) Return(_a0 []params.Pool, _a1 error) *Store_ListAllPools_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListAllPools_Call) RunAndReturn(run func(context.Context) ([]params.Pool, error)) *Store_ListAllPools_Call { + _c.Call.Return(run) + return _c +} + // ListAllScaleSets provides a mock function with given fields: ctx func (_m *Store) ListAllScaleSets(ctx context.Context) ([]params.ScaleSet, error) { ret := _m.Called(ctx) @@ -1524,6 +3269,34 @@ func (_m *Store) ListAllScaleSets(ctx context.Context) ([]params.ScaleSet, error return r0, r1 } +// Store_ListAllScaleSets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListAllScaleSets' +type Store_ListAllScaleSets_Call struct { + *mock.Call +} + +// ListAllScaleSets is a helper method to define mock.On call +// - ctx context.Context +func (_e *Store_Expecter) ListAllScaleSets(ctx interface{}) *Store_ListAllScaleSets_Call { + return &Store_ListAllScaleSets_Call{Call: _e.mock.On("ListAllScaleSets", ctx)} +} + +func (_c *Store_ListAllScaleSets_Call) Run(run func(ctx context.Context)) *Store_ListAllScaleSets_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Store_ListAllScaleSets_Call) Return(_a0 []params.ScaleSet, _a1 error) *Store_ListAllScaleSets_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListAllScaleSets_Call) RunAndReturn(run func(context.Context) ([]params.ScaleSet, error)) *Store_ListAllScaleSets_Call { + _c.Call.Return(run) + return _c +} + // ListEnterprises provides a mock function with given fields: ctx, filter func (_m *Store) ListEnterprises(ctx context.Context, filter params.EnterpriseFilter) ([]params.Enterprise, error) { ret := _m.Called(ctx, filter) @@ -1554,6 +3327,35 @@ func (_m *Store) ListEnterprises(ctx context.Context, filter params.EnterpriseFi return r0, r1 } +// Store_ListEnterprises_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEnterprises' +type Store_ListEnterprises_Call struct { + *mock.Call +} + +// ListEnterprises is a helper method to define mock.On call +// - ctx context.Context +// - filter params.EnterpriseFilter +func (_e *Store_Expecter) ListEnterprises(ctx interface{}, filter interface{}) *Store_ListEnterprises_Call { + return &Store_ListEnterprises_Call{Call: _e.mock.On("ListEnterprises", ctx, filter)} +} + +func (_c *Store_ListEnterprises_Call) Run(run func(ctx context.Context, filter params.EnterpriseFilter)) *Store_ListEnterprises_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.EnterpriseFilter)) + }) + return _c +} + +func (_c *Store_ListEnterprises_Call) Return(_a0 []params.Enterprise, _a1 error) *Store_ListEnterprises_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListEnterprises_Call) RunAndReturn(run func(context.Context, params.EnterpriseFilter) ([]params.Enterprise, error)) *Store_ListEnterprises_Call { + _c.Call.Return(run) + return _c +} + // ListEntityInstances provides a mock function with given fields: ctx, entity func (_m *Store) ListEntityInstances(ctx context.Context, entity params.ForgeEntity) ([]params.Instance, error) { ret := _m.Called(ctx, entity) @@ -1584,6 +3386,35 @@ func (_m *Store) ListEntityInstances(ctx context.Context, entity params.ForgeEnt return r0, r1 } +// Store_ListEntityInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEntityInstances' +type Store_ListEntityInstances_Call struct { + *mock.Call +} + +// ListEntityInstances is a helper method to define mock.On call +// - ctx context.Context +// - entity params.ForgeEntity +func (_e *Store_Expecter) ListEntityInstances(ctx interface{}, entity interface{}) *Store_ListEntityInstances_Call { + return &Store_ListEntityInstances_Call{Call: _e.mock.On("ListEntityInstances", ctx, entity)} +} + +func (_c *Store_ListEntityInstances_Call) Run(run func(ctx context.Context, entity params.ForgeEntity)) *Store_ListEntityInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.ForgeEntity)) + }) + return _c +} + +func (_c *Store_ListEntityInstances_Call) Return(_a0 []params.Instance, _a1 error) *Store_ListEntityInstances_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListEntityInstances_Call) RunAndReturn(run func(context.Context, params.ForgeEntity) ([]params.Instance, error)) *Store_ListEntityInstances_Call { + _c.Call.Return(run) + return _c +} + // ListEntityJobsByStatus provides a mock function with given fields: ctx, entityType, entityID, status func (_m *Store) ListEntityJobsByStatus(ctx context.Context, entityType params.ForgeEntityType, entityID string, status params.JobStatus) ([]params.Job, error) { ret := _m.Called(ctx, entityType, entityID, status) @@ -1614,6 +3445,37 @@ func (_m *Store) ListEntityJobsByStatus(ctx context.Context, entityType params.F return r0, r1 } +// Store_ListEntityJobsByStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEntityJobsByStatus' +type Store_ListEntityJobsByStatus_Call struct { + *mock.Call +} + +// ListEntityJobsByStatus is a helper method to define mock.On call +// - ctx context.Context +// - entityType params.ForgeEntityType +// - entityID string +// - status params.JobStatus +func (_e *Store_Expecter) ListEntityJobsByStatus(ctx interface{}, entityType interface{}, entityID interface{}, status interface{}) *Store_ListEntityJobsByStatus_Call { + return &Store_ListEntityJobsByStatus_Call{Call: _e.mock.On("ListEntityJobsByStatus", ctx, entityType, entityID, status)} +} + +func (_c *Store_ListEntityJobsByStatus_Call) Run(run func(ctx context.Context, entityType params.ForgeEntityType, entityID string, status params.JobStatus)) *Store_ListEntityJobsByStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.ForgeEntityType), args[2].(string), args[3].(params.JobStatus)) + }) + return _c +} + +func (_c *Store_ListEntityJobsByStatus_Call) Return(_a0 []params.Job, _a1 error) *Store_ListEntityJobsByStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListEntityJobsByStatus_Call) RunAndReturn(run func(context.Context, params.ForgeEntityType, string, params.JobStatus) ([]params.Job, error)) *Store_ListEntityJobsByStatus_Call { + _c.Call.Return(run) + return _c +} + // ListEntityPools provides a mock function with given fields: ctx, entity func (_m *Store) ListEntityPools(ctx context.Context, entity params.ForgeEntity) ([]params.Pool, error) { ret := _m.Called(ctx, entity) @@ -1644,6 +3506,35 @@ func (_m *Store) ListEntityPools(ctx context.Context, entity params.ForgeEntity) return r0, r1 } +// Store_ListEntityPools_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEntityPools' +type Store_ListEntityPools_Call struct { + *mock.Call +} + +// ListEntityPools is a helper method to define mock.On call +// - ctx context.Context +// - entity params.ForgeEntity +func (_e *Store_Expecter) ListEntityPools(ctx interface{}, entity interface{}) *Store_ListEntityPools_Call { + return &Store_ListEntityPools_Call{Call: _e.mock.On("ListEntityPools", ctx, entity)} +} + +func (_c *Store_ListEntityPools_Call) Run(run func(ctx context.Context, entity params.ForgeEntity)) *Store_ListEntityPools_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.ForgeEntity)) + }) + return _c +} + +func (_c *Store_ListEntityPools_Call) Return(_a0 []params.Pool, _a1 error) *Store_ListEntityPools_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListEntityPools_Call) RunAndReturn(run func(context.Context, params.ForgeEntity) ([]params.Pool, error)) *Store_ListEntityPools_Call { + _c.Call.Return(run) + return _c +} + // ListEntityScaleSets provides a mock function with given fields: _a0, entity func (_m *Store) ListEntityScaleSets(_a0 context.Context, entity params.ForgeEntity) ([]params.ScaleSet, error) { ret := _m.Called(_a0, entity) @@ -1674,6 +3565,35 @@ func (_m *Store) ListEntityScaleSets(_a0 context.Context, entity params.ForgeEnt return r0, r1 } +// Store_ListEntityScaleSets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEntityScaleSets' +type Store_ListEntityScaleSets_Call struct { + *mock.Call +} + +// ListEntityScaleSets is a helper method to define mock.On call +// - _a0 context.Context +// - entity params.ForgeEntity +func (_e *Store_Expecter) ListEntityScaleSets(_a0 interface{}, entity interface{}) *Store_ListEntityScaleSets_Call { + return &Store_ListEntityScaleSets_Call{Call: _e.mock.On("ListEntityScaleSets", _a0, entity)} +} + +func (_c *Store_ListEntityScaleSets_Call) Run(run func(_a0 context.Context, entity params.ForgeEntity)) *Store_ListEntityScaleSets_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.ForgeEntity)) + }) + return _c +} + +func (_c *Store_ListEntityScaleSets_Call) Return(_a0 []params.ScaleSet, _a1 error) *Store_ListEntityScaleSets_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListEntityScaleSets_Call) RunAndReturn(run func(context.Context, params.ForgeEntity) ([]params.ScaleSet, error)) *Store_ListEntityScaleSets_Call { + _c.Call.Return(run) + return _c +} + // ListGiteaCredentials provides a mock function with given fields: ctx func (_m *Store) ListGiteaCredentials(ctx context.Context) ([]params.ForgeCredentials, error) { ret := _m.Called(ctx) @@ -1704,6 +3624,34 @@ func (_m *Store) ListGiteaCredentials(ctx context.Context) ([]params.ForgeCreden return r0, r1 } +// Store_ListGiteaCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListGiteaCredentials' +type Store_ListGiteaCredentials_Call struct { + *mock.Call +} + +// ListGiteaCredentials is a helper method to define mock.On call +// - ctx context.Context +func (_e *Store_Expecter) ListGiteaCredentials(ctx interface{}) *Store_ListGiteaCredentials_Call { + return &Store_ListGiteaCredentials_Call{Call: _e.mock.On("ListGiteaCredentials", ctx)} +} + +func (_c *Store_ListGiteaCredentials_Call) Run(run func(ctx context.Context)) *Store_ListGiteaCredentials_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Store_ListGiteaCredentials_Call) Return(_a0 []params.ForgeCredentials, _a1 error) *Store_ListGiteaCredentials_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListGiteaCredentials_Call) RunAndReturn(run func(context.Context) ([]params.ForgeCredentials, error)) *Store_ListGiteaCredentials_Call { + _c.Call.Return(run) + return _c +} + // ListGiteaEndpoints provides a mock function with given fields: _a0 func (_m *Store) ListGiteaEndpoints(_a0 context.Context) ([]params.ForgeEndpoint, error) { ret := _m.Called(_a0) @@ -1734,6 +3682,34 @@ func (_m *Store) ListGiteaEndpoints(_a0 context.Context) ([]params.ForgeEndpoint return r0, r1 } +// Store_ListGiteaEndpoints_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListGiteaEndpoints' +type Store_ListGiteaEndpoints_Call struct { + *mock.Call +} + +// ListGiteaEndpoints is a helper method to define mock.On call +// - _a0 context.Context +func (_e *Store_Expecter) ListGiteaEndpoints(_a0 interface{}) *Store_ListGiteaEndpoints_Call { + return &Store_ListGiteaEndpoints_Call{Call: _e.mock.On("ListGiteaEndpoints", _a0)} +} + +func (_c *Store_ListGiteaEndpoints_Call) Run(run func(_a0 context.Context)) *Store_ListGiteaEndpoints_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Store_ListGiteaEndpoints_Call) Return(_a0 []params.ForgeEndpoint, _a1 error) *Store_ListGiteaEndpoints_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListGiteaEndpoints_Call) RunAndReturn(run func(context.Context) ([]params.ForgeEndpoint, error)) *Store_ListGiteaEndpoints_Call { + _c.Call.Return(run) + return _c +} + // ListGithubCredentials provides a mock function with given fields: ctx func (_m *Store) ListGithubCredentials(ctx context.Context) ([]params.ForgeCredentials, error) { ret := _m.Called(ctx) @@ -1764,6 +3740,34 @@ func (_m *Store) ListGithubCredentials(ctx context.Context) ([]params.ForgeCrede return r0, r1 } +// Store_ListGithubCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListGithubCredentials' +type Store_ListGithubCredentials_Call struct { + *mock.Call +} + +// ListGithubCredentials is a helper method to define mock.On call +// - ctx context.Context +func (_e *Store_Expecter) ListGithubCredentials(ctx interface{}) *Store_ListGithubCredentials_Call { + return &Store_ListGithubCredentials_Call{Call: _e.mock.On("ListGithubCredentials", ctx)} +} + +func (_c *Store_ListGithubCredentials_Call) Run(run func(ctx context.Context)) *Store_ListGithubCredentials_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Store_ListGithubCredentials_Call) Return(_a0 []params.ForgeCredentials, _a1 error) *Store_ListGithubCredentials_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListGithubCredentials_Call) RunAndReturn(run func(context.Context) ([]params.ForgeCredentials, error)) *Store_ListGithubCredentials_Call { + _c.Call.Return(run) + return _c +} + // ListGithubEndpoints provides a mock function with given fields: ctx func (_m *Store) ListGithubEndpoints(ctx context.Context) ([]params.ForgeEndpoint, error) { ret := _m.Called(ctx) @@ -1794,6 +3798,34 @@ func (_m *Store) ListGithubEndpoints(ctx context.Context) ([]params.ForgeEndpoin return r0, r1 } +// Store_ListGithubEndpoints_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListGithubEndpoints' +type Store_ListGithubEndpoints_Call struct { + *mock.Call +} + +// ListGithubEndpoints is a helper method to define mock.On call +// - ctx context.Context +func (_e *Store_Expecter) ListGithubEndpoints(ctx interface{}) *Store_ListGithubEndpoints_Call { + return &Store_ListGithubEndpoints_Call{Call: _e.mock.On("ListGithubEndpoints", ctx)} +} + +func (_c *Store_ListGithubEndpoints_Call) Run(run func(ctx context.Context)) *Store_ListGithubEndpoints_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *Store_ListGithubEndpoints_Call) Return(_a0 []params.ForgeEndpoint, _a1 error) *Store_ListGithubEndpoints_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListGithubEndpoints_Call) RunAndReturn(run func(context.Context) ([]params.ForgeEndpoint, error)) *Store_ListGithubEndpoints_Call { + _c.Call.Return(run) + return _c +} + // ListJobsByStatus provides a mock function with given fields: ctx, status func (_m *Store) ListJobsByStatus(ctx context.Context, status params.JobStatus) ([]params.Job, error) { ret := _m.Called(ctx, status) @@ -1824,6 +3856,35 @@ func (_m *Store) ListJobsByStatus(ctx context.Context, status params.JobStatus) return r0, r1 } +// Store_ListJobsByStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListJobsByStatus' +type Store_ListJobsByStatus_Call struct { + *mock.Call +} + +// ListJobsByStatus is a helper method to define mock.On call +// - ctx context.Context +// - status params.JobStatus +func (_e *Store_Expecter) ListJobsByStatus(ctx interface{}, status interface{}) *Store_ListJobsByStatus_Call { + return &Store_ListJobsByStatus_Call{Call: _e.mock.On("ListJobsByStatus", ctx, status)} +} + +func (_c *Store_ListJobsByStatus_Call) Run(run func(ctx context.Context, status params.JobStatus)) *Store_ListJobsByStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.JobStatus)) + }) + return _c +} + +func (_c *Store_ListJobsByStatus_Call) Return(_a0 []params.Job, _a1 error) *Store_ListJobsByStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListJobsByStatus_Call) RunAndReturn(run func(context.Context, params.JobStatus) ([]params.Job, error)) *Store_ListJobsByStatus_Call { + _c.Call.Return(run) + return _c +} + // ListOrganizations provides a mock function with given fields: ctx, filter func (_m *Store) ListOrganizations(ctx context.Context, filter params.OrganizationFilter) ([]params.Organization, error) { ret := _m.Called(ctx, filter) @@ -1854,6 +3915,35 @@ func (_m *Store) ListOrganizations(ctx context.Context, filter params.Organizati return r0, r1 } +// Store_ListOrganizations_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListOrganizations' +type Store_ListOrganizations_Call struct { + *mock.Call +} + +// ListOrganizations is a helper method to define mock.On call +// - ctx context.Context +// - filter params.OrganizationFilter +func (_e *Store_Expecter) ListOrganizations(ctx interface{}, filter interface{}) *Store_ListOrganizations_Call { + return &Store_ListOrganizations_Call{Call: _e.mock.On("ListOrganizations", ctx, filter)} +} + +func (_c *Store_ListOrganizations_Call) Run(run func(ctx context.Context, filter params.OrganizationFilter)) *Store_ListOrganizations_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.OrganizationFilter)) + }) + return _c +} + +func (_c *Store_ListOrganizations_Call) Return(_a0 []params.Organization, _a1 error) *Store_ListOrganizations_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListOrganizations_Call) RunAndReturn(run func(context.Context, params.OrganizationFilter) ([]params.Organization, error)) *Store_ListOrganizations_Call { + _c.Call.Return(run) + return _c +} + // ListPoolInstances provides a mock function with given fields: ctx, poolID func (_m *Store) ListPoolInstances(ctx context.Context, poolID string) ([]params.Instance, error) { ret := _m.Called(ctx, poolID) @@ -1884,6 +3974,35 @@ func (_m *Store) ListPoolInstances(ctx context.Context, poolID string) ([]params return r0, r1 } +// Store_ListPoolInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListPoolInstances' +type Store_ListPoolInstances_Call struct { + *mock.Call +} + +// ListPoolInstances is a helper method to define mock.On call +// - ctx context.Context +// - poolID string +func (_e *Store_Expecter) ListPoolInstances(ctx interface{}, poolID interface{}) *Store_ListPoolInstances_Call { + return &Store_ListPoolInstances_Call{Call: _e.mock.On("ListPoolInstances", ctx, poolID)} +} + +func (_c *Store_ListPoolInstances_Call) Run(run func(ctx context.Context, poolID string)) *Store_ListPoolInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_ListPoolInstances_Call) Return(_a0 []params.Instance, _a1 error) *Store_ListPoolInstances_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListPoolInstances_Call) RunAndReturn(run func(context.Context, string) ([]params.Instance, error)) *Store_ListPoolInstances_Call { + _c.Call.Return(run) + return _c +} + // ListRepositories provides a mock function with given fields: ctx, filter func (_m *Store) ListRepositories(ctx context.Context, filter params.RepositoryFilter) ([]params.Repository, error) { ret := _m.Called(ctx, filter) @@ -1914,6 +4033,35 @@ func (_m *Store) ListRepositories(ctx context.Context, filter params.RepositoryF return r0, r1 } +// Store_ListRepositories_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListRepositories' +type Store_ListRepositories_Call struct { + *mock.Call +} + +// ListRepositories is a helper method to define mock.On call +// - ctx context.Context +// - filter params.RepositoryFilter +func (_e *Store_Expecter) ListRepositories(ctx interface{}, filter interface{}) *Store_ListRepositories_Call { + return &Store_ListRepositories_Call{Call: _e.mock.On("ListRepositories", ctx, filter)} +} + +func (_c *Store_ListRepositories_Call) Run(run func(ctx context.Context, filter params.RepositoryFilter)) *Store_ListRepositories_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.RepositoryFilter)) + }) + return _c +} + +func (_c *Store_ListRepositories_Call) Return(_a0 []params.Repository, _a1 error) *Store_ListRepositories_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListRepositories_Call) RunAndReturn(run func(context.Context, params.RepositoryFilter) ([]params.Repository, error)) *Store_ListRepositories_Call { + _c.Call.Return(run) + return _c +} + // ListScaleSetInstances provides a mock function with given fields: _a0, scalesetID func (_m *Store) ListScaleSetInstances(_a0 context.Context, scalesetID uint) ([]params.Instance, error) { ret := _m.Called(_a0, scalesetID) @@ -1944,6 +4092,35 @@ func (_m *Store) ListScaleSetInstances(_a0 context.Context, scalesetID uint) ([] return r0, r1 } +// Store_ListScaleSetInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListScaleSetInstances' +type Store_ListScaleSetInstances_Call struct { + *mock.Call +} + +// ListScaleSetInstances is a helper method to define mock.On call +// - _a0 context.Context +// - scalesetID uint +func (_e *Store_Expecter) ListScaleSetInstances(_a0 interface{}, scalesetID interface{}) *Store_ListScaleSetInstances_Call { + return &Store_ListScaleSetInstances_Call{Call: _e.mock.On("ListScaleSetInstances", _a0, scalesetID)} +} + +func (_c *Store_ListScaleSetInstances_Call) Run(run func(_a0 context.Context, scalesetID uint)) *Store_ListScaleSetInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint)) + }) + return _c +} + +func (_c *Store_ListScaleSetInstances_Call) Return(_a0 []params.Instance, _a1 error) *Store_ListScaleSetInstances_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_ListScaleSetInstances_Call) RunAndReturn(run func(context.Context, uint) ([]params.Instance, error)) *Store_ListScaleSetInstances_Call { + _c.Call.Return(run) + return _c +} + // LockJob provides a mock function with given fields: ctx, jobID, entityID func (_m *Store) LockJob(ctx context.Context, jobID int64, entityID string) error { ret := _m.Called(ctx, jobID, entityID) @@ -1962,6 +4139,36 @@ func (_m *Store) LockJob(ctx context.Context, jobID int64, entityID string) erro return r0 } +// Store_LockJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LockJob' +type Store_LockJob_Call struct { + *mock.Call +} + +// LockJob is a helper method to define mock.On call +// - ctx context.Context +// - jobID int64 +// - entityID string +func (_e *Store_Expecter) LockJob(ctx interface{}, jobID interface{}, entityID interface{}) *Store_LockJob_Call { + return &Store_LockJob_Call{Call: _e.mock.On("LockJob", ctx, jobID, entityID)} +} + +func (_c *Store_LockJob_Call) Run(run func(ctx context.Context, jobID int64, entityID string)) *Store_LockJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(string)) + }) + return _c +} + +func (_c *Store_LockJob_Call) Return(_a0 error) *Store_LockJob_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_LockJob_Call) RunAndReturn(run func(context.Context, int64, string) error) *Store_LockJob_Call { + _c.Call.Return(run) + return _c +} + // PoolInstanceCount provides a mock function with given fields: ctx, poolID func (_m *Store) PoolInstanceCount(ctx context.Context, poolID string) (int64, error) { ret := _m.Called(ctx, poolID) @@ -1990,6 +4197,35 @@ func (_m *Store) PoolInstanceCount(ctx context.Context, poolID string) (int64, e return r0, r1 } +// Store_PoolInstanceCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PoolInstanceCount' +type Store_PoolInstanceCount_Call struct { + *mock.Call +} + +// PoolInstanceCount is a helper method to define mock.On call +// - ctx context.Context +// - poolID string +func (_e *Store_Expecter) PoolInstanceCount(ctx interface{}, poolID interface{}) *Store_PoolInstanceCount_Call { + return &Store_PoolInstanceCount_Call{Call: _e.mock.On("PoolInstanceCount", ctx, poolID)} +} + +func (_c *Store_PoolInstanceCount_Call) Run(run func(ctx context.Context, poolID string)) *Store_PoolInstanceCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *Store_PoolInstanceCount_Call) Return(_a0 int64, _a1 error) *Store_PoolInstanceCount_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_PoolInstanceCount_Call) RunAndReturn(run func(context.Context, string) (int64, error)) *Store_PoolInstanceCount_Call { + _c.Call.Return(run) + return _c +} + // SetScaleSetDesiredRunnerCount provides a mock function with given fields: ctx, scaleSetID, desiredRunnerCount func (_m *Store) SetScaleSetDesiredRunnerCount(ctx context.Context, scaleSetID uint, desiredRunnerCount int) error { ret := _m.Called(ctx, scaleSetID, desiredRunnerCount) @@ -2008,6 +4244,36 @@ func (_m *Store) SetScaleSetDesiredRunnerCount(ctx context.Context, scaleSetID u return r0 } +// Store_SetScaleSetDesiredRunnerCount_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetScaleSetDesiredRunnerCount' +type Store_SetScaleSetDesiredRunnerCount_Call struct { + *mock.Call +} + +// SetScaleSetDesiredRunnerCount is a helper method to define mock.On call +// - ctx context.Context +// - scaleSetID uint +// - desiredRunnerCount int +func (_e *Store_Expecter) SetScaleSetDesiredRunnerCount(ctx interface{}, scaleSetID interface{}, desiredRunnerCount interface{}) *Store_SetScaleSetDesiredRunnerCount_Call { + return &Store_SetScaleSetDesiredRunnerCount_Call{Call: _e.mock.On("SetScaleSetDesiredRunnerCount", ctx, scaleSetID, desiredRunnerCount)} +} + +func (_c *Store_SetScaleSetDesiredRunnerCount_Call) Run(run func(ctx context.Context, scaleSetID uint, desiredRunnerCount int)) *Store_SetScaleSetDesiredRunnerCount_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint), args[2].(int)) + }) + return _c +} + +func (_c *Store_SetScaleSetDesiredRunnerCount_Call) Return(_a0 error) *Store_SetScaleSetDesiredRunnerCount_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_SetScaleSetDesiredRunnerCount_Call) RunAndReturn(run func(context.Context, uint, int) error) *Store_SetScaleSetDesiredRunnerCount_Call { + _c.Call.Return(run) + return _c +} + // SetScaleSetLastMessageID provides a mock function with given fields: ctx, scaleSetID, lastMessageID func (_m *Store) SetScaleSetLastMessageID(ctx context.Context, scaleSetID uint, lastMessageID int64) error { ret := _m.Called(ctx, scaleSetID, lastMessageID) @@ -2026,6 +4292,36 @@ func (_m *Store) SetScaleSetLastMessageID(ctx context.Context, scaleSetID uint, return r0 } +// Store_SetScaleSetLastMessageID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetScaleSetLastMessageID' +type Store_SetScaleSetLastMessageID_Call struct { + *mock.Call +} + +// SetScaleSetLastMessageID is a helper method to define mock.On call +// - ctx context.Context +// - scaleSetID uint +// - lastMessageID int64 +func (_e *Store_Expecter) SetScaleSetLastMessageID(ctx interface{}, scaleSetID interface{}, lastMessageID interface{}) *Store_SetScaleSetLastMessageID_Call { + return &Store_SetScaleSetLastMessageID_Call{Call: _e.mock.On("SetScaleSetLastMessageID", ctx, scaleSetID, lastMessageID)} +} + +func (_c *Store_SetScaleSetLastMessageID_Call) Run(run func(ctx context.Context, scaleSetID uint, lastMessageID int64)) *Store_SetScaleSetLastMessageID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint), args[2].(int64)) + }) + return _c +} + +func (_c *Store_SetScaleSetLastMessageID_Call) Return(_a0 error) *Store_SetScaleSetLastMessageID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_SetScaleSetLastMessageID_Call) RunAndReturn(run func(context.Context, uint, int64) error) *Store_SetScaleSetLastMessageID_Call { + _c.Call.Return(run) + return _c +} + // UnlockJob provides a mock function with given fields: ctx, jobID, entityID func (_m *Store) UnlockJob(ctx context.Context, jobID int64, entityID string) error { ret := _m.Called(ctx, jobID, entityID) @@ -2044,6 +4340,36 @@ func (_m *Store) UnlockJob(ctx context.Context, jobID int64, entityID string) er return r0 } +// Store_UnlockJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnlockJob' +type Store_UnlockJob_Call struct { + *mock.Call +} + +// UnlockJob is a helper method to define mock.On call +// - ctx context.Context +// - jobID int64 +// - entityID string +func (_e *Store_Expecter) UnlockJob(ctx interface{}, jobID interface{}, entityID interface{}) *Store_UnlockJob_Call { + return &Store_UnlockJob_Call{Call: _e.mock.On("UnlockJob", ctx, jobID, entityID)} +} + +func (_c *Store_UnlockJob_Call) Run(run func(ctx context.Context, jobID int64, entityID string)) *Store_UnlockJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64), args[2].(string)) + }) + return _c +} + +func (_c *Store_UnlockJob_Call) Return(_a0 error) *Store_UnlockJob_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Store_UnlockJob_Call) RunAndReturn(run func(context.Context, int64, string) error) *Store_UnlockJob_Call { + _c.Call.Return(run) + return _c +} + // UpdateController provides a mock function with given fields: info func (_m *Store) UpdateController(info params.UpdateControllerParams) (params.ControllerInfo, error) { ret := _m.Called(info) @@ -2072,6 +4398,34 @@ func (_m *Store) UpdateController(info params.UpdateControllerParams) (params.Co return r0, r1 } +// Store_UpdateController_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateController' +type Store_UpdateController_Call struct { + *mock.Call +} + +// UpdateController is a helper method to define mock.On call +// - info params.UpdateControllerParams +func (_e *Store_Expecter) UpdateController(info interface{}) *Store_UpdateController_Call { + return &Store_UpdateController_Call{Call: _e.mock.On("UpdateController", info)} +} + +func (_c *Store_UpdateController_Call) Run(run func(info params.UpdateControllerParams)) *Store_UpdateController_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(params.UpdateControllerParams)) + }) + return _c +} + +func (_c *Store_UpdateController_Call) Return(_a0 params.ControllerInfo, _a1 error) *Store_UpdateController_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_UpdateController_Call) RunAndReturn(run func(params.UpdateControllerParams) (params.ControllerInfo, error)) *Store_UpdateController_Call { + _c.Call.Return(run) + return _c +} + // UpdateEnterprise provides a mock function with given fields: ctx, enterpriseID, param func (_m *Store) UpdateEnterprise(ctx context.Context, enterpriseID string, param params.UpdateEntityParams) (params.Enterprise, error) { ret := _m.Called(ctx, enterpriseID, param) @@ -2100,6 +4454,36 @@ func (_m *Store) UpdateEnterprise(ctx context.Context, enterpriseID string, para return r0, r1 } +// Store_UpdateEnterprise_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateEnterprise' +type Store_UpdateEnterprise_Call struct { + *mock.Call +} + +// UpdateEnterprise is a helper method to define mock.On call +// - ctx context.Context +// - enterpriseID string +// - param params.UpdateEntityParams +func (_e *Store_Expecter) UpdateEnterprise(ctx interface{}, enterpriseID interface{}, param interface{}) *Store_UpdateEnterprise_Call { + return &Store_UpdateEnterprise_Call{Call: _e.mock.On("UpdateEnterprise", ctx, enterpriseID, param)} +} + +func (_c *Store_UpdateEnterprise_Call) Run(run func(ctx context.Context, enterpriseID string, param params.UpdateEntityParams)) *Store_UpdateEnterprise_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(params.UpdateEntityParams)) + }) + return _c +} + +func (_c *Store_UpdateEnterprise_Call) Return(_a0 params.Enterprise, _a1 error) *Store_UpdateEnterprise_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_UpdateEnterprise_Call) RunAndReturn(run func(context.Context, string, params.UpdateEntityParams) (params.Enterprise, error)) *Store_UpdateEnterprise_Call { + _c.Call.Return(run) + return _c +} + // UpdateEntityPool provides a mock function with given fields: ctx, entity, poolID, param func (_m *Store) UpdateEntityPool(ctx context.Context, entity params.ForgeEntity, poolID string, param params.UpdatePoolParams) (params.Pool, error) { ret := _m.Called(ctx, entity, poolID, param) @@ -2128,6 +4512,37 @@ func (_m *Store) UpdateEntityPool(ctx context.Context, entity params.ForgeEntity return r0, r1 } +// Store_UpdateEntityPool_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateEntityPool' +type Store_UpdateEntityPool_Call struct { + *mock.Call +} + +// UpdateEntityPool is a helper method to define mock.On call +// - ctx context.Context +// - entity params.ForgeEntity +// - poolID string +// - param params.UpdatePoolParams +func (_e *Store_Expecter) UpdateEntityPool(ctx interface{}, entity interface{}, poolID interface{}, param interface{}) *Store_UpdateEntityPool_Call { + return &Store_UpdateEntityPool_Call{Call: _e.mock.On("UpdateEntityPool", ctx, entity, poolID, param)} +} + +func (_c *Store_UpdateEntityPool_Call) Run(run func(ctx context.Context, entity params.ForgeEntity, poolID string, param params.UpdatePoolParams)) *Store_UpdateEntityPool_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.ForgeEntity), args[2].(string), args[3].(params.UpdatePoolParams)) + }) + return _c +} + +func (_c *Store_UpdateEntityPool_Call) Return(_a0 params.Pool, _a1 error) *Store_UpdateEntityPool_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_UpdateEntityPool_Call) RunAndReturn(run func(context.Context, params.ForgeEntity, string, params.UpdatePoolParams) (params.Pool, error)) *Store_UpdateEntityPool_Call { + _c.Call.Return(run) + return _c +} + // UpdateEntityScaleSet provides a mock function with given fields: _a0, entity, scaleSetID, param, callback func (_m *Store) UpdateEntityScaleSet(_a0 context.Context, entity params.ForgeEntity, scaleSetID uint, param params.UpdateScaleSetParams, callback func(params.ScaleSet, params.ScaleSet) error) (params.ScaleSet, error) { ret := _m.Called(_a0, entity, scaleSetID, param, callback) @@ -2156,6 +4571,38 @@ func (_m *Store) UpdateEntityScaleSet(_a0 context.Context, entity params.ForgeEn return r0, r1 } +// Store_UpdateEntityScaleSet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateEntityScaleSet' +type Store_UpdateEntityScaleSet_Call struct { + *mock.Call +} + +// UpdateEntityScaleSet is a helper method to define mock.On call +// - _a0 context.Context +// - entity params.ForgeEntity +// - scaleSetID uint +// - param params.UpdateScaleSetParams +// - callback func(params.ScaleSet , params.ScaleSet) error +func (_e *Store_Expecter) UpdateEntityScaleSet(_a0 interface{}, entity interface{}, scaleSetID interface{}, param interface{}, callback interface{}) *Store_UpdateEntityScaleSet_Call { + return &Store_UpdateEntityScaleSet_Call{Call: _e.mock.On("UpdateEntityScaleSet", _a0, entity, scaleSetID, param, callback)} +} + +func (_c *Store_UpdateEntityScaleSet_Call) Run(run func(_a0 context.Context, entity params.ForgeEntity, scaleSetID uint, param params.UpdateScaleSetParams, callback func(params.ScaleSet, params.ScaleSet) error)) *Store_UpdateEntityScaleSet_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.ForgeEntity), args[2].(uint), args[3].(params.UpdateScaleSetParams), args[4].(func(params.ScaleSet, params.ScaleSet) error)) + }) + return _c +} + +func (_c *Store_UpdateEntityScaleSet_Call) Return(updatedScaleSet params.ScaleSet, err error) *Store_UpdateEntityScaleSet_Call { + _c.Call.Return(updatedScaleSet, err) + return _c +} + +func (_c *Store_UpdateEntityScaleSet_Call) RunAndReturn(run func(context.Context, params.ForgeEntity, uint, params.UpdateScaleSetParams, func(params.ScaleSet, params.ScaleSet) error) (params.ScaleSet, error)) *Store_UpdateEntityScaleSet_Call { + _c.Call.Return(run) + return _c +} + // UpdateGiteaCredentials provides a mock function with given fields: ctx, id, param func (_m *Store) UpdateGiteaCredentials(ctx context.Context, id uint, param params.UpdateGiteaCredentialsParams) (params.ForgeCredentials, error) { ret := _m.Called(ctx, id, param) @@ -2184,6 +4631,36 @@ func (_m *Store) UpdateGiteaCredentials(ctx context.Context, id uint, param para return r0, r1 } +// Store_UpdateGiteaCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateGiteaCredentials' +type Store_UpdateGiteaCredentials_Call struct { + *mock.Call +} + +// UpdateGiteaCredentials is a helper method to define mock.On call +// - ctx context.Context +// - id uint +// - param params.UpdateGiteaCredentialsParams +func (_e *Store_Expecter) UpdateGiteaCredentials(ctx interface{}, id interface{}, param interface{}) *Store_UpdateGiteaCredentials_Call { + return &Store_UpdateGiteaCredentials_Call{Call: _e.mock.On("UpdateGiteaCredentials", ctx, id, param)} +} + +func (_c *Store_UpdateGiteaCredentials_Call) Run(run func(ctx context.Context, id uint, param params.UpdateGiteaCredentialsParams)) *Store_UpdateGiteaCredentials_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint), args[2].(params.UpdateGiteaCredentialsParams)) + }) + return _c +} + +func (_c *Store_UpdateGiteaCredentials_Call) Return(gtCreds params.ForgeCredentials, err error) *Store_UpdateGiteaCredentials_Call { + _c.Call.Return(gtCreds, err) + return _c +} + +func (_c *Store_UpdateGiteaCredentials_Call) RunAndReturn(run func(context.Context, uint, params.UpdateGiteaCredentialsParams) (params.ForgeCredentials, error)) *Store_UpdateGiteaCredentials_Call { + _c.Call.Return(run) + return _c +} + // UpdateGiteaEndpoint provides a mock function with given fields: _a0, name, param func (_m *Store) UpdateGiteaEndpoint(_a0 context.Context, name string, param params.UpdateGiteaEndpointParams) (params.ForgeEndpoint, error) { ret := _m.Called(_a0, name, param) @@ -2212,6 +4689,36 @@ func (_m *Store) UpdateGiteaEndpoint(_a0 context.Context, name string, param par return r0, r1 } +// Store_UpdateGiteaEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateGiteaEndpoint' +type Store_UpdateGiteaEndpoint_Call struct { + *mock.Call +} + +// UpdateGiteaEndpoint is a helper method to define mock.On call +// - _a0 context.Context +// - name string +// - param params.UpdateGiteaEndpointParams +func (_e *Store_Expecter) UpdateGiteaEndpoint(_a0 interface{}, name interface{}, param interface{}) *Store_UpdateGiteaEndpoint_Call { + return &Store_UpdateGiteaEndpoint_Call{Call: _e.mock.On("UpdateGiteaEndpoint", _a0, name, param)} +} + +func (_c *Store_UpdateGiteaEndpoint_Call) Run(run func(_a0 context.Context, name string, param params.UpdateGiteaEndpointParams)) *Store_UpdateGiteaEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(params.UpdateGiteaEndpointParams)) + }) + return _c +} + +func (_c *Store_UpdateGiteaEndpoint_Call) Return(ghEndpoint params.ForgeEndpoint, err error) *Store_UpdateGiteaEndpoint_Call { + _c.Call.Return(ghEndpoint, err) + return _c +} + +func (_c *Store_UpdateGiteaEndpoint_Call) RunAndReturn(run func(context.Context, string, params.UpdateGiteaEndpointParams) (params.ForgeEndpoint, error)) *Store_UpdateGiteaEndpoint_Call { + _c.Call.Return(run) + return _c +} + // UpdateGithubCredentials provides a mock function with given fields: ctx, id, param func (_m *Store) UpdateGithubCredentials(ctx context.Context, id uint, param params.UpdateGithubCredentialsParams) (params.ForgeCredentials, error) { ret := _m.Called(ctx, id, param) @@ -2240,6 +4747,36 @@ func (_m *Store) UpdateGithubCredentials(ctx context.Context, id uint, param par return r0, r1 } +// Store_UpdateGithubCredentials_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateGithubCredentials' +type Store_UpdateGithubCredentials_Call struct { + *mock.Call +} + +// UpdateGithubCredentials is a helper method to define mock.On call +// - ctx context.Context +// - id uint +// - param params.UpdateGithubCredentialsParams +func (_e *Store_Expecter) UpdateGithubCredentials(ctx interface{}, id interface{}, param interface{}) *Store_UpdateGithubCredentials_Call { + return &Store_UpdateGithubCredentials_Call{Call: _e.mock.On("UpdateGithubCredentials", ctx, id, param)} +} + +func (_c *Store_UpdateGithubCredentials_Call) Run(run func(ctx context.Context, id uint, param params.UpdateGithubCredentialsParams)) *Store_UpdateGithubCredentials_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(uint), args[2].(params.UpdateGithubCredentialsParams)) + }) + return _c +} + +func (_c *Store_UpdateGithubCredentials_Call) Return(_a0 params.ForgeCredentials, _a1 error) *Store_UpdateGithubCredentials_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_UpdateGithubCredentials_Call) RunAndReturn(run func(context.Context, uint, params.UpdateGithubCredentialsParams) (params.ForgeCredentials, error)) *Store_UpdateGithubCredentials_Call { + _c.Call.Return(run) + return _c +} + // UpdateGithubEndpoint provides a mock function with given fields: ctx, name, param func (_m *Store) UpdateGithubEndpoint(ctx context.Context, name string, param params.UpdateGithubEndpointParams) (params.ForgeEndpoint, error) { ret := _m.Called(ctx, name, param) @@ -2268,6 +4805,36 @@ func (_m *Store) UpdateGithubEndpoint(ctx context.Context, name string, param pa return r0, r1 } +// Store_UpdateGithubEndpoint_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateGithubEndpoint' +type Store_UpdateGithubEndpoint_Call struct { + *mock.Call +} + +// UpdateGithubEndpoint is a helper method to define mock.On call +// - ctx context.Context +// - name string +// - param params.UpdateGithubEndpointParams +func (_e *Store_Expecter) UpdateGithubEndpoint(ctx interface{}, name interface{}, param interface{}) *Store_UpdateGithubEndpoint_Call { + return &Store_UpdateGithubEndpoint_Call{Call: _e.mock.On("UpdateGithubEndpoint", ctx, name, param)} +} + +func (_c *Store_UpdateGithubEndpoint_Call) Run(run func(ctx context.Context, name string, param params.UpdateGithubEndpointParams)) *Store_UpdateGithubEndpoint_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(params.UpdateGithubEndpointParams)) + }) + return _c +} + +func (_c *Store_UpdateGithubEndpoint_Call) Return(_a0 params.ForgeEndpoint, _a1 error) *Store_UpdateGithubEndpoint_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_UpdateGithubEndpoint_Call) RunAndReturn(run func(context.Context, string, params.UpdateGithubEndpointParams) (params.ForgeEndpoint, error)) *Store_UpdateGithubEndpoint_Call { + _c.Call.Return(run) + return _c +} + // UpdateInstance provides a mock function with given fields: ctx, instanceName, param func (_m *Store) UpdateInstance(ctx context.Context, instanceName string, param params.UpdateInstanceParams) (params.Instance, error) { ret := _m.Called(ctx, instanceName, param) @@ -2296,6 +4863,36 @@ func (_m *Store) UpdateInstance(ctx context.Context, instanceName string, param return r0, r1 } +// Store_UpdateInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateInstance' +type Store_UpdateInstance_Call struct { + *mock.Call +} + +// UpdateInstance is a helper method to define mock.On call +// - ctx context.Context +// - instanceName string +// - param params.UpdateInstanceParams +func (_e *Store_Expecter) UpdateInstance(ctx interface{}, instanceName interface{}, param interface{}) *Store_UpdateInstance_Call { + return &Store_UpdateInstance_Call{Call: _e.mock.On("UpdateInstance", ctx, instanceName, param)} +} + +func (_c *Store_UpdateInstance_Call) Run(run func(ctx context.Context, instanceName string, param params.UpdateInstanceParams)) *Store_UpdateInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(params.UpdateInstanceParams)) + }) + return _c +} + +func (_c *Store_UpdateInstance_Call) Return(_a0 params.Instance, _a1 error) *Store_UpdateInstance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_UpdateInstance_Call) RunAndReturn(run func(context.Context, string, params.UpdateInstanceParams) (params.Instance, error)) *Store_UpdateInstance_Call { + _c.Call.Return(run) + return _c +} + // UpdateOrganization provides a mock function with given fields: ctx, orgID, param func (_m *Store) UpdateOrganization(ctx context.Context, orgID string, param params.UpdateEntityParams) (params.Organization, error) { ret := _m.Called(ctx, orgID, param) @@ -2324,6 +4921,36 @@ func (_m *Store) UpdateOrganization(ctx context.Context, orgID string, param par return r0, r1 } +// Store_UpdateOrganization_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateOrganization' +type Store_UpdateOrganization_Call struct { + *mock.Call +} + +// UpdateOrganization is a helper method to define mock.On call +// - ctx context.Context +// - orgID string +// - param params.UpdateEntityParams +func (_e *Store_Expecter) UpdateOrganization(ctx interface{}, orgID interface{}, param interface{}) *Store_UpdateOrganization_Call { + return &Store_UpdateOrganization_Call{Call: _e.mock.On("UpdateOrganization", ctx, orgID, param)} +} + +func (_c *Store_UpdateOrganization_Call) Run(run func(ctx context.Context, orgID string, param params.UpdateEntityParams)) *Store_UpdateOrganization_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(params.UpdateEntityParams)) + }) + return _c +} + +func (_c *Store_UpdateOrganization_Call) Return(_a0 params.Organization, _a1 error) *Store_UpdateOrganization_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_UpdateOrganization_Call) RunAndReturn(run func(context.Context, string, params.UpdateEntityParams) (params.Organization, error)) *Store_UpdateOrganization_Call { + _c.Call.Return(run) + return _c +} + // UpdateRepository provides a mock function with given fields: ctx, repoID, param func (_m *Store) UpdateRepository(ctx context.Context, repoID string, param params.UpdateEntityParams) (params.Repository, error) { ret := _m.Called(ctx, repoID, param) @@ -2352,6 +4979,36 @@ func (_m *Store) UpdateRepository(ctx context.Context, repoID string, param para return r0, r1 } +// Store_UpdateRepository_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateRepository' +type Store_UpdateRepository_Call struct { + *mock.Call +} + +// UpdateRepository is a helper method to define mock.On call +// - ctx context.Context +// - repoID string +// - param params.UpdateEntityParams +func (_e *Store_Expecter) UpdateRepository(ctx interface{}, repoID interface{}, param interface{}) *Store_UpdateRepository_Call { + return &Store_UpdateRepository_Call{Call: _e.mock.On("UpdateRepository", ctx, repoID, param)} +} + +func (_c *Store_UpdateRepository_Call) Run(run func(ctx context.Context, repoID string, param params.UpdateEntityParams)) *Store_UpdateRepository_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(params.UpdateEntityParams)) + }) + return _c +} + +func (_c *Store_UpdateRepository_Call) Return(_a0 params.Repository, _a1 error) *Store_UpdateRepository_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_UpdateRepository_Call) RunAndReturn(run func(context.Context, string, params.UpdateEntityParams) (params.Repository, error)) *Store_UpdateRepository_Call { + _c.Call.Return(run) + return _c +} + // UpdateUser provides a mock function with given fields: ctx, user, param func (_m *Store) UpdateUser(ctx context.Context, user string, param params.UpdateUserParams) (params.User, error) { ret := _m.Called(ctx, user, param) @@ -2380,6 +5037,36 @@ func (_m *Store) UpdateUser(ctx context.Context, user string, param params.Updat return r0, r1 } +// Store_UpdateUser_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UpdateUser' +type Store_UpdateUser_Call struct { + *mock.Call +} + +// UpdateUser is a helper method to define mock.On call +// - ctx context.Context +// - user string +// - param params.UpdateUserParams +func (_e *Store_Expecter) UpdateUser(ctx interface{}, user interface{}, param interface{}) *Store_UpdateUser_Call { + return &Store_UpdateUser_Call{Call: _e.mock.On("UpdateUser", ctx, user, param)} +} + +func (_c *Store_UpdateUser_Call) Run(run func(ctx context.Context, user string, param params.UpdateUserParams)) *Store_UpdateUser_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(params.UpdateUserParams)) + }) + return _c +} + +func (_c *Store_UpdateUser_Call) Return(_a0 params.User, _a1 error) *Store_UpdateUser_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Store_UpdateUser_Call) RunAndReturn(run func(context.Context, string, params.UpdateUserParams) (params.User, error)) *Store_UpdateUser_Call { + _c.Call.Return(run) + return _c +} + // NewStore creates a new instance of Store. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewStore(t interface { diff --git a/database/common/store.go b/database/common/store.go index 8b3c4f7c..d768f159 100644 --- a/database/common/store.go +++ b/database/common/store.go @@ -169,7 +169,7 @@ type GiteaCredentialsStore interface { DeleteGiteaCredentials(ctx context.Context, id uint) (err error) } -//go:generate mockery --name=Store +//go:generate go run github.com/vektra/mockery/v2@latest type Store interface { RepoStore OrgStore diff --git a/database/sql/pools.go b/database/sql/pools.go index 350e1dc2..889cbc58 100644 --- a/database/sql/pools.go +++ b/database/sql/pools.go @@ -37,7 +37,7 @@ const ( func (s *sqlDatabase) ListAllPools(_ context.Context) ([]params.Pool, error) { var pools []Pool - q := s.conn.Model(&Pool{}). + q := s.conn. Preload("Tags"). Preload("Organization"). Preload("Organization.Endpoint"). @@ -46,7 +46,6 @@ func (s *sqlDatabase) ListAllPools(_ context.Context) ([]params.Pool, error) { Preload("Enterprise"). Preload("Enterprise.Endpoint"). Omit("extra_specs"). - Omit("status_messages"). Find(&pools) if q.Error != nil { return nil, errors.Wrap(q.Error, "fetching all pools") @@ -393,7 +392,7 @@ func (s *sqlDatabase) DeleteEntityPool(_ context.Context, entity params.ForgeEnt return nil } -func (s *sqlDatabase) UpdateEntityPool(_ context.Context, entity params.ForgeEntity, poolID string, param params.UpdatePoolParams) (updatedPool params.Pool, err error) { +func (s *sqlDatabase) UpdateEntityPool(ctx context.Context, entity params.ForgeEntity, poolID string, param params.UpdatePoolParams) (updatedPool params.Pool, err error) { defer func() { if err == nil { s.sendNotify(common.PoolEntityType, common.UpdateOperation, updatedPool) @@ -414,6 +413,11 @@ func (s *sqlDatabase) UpdateEntityPool(_ context.Context, entity params.ForgeEnt if err != nil { return params.Pool{}, err } + + updatedPool, err = s.GetPoolByID(ctx, poolID) + if err != nil { + return params.Pool{}, err + } return updatedPool, nil } diff --git a/database/sql/scalesets.go b/database/sql/scalesets.go index 752c7948..4748ed66 100644 --- a/database/sql/scalesets.go +++ b/database/sql/scalesets.go @@ -193,7 +193,7 @@ func (s *sqlDatabase) ListEntityScaleSets(_ context.Context, entity params.Forge return ret, nil } -func (s *sqlDatabase) UpdateEntityScaleSet(_ context.Context, entity params.ForgeEntity, scaleSetID uint, param params.UpdateScaleSetParams, callback func(old, newSet params.ScaleSet) error) (updatedScaleSet params.ScaleSet, err error) { +func (s *sqlDatabase) UpdateEntityScaleSet(ctx context.Context, entity params.ForgeEntity, scaleSetID uint, param params.UpdateScaleSetParams, callback func(old, newSet params.ScaleSet) error) (updatedScaleSet params.ScaleSet, err error) { defer func() { if err == nil { s.sendNotify(common.ScaleSetEntityType, common.UpdateOperation, updatedScaleSet) @@ -225,6 +225,11 @@ func (s *sqlDatabase) UpdateEntityScaleSet(_ context.Context, entity params.Forg if err != nil { return params.ScaleSet{}, err } + + updatedScaleSet, err = s.GetScaleSetByID(ctx, scaleSetID) + if err != nil { + return params.ScaleSet{}, err + } return updatedScaleSet, nil } @@ -345,7 +350,17 @@ func (s *sqlDatabase) updateScaleSet(tx *gorm.DB, scaleSet ScaleSet, param param } func (s *sqlDatabase) GetScaleSetByID(_ context.Context, scaleSet uint) (params.ScaleSet, error) { - set, err := s.getScaleSetByID(s.conn, scaleSet, "Instances", "Enterprise", "Organization", "Repository") + set, err := s.getScaleSetByID( + s.conn, + scaleSet, + "Instances", + "Enterprise", + "Enterprise.Endpoint", + "Organization", + "Organization.Endpoint", + "Repository", + "Repository.Endpoint", + ) if err != nil { return params.ScaleSet{}, errors.Wrap(err, "fetching scale set by ID") } diff --git a/database/watcher/watcher_store_test.go b/database/watcher/watcher_store_test.go index e682270a..a71ed1cf 100644 --- a/database/watcher/watcher_store_test.go +++ b/database/watcher/watcher_store_test.go @@ -600,6 +600,11 @@ func (s *WatcherStoreTestSuite) TestScaleSetWatcher() { // We updated last message ID and desired runner count above. updatedScaleSet.DesiredRunnerCount = 5 updatedScaleSet.LastMessageID = 99 + payloadFromEvent, ok := event.Payload.(params.ScaleSet) + s.Require().True(ok) + updatedScaleSet.UpdatedAt = payloadFromEvent.UpdatedAt + updatedScaleSet.CreatedAt = payloadFromEvent.CreatedAt + updatedScaleSet.Endpoint = params.ForgeEndpoint{} s.Require().Equal(common.ChangePayload{ EntityType: common.ScaleSetEntityType, Operation: common.DeleteOperation, diff --git a/doc/building_from_source.md b/doc/building_from_source.md index 9058820e..e5d2d0fd 100644 --- a/doc/building_from_source.md +++ b/doc/building_from_source.md @@ -6,12 +6,13 @@ First, clone the repository: ```bash git clone https://github.com/cloudbase/garm +cd garm ``` Then build garm: ```bash -make +make build ``` You should now have both `garm` and `garm-cli` available in the `./bin` folder. @@ -22,4 +23,65 @@ If you have docker/podman installed, you can also build a static binary against make build-static ``` -This command will also build for both AMD64 and ARM64. Resulting binaries will be in the `./bin` folder. \ No newline at end of file +This command will also build for both AMD64 and ARM64. Resulting binaries will be in the `./bin` folder. + +## Hacking + +If you're hacking on GARM and want to override the default version GARM injects, you can run the following command: + +```bash +VERSION=v1.0.0 make build +``` + +> [!IMPORTANT] +> This only works for `make build`. The `make build-static` command does not support version overrides. + +## The Web UI SPA + +GARM now ships with a single page application. The application is written in svelte and tailwind CSS. To rebuild it or hack on it, you will need a number of dependencies installed and placed in your `$PATH`. + +### Prerequisites + +- **Node.js 24+** and **npm** +- **Go 1.21+** (for building the GARM backend) +- **openapi-generator-cli** in your PATH (for API client generation) + +### Installing openapi-generator-cli + +**Option 1: NPM Global Install** +```bash +npm install -g @openapitools/openapi-generator-cli +``` + +**Option 2: Manual Install** +Download from [OpenAPI Generator releases](https://github.com/OpenAPITools/openapi-generator/releases) and add to your PATH. + +**Verify Installation:** + +```bash +openapi-generator-cli version +``` + + + +### Hacking on the Web UI + +If you need to change something in the `webapp/src` folder, make sure to rebuild the webapp before rebuilding GARM: + +```bash +make build-webui +make build +``` + +> [!IMPORTANT] +> The Web UI that GARM ships with has `go generate` stanzas that require `@openapitools/openapi-generator-cli` and `tailwindcss` to be installed. You will also have to make sure that if you change API models, the Web UI still works, as adding new fields or changing the json tags of old fields will change accessors in the client code. + +### Changing API models + +If you need to change the models in the `params/` package, you will also need to regenerate the client both for garm-cli and for the web application we ship with GARM. To do this, you can run: + +```bash +make generate +``` + +You will also need to make sure that the web app still works. diff --git a/doc/config.md b/doc/config.md index 8b4d3a05..3c67e1b4 100644 --- a/doc/config.md +++ b/doc/config.md @@ -473,6 +473,8 @@ The config options are fairly straight forward. certificate = "" # The path on disk to the corresponding private key for the certificate. key = "" + [apiserver.webui] + enable = true ``` The GARM API server has the option to enable TLS, but I suggest you use a reverse proxy and enable TLS termination in that reverse proxy. There is an `nginx` sample in this repository with TLS termination enabled. diff --git a/doc/quickstart.md b/doc/quickstart.md index 66afead3..889f799b 100644 --- a/doc/quickstart.md +++ b/doc/quickstart.md @@ -61,6 +61,9 @@ time_to_live = "8760h" bind = "0.0.0.0" port = 80 use_tls = false + [apiserver.webui] + # Set this to false if you want to disable the Web UI. + enable = true [database] backend = "sqlite3" diff --git a/go.mod b/go.mod index 36e42be2..da91a90d 100644 --- a/go.mod +++ b/go.mod @@ -50,7 +50,7 @@ require ( github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/analysis v0.23.0 // indirect - github.com/go-openapi/jsonpointer v0.21.1 // indirect + github.com/go-openapi/jsonpointer v0.21.2 // indirect github.com/go-openapi/jsonreference v0.21.0 // indirect github.com/go-openapi/loads v0.22.0 // indirect github.com/go-openapi/spec v0.21.0 // indirect @@ -68,7 +68,7 @@ require ( github.com/mailru/easyjson v0.9.0 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect - github.com/mattn/go-sqlite3 v1.14.28 // indirect + github.com/mattn/go-sqlite3 v1.14.31 // indirect github.com/minio/sio v0.4.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect @@ -79,7 +79,7 @@ require ( github.com/prometheus/common v0.65.0 // indirect github.com/prometheus/procfs v0.16.1 // indirect github.com/rivo/uniseg v0.4.7 // indirect - github.com/spf13/pflag v1.0.6 // indirect + github.com/spf13/pflag v1.0.7 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569 // indirect go.mongodb.org/mongo-driver v1.17.4 // indirect diff --git a/go.sum b/go.sum index 1eaeff3e..2008dff3 100644 --- a/go.sum +++ b/go.sum @@ -36,8 +36,8 @@ github.com/go-openapi/analysis v0.23.0 h1:aGday7OWupfMs+LbmLZG4k0MYXIANxcuBTYUC0 github.com/go-openapi/analysis v0.23.0/go.mod h1:9mz9ZWaSlV8TvjQHLl2mUW2PbZtemkE8yA5v22ohupo= github.com/go-openapi/errors v0.22.2 h1:rdxhzcBUazEcGccKqbY1Y7NS8FDcMyIRr0934jrYnZg= github.com/go-openapi/errors v0.22.2/go.mod h1:+n/5UdIqdVnLIJ6Q9Se8HNGUXYaY6CN8ImWzfi/Gzp0= -github.com/go-openapi/jsonpointer v0.21.1 h1:whnzv/pNXtK2FbX/W9yJfRmE2gsmkfahjMKB0fZvcic= -github.com/go-openapi/jsonpointer v0.21.1/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk= +github.com/go-openapi/jsonpointer v0.21.2 h1:AqQaNADVwq/VnkCmQg6ogE+M3FOsKTytwges0JdwVuA= +github.com/go-openapi/jsonpointer v0.21.2/go.mod h1:50I1STOfbY1ycR8jGz8DaMeLCdXiI6aDteEdRNNzpdk= github.com/go-openapi/jsonreference v0.21.0 h1:Rs+Y7hSXT83Jacb7kFyjn4ijOuVGSvOdF2+tg1TRrwQ= github.com/go-openapi/jsonreference v0.21.0/go.mod h1:LmZmgsrTkVg9LG4EaHeY8cBDslNPMo06cago5JNLkm4= github.com/go-openapi/loads v0.22.0 h1:ECPGd4jX1U6NApCGG1We+uEozOAvXvJSF4nnwHZ8Aco= @@ -127,8 +127,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-sqlite3 v1.14.28 h1:ThEiQrnbtumT+QMknw63Befp/ce/nUPgBPMlRFEum7A= -github.com/mattn/go-sqlite3 v1.14.28/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/mattn/go-sqlite3 v1.14.31 h1:ldt6ghyPJsokUIlksH63gWZkG6qVGeEAu4zLeS4aVZM= +github.com/mattn/go-sqlite3 v1.14.31/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/microsoft/go-mssqldb v1.7.2 h1:CHkFJiObW7ItKTJfHo1QX7QBBD1iV+mn1eOyRP3b/PA= github.com/microsoft/go-mssqldb v1.7.2/go.mod h1:kOvZKUdrhhFQmxLZqbwUV0rHkNkZpthMITIb2Ko1IoA= github.com/minio/sio v0.4.1 h1:EMe3YBC1nf+sRQia65Rutxi+Z554XPV0dt8BIBA+a/0= @@ -164,8 +164,9 @@ github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWN github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= -github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/pflag v1.0.7 h1:vN6T9TfwStFPFM5XzjsvmzZkLuaLX+HS+0SeFLRgU6M= +github.com/spf13/pflag v1.0.7/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= diff --git a/runner/common/mocks/GithubClient.go b/runner/common/mocks/GithubClient.go index f44d54cb..92d4aa06 100644 --- a/runner/common/mocks/GithubClient.go +++ b/runner/common/mocks/GithubClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.3. DO NOT EDIT. +// Code generated by mockery. DO NOT EDIT. package mocks @@ -18,6 +18,14 @@ type GithubClient struct { mock.Mock } +type GithubClient_Expecter struct { + mock *mock.Mock +} + +func (_m *GithubClient) EXPECT() *GithubClient_Expecter { + return &GithubClient_Expecter{mock: &_m.Mock} +} + // CreateEntityHook provides a mock function with given fields: ctx, hook func (_m *GithubClient) CreateEntityHook(ctx context.Context, hook *github.Hook) (*github.Hook, error) { ret := _m.Called(ctx, hook) @@ -48,6 +56,35 @@ func (_m *GithubClient) CreateEntityHook(ctx context.Context, hook *github.Hook) return r0, r1 } +// GithubClient_CreateEntityHook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEntityHook' +type GithubClient_CreateEntityHook_Call struct { + *mock.Call +} + +// CreateEntityHook is a helper method to define mock.On call +// - ctx context.Context +// - hook *github.Hook +func (_e *GithubClient_Expecter) CreateEntityHook(ctx interface{}, hook interface{}) *GithubClient_CreateEntityHook_Call { + return &GithubClient_CreateEntityHook_Call{Call: _e.mock.On("CreateEntityHook", ctx, hook)} +} + +func (_c *GithubClient_CreateEntityHook_Call) Run(run func(ctx context.Context, hook *github.Hook)) *GithubClient_CreateEntityHook_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*github.Hook)) + }) + return _c +} + +func (_c *GithubClient_CreateEntityHook_Call) Return(ret *github.Hook, err error) *GithubClient_CreateEntityHook_Call { + _c.Call.Return(ret, err) + return _c +} + +func (_c *GithubClient_CreateEntityHook_Call) RunAndReturn(run func(context.Context, *github.Hook) (*github.Hook, error)) *GithubClient_CreateEntityHook_Call { + _c.Call.Return(run) + return _c +} + // CreateEntityRegistrationToken provides a mock function with given fields: ctx func (_m *GithubClient) CreateEntityRegistrationToken(ctx context.Context) (*github.RegistrationToken, *github.Response, error) { ret := _m.Called(ctx) @@ -87,6 +124,34 @@ func (_m *GithubClient) CreateEntityRegistrationToken(ctx context.Context) (*git return r0, r1, r2 } +// GithubClient_CreateEntityRegistrationToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEntityRegistrationToken' +type GithubClient_CreateEntityRegistrationToken_Call struct { + *mock.Call +} + +// CreateEntityRegistrationToken is a helper method to define mock.On call +// - ctx context.Context +func (_e *GithubClient_Expecter) CreateEntityRegistrationToken(ctx interface{}) *GithubClient_CreateEntityRegistrationToken_Call { + return &GithubClient_CreateEntityRegistrationToken_Call{Call: _e.mock.On("CreateEntityRegistrationToken", ctx)} +} + +func (_c *GithubClient_CreateEntityRegistrationToken_Call) Run(run func(ctx context.Context)) *GithubClient_CreateEntityRegistrationToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *GithubClient_CreateEntityRegistrationToken_Call) Return(_a0 *github.RegistrationToken, _a1 *github.Response, _a2 error) *GithubClient_CreateEntityRegistrationToken_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *GithubClient_CreateEntityRegistrationToken_Call) RunAndReturn(run func(context.Context) (*github.RegistrationToken, *github.Response, error)) *GithubClient_CreateEntityRegistrationToken_Call { + _c.Call.Return(run) + return _c +} + // DeleteEntityHook provides a mock function with given fields: ctx, id func (_m *GithubClient) DeleteEntityHook(ctx context.Context, id int64) (*github.Response, error) { ret := _m.Called(ctx, id) @@ -117,6 +182,35 @@ func (_m *GithubClient) DeleteEntityHook(ctx context.Context, id int64) (*github return r0, r1 } +// GithubClient_DeleteEntityHook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteEntityHook' +type GithubClient_DeleteEntityHook_Call struct { + *mock.Call +} + +// DeleteEntityHook is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *GithubClient_Expecter) DeleteEntityHook(ctx interface{}, id interface{}) *GithubClient_DeleteEntityHook_Call { + return &GithubClient_DeleteEntityHook_Call{Call: _e.mock.On("DeleteEntityHook", ctx, id)} +} + +func (_c *GithubClient_DeleteEntityHook_Call) Run(run func(ctx context.Context, id int64)) *GithubClient_DeleteEntityHook_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *GithubClient_DeleteEntityHook_Call) Return(ret *github.Response, err error) *GithubClient_DeleteEntityHook_Call { + _c.Call.Return(ret, err) + return _c +} + +func (_c *GithubClient_DeleteEntityHook_Call) RunAndReturn(run func(context.Context, int64) (*github.Response, error)) *GithubClient_DeleteEntityHook_Call { + _c.Call.Return(run) + return _c +} + // GetEntity provides a mock function with no fields func (_m *GithubClient) GetEntity() params.ForgeEntity { ret := _m.Called() @@ -135,6 +229,33 @@ func (_m *GithubClient) GetEntity() params.ForgeEntity { return r0 } +// GithubClient_GetEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEntity' +type GithubClient_GetEntity_Call struct { + *mock.Call +} + +// GetEntity is a helper method to define mock.On call +func (_e *GithubClient_Expecter) GetEntity() *GithubClient_GetEntity_Call { + return &GithubClient_GetEntity_Call{Call: _e.mock.On("GetEntity")} +} + +func (_c *GithubClient_GetEntity_Call) Run(run func()) *GithubClient_GetEntity_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GithubClient_GetEntity_Call) Return(_a0 params.ForgeEntity) *GithubClient_GetEntity_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GithubClient_GetEntity_Call) RunAndReturn(run func() params.ForgeEntity) *GithubClient_GetEntity_Call { + _c.Call.Return(run) + return _c +} + // GetEntityHook provides a mock function with given fields: ctx, id func (_m *GithubClient) GetEntityHook(ctx context.Context, id int64) (*github.Hook, error) { ret := _m.Called(ctx, id) @@ -165,6 +286,35 @@ func (_m *GithubClient) GetEntityHook(ctx context.Context, id int64) (*github.Ho return r0, r1 } +// GithubClient_GetEntityHook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEntityHook' +type GithubClient_GetEntityHook_Call struct { + *mock.Call +} + +// GetEntityHook is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *GithubClient_Expecter) GetEntityHook(ctx interface{}, id interface{}) *GithubClient_GetEntityHook_Call { + return &GithubClient_GetEntityHook_Call{Call: _e.mock.On("GetEntityHook", ctx, id)} +} + +func (_c *GithubClient_GetEntityHook_Call) Run(run func(ctx context.Context, id int64)) *GithubClient_GetEntityHook_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *GithubClient_GetEntityHook_Call) Return(ret *github.Hook, err error) *GithubClient_GetEntityHook_Call { + _c.Call.Return(ret, err) + return _c +} + +func (_c *GithubClient_GetEntityHook_Call) RunAndReturn(run func(context.Context, int64) (*github.Hook, error)) *GithubClient_GetEntityHook_Call { + _c.Call.Return(run) + return _c +} + // GetEntityJITConfig provides a mock function with given fields: ctx, instance, pool, labels func (_m *GithubClient) GetEntityJITConfig(ctx context.Context, instance string, pool params.Pool, labels []string) (map[string]string, *github.Runner, error) { ret := _m.Called(ctx, instance, pool, labels) @@ -204,6 +354,37 @@ func (_m *GithubClient) GetEntityJITConfig(ctx context.Context, instance string, return r0, r1, r2 } +// GithubClient_GetEntityJITConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEntityJITConfig' +type GithubClient_GetEntityJITConfig_Call struct { + *mock.Call +} + +// GetEntityJITConfig is a helper method to define mock.On call +// - ctx context.Context +// - instance string +// - pool params.Pool +// - labels []string +func (_e *GithubClient_Expecter) GetEntityJITConfig(ctx interface{}, instance interface{}, pool interface{}, labels interface{}) *GithubClient_GetEntityJITConfig_Call { + return &GithubClient_GetEntityJITConfig_Call{Call: _e.mock.On("GetEntityJITConfig", ctx, instance, pool, labels)} +} + +func (_c *GithubClient_GetEntityJITConfig_Call) Run(run func(ctx context.Context, instance string, pool params.Pool, labels []string)) *GithubClient_GetEntityJITConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(params.Pool), args[3].([]string)) + }) + return _c +} + +func (_c *GithubClient_GetEntityJITConfig_Call) Return(jitConfigMap map[string]string, runner *github.Runner, err error) *GithubClient_GetEntityJITConfig_Call { + _c.Call.Return(jitConfigMap, runner, err) + return _c +} + +func (_c *GithubClient_GetEntityJITConfig_Call) RunAndReturn(run func(context.Context, string, params.Pool, []string) (map[string]string, *github.Runner, error)) *GithubClient_GetEntityJITConfig_Call { + _c.Call.Return(run) + return _c +} + // GetWorkflowJobByID provides a mock function with given fields: ctx, owner, repo, jobID func (_m *GithubClient) GetWorkflowJobByID(ctx context.Context, owner string, repo string, jobID int64) (*github.WorkflowJob, *github.Response, error) { ret := _m.Called(ctx, owner, repo, jobID) @@ -243,6 +424,37 @@ func (_m *GithubClient) GetWorkflowJobByID(ctx context.Context, owner string, re return r0, r1, r2 } +// GithubClient_GetWorkflowJobByID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWorkflowJobByID' +type GithubClient_GetWorkflowJobByID_Call struct { + *mock.Call +} + +// GetWorkflowJobByID is a helper method to define mock.On call +// - ctx context.Context +// - owner string +// - repo string +// - jobID int64 +func (_e *GithubClient_Expecter) GetWorkflowJobByID(ctx interface{}, owner interface{}, repo interface{}, jobID interface{}) *GithubClient_GetWorkflowJobByID_Call { + return &GithubClient_GetWorkflowJobByID_Call{Call: _e.mock.On("GetWorkflowJobByID", ctx, owner, repo, jobID)} +} + +func (_c *GithubClient_GetWorkflowJobByID_Call) Run(run func(ctx context.Context, owner string, repo string, jobID int64)) *GithubClient_GetWorkflowJobByID_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(string), args[3].(int64)) + }) + return _c +} + +func (_c *GithubClient_GetWorkflowJobByID_Call) Return(_a0 *github.WorkflowJob, _a1 *github.Response, _a2 error) *GithubClient_GetWorkflowJobByID_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *GithubClient_GetWorkflowJobByID_Call) RunAndReturn(run func(context.Context, string, string, int64) (*github.WorkflowJob, *github.Response, error)) *GithubClient_GetWorkflowJobByID_Call { + _c.Call.Return(run) + return _c +} + // GithubBaseURL provides a mock function with no fields func (_m *GithubClient) GithubBaseURL() *url.URL { ret := _m.Called() @@ -263,6 +475,33 @@ func (_m *GithubClient) GithubBaseURL() *url.URL { return r0 } +// GithubClient_GithubBaseURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GithubBaseURL' +type GithubClient_GithubBaseURL_Call struct { + *mock.Call +} + +// GithubBaseURL is a helper method to define mock.On call +func (_e *GithubClient_Expecter) GithubBaseURL() *GithubClient_GithubBaseURL_Call { + return &GithubClient_GithubBaseURL_Call{Call: _e.mock.On("GithubBaseURL")} +} + +func (_c *GithubClient_GithubBaseURL_Call) Run(run func()) *GithubClient_GithubBaseURL_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GithubClient_GithubBaseURL_Call) Return(_a0 *url.URL) *GithubClient_GithubBaseURL_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GithubClient_GithubBaseURL_Call) RunAndReturn(run func() *url.URL) *GithubClient_GithubBaseURL_Call { + _c.Call.Return(run) + return _c +} + // ListEntityHooks provides a mock function with given fields: ctx, opts func (_m *GithubClient) ListEntityHooks(ctx context.Context, opts *github.ListOptions) ([]*github.Hook, *github.Response, error) { ret := _m.Called(ctx, opts) @@ -302,6 +541,35 @@ func (_m *GithubClient) ListEntityHooks(ctx context.Context, opts *github.ListOp return r0, r1, r2 } +// GithubClient_ListEntityHooks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEntityHooks' +type GithubClient_ListEntityHooks_Call struct { + *mock.Call +} + +// ListEntityHooks is a helper method to define mock.On call +// - ctx context.Context +// - opts *github.ListOptions +func (_e *GithubClient_Expecter) ListEntityHooks(ctx interface{}, opts interface{}) *GithubClient_ListEntityHooks_Call { + return &GithubClient_ListEntityHooks_Call{Call: _e.mock.On("ListEntityHooks", ctx, opts)} +} + +func (_c *GithubClient_ListEntityHooks_Call) Run(run func(ctx context.Context, opts *github.ListOptions)) *GithubClient_ListEntityHooks_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*github.ListOptions)) + }) + return _c +} + +func (_c *GithubClient_ListEntityHooks_Call) Return(ret []*github.Hook, response *github.Response, err error) *GithubClient_ListEntityHooks_Call { + _c.Call.Return(ret, response, err) + return _c +} + +func (_c *GithubClient_ListEntityHooks_Call) RunAndReturn(run func(context.Context, *github.ListOptions) ([]*github.Hook, *github.Response, error)) *GithubClient_ListEntityHooks_Call { + _c.Call.Return(run) + return _c +} + // ListEntityRunnerApplicationDownloads provides a mock function with given fields: ctx func (_m *GithubClient) ListEntityRunnerApplicationDownloads(ctx context.Context) ([]*github.RunnerApplicationDownload, *github.Response, error) { ret := _m.Called(ctx) @@ -341,6 +609,34 @@ func (_m *GithubClient) ListEntityRunnerApplicationDownloads(ctx context.Context return r0, r1, r2 } +// GithubClient_ListEntityRunnerApplicationDownloads_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEntityRunnerApplicationDownloads' +type GithubClient_ListEntityRunnerApplicationDownloads_Call struct { + *mock.Call +} + +// ListEntityRunnerApplicationDownloads is a helper method to define mock.On call +// - ctx context.Context +func (_e *GithubClient_Expecter) ListEntityRunnerApplicationDownloads(ctx interface{}) *GithubClient_ListEntityRunnerApplicationDownloads_Call { + return &GithubClient_ListEntityRunnerApplicationDownloads_Call{Call: _e.mock.On("ListEntityRunnerApplicationDownloads", ctx)} +} + +func (_c *GithubClient_ListEntityRunnerApplicationDownloads_Call) Run(run func(ctx context.Context)) *GithubClient_ListEntityRunnerApplicationDownloads_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *GithubClient_ListEntityRunnerApplicationDownloads_Call) Return(_a0 []*github.RunnerApplicationDownload, _a1 *github.Response, _a2 error) *GithubClient_ListEntityRunnerApplicationDownloads_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *GithubClient_ListEntityRunnerApplicationDownloads_Call) RunAndReturn(run func(context.Context) ([]*github.RunnerApplicationDownload, *github.Response, error)) *GithubClient_ListEntityRunnerApplicationDownloads_Call { + _c.Call.Return(run) + return _c +} + // ListEntityRunners provides a mock function with given fields: ctx, opts func (_m *GithubClient) ListEntityRunners(ctx context.Context, opts *github.ListRunnersOptions) (*github.Runners, *github.Response, error) { ret := _m.Called(ctx, opts) @@ -380,6 +676,35 @@ func (_m *GithubClient) ListEntityRunners(ctx context.Context, opts *github.List return r0, r1, r2 } +// GithubClient_ListEntityRunners_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEntityRunners' +type GithubClient_ListEntityRunners_Call struct { + *mock.Call +} + +// ListEntityRunners is a helper method to define mock.On call +// - ctx context.Context +// - opts *github.ListRunnersOptions +func (_e *GithubClient_Expecter) ListEntityRunners(ctx interface{}, opts interface{}) *GithubClient_ListEntityRunners_Call { + return &GithubClient_ListEntityRunners_Call{Call: _e.mock.On("ListEntityRunners", ctx, opts)} +} + +func (_c *GithubClient_ListEntityRunners_Call) Run(run func(ctx context.Context, opts *github.ListRunnersOptions)) *GithubClient_ListEntityRunners_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*github.ListRunnersOptions)) + }) + return _c +} + +func (_c *GithubClient_ListEntityRunners_Call) Return(_a0 *github.Runners, _a1 *github.Response, _a2 error) *GithubClient_ListEntityRunners_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *GithubClient_ListEntityRunners_Call) RunAndReturn(run func(context.Context, *github.ListRunnersOptions) (*github.Runners, *github.Response, error)) *GithubClient_ListEntityRunners_Call { + _c.Call.Return(run) + return _c +} + // PingEntityHook provides a mock function with given fields: ctx, id func (_m *GithubClient) PingEntityHook(ctx context.Context, id int64) (*github.Response, error) { ret := _m.Called(ctx, id) @@ -410,6 +735,35 @@ func (_m *GithubClient) PingEntityHook(ctx context.Context, id int64) (*github.R return r0, r1 } +// GithubClient_PingEntityHook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PingEntityHook' +type GithubClient_PingEntityHook_Call struct { + *mock.Call +} + +// PingEntityHook is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *GithubClient_Expecter) PingEntityHook(ctx interface{}, id interface{}) *GithubClient_PingEntityHook_Call { + return &GithubClient_PingEntityHook_Call{Call: _e.mock.On("PingEntityHook", ctx, id)} +} + +func (_c *GithubClient_PingEntityHook_Call) Run(run func(ctx context.Context, id int64)) *GithubClient_PingEntityHook_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *GithubClient_PingEntityHook_Call) Return(ret *github.Response, err error) *GithubClient_PingEntityHook_Call { + _c.Call.Return(ret, err) + return _c +} + +func (_c *GithubClient_PingEntityHook_Call) RunAndReturn(run func(context.Context, int64) (*github.Response, error)) *GithubClient_PingEntityHook_Call { + _c.Call.Return(run) + return _c +} + // RateLimit provides a mock function with given fields: ctx func (_m *GithubClient) RateLimit(ctx context.Context) (*github.RateLimits, error) { ret := _m.Called(ctx) @@ -440,6 +794,34 @@ func (_m *GithubClient) RateLimit(ctx context.Context) (*github.RateLimits, erro return r0, r1 } +// GithubClient_RateLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RateLimit' +type GithubClient_RateLimit_Call struct { + *mock.Call +} + +// RateLimit is a helper method to define mock.On call +// - ctx context.Context +func (_e *GithubClient_Expecter) RateLimit(ctx interface{}) *GithubClient_RateLimit_Call { + return &GithubClient_RateLimit_Call{Call: _e.mock.On("RateLimit", ctx)} +} + +func (_c *GithubClient_RateLimit_Call) Run(run func(ctx context.Context)) *GithubClient_RateLimit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *GithubClient_RateLimit_Call) Return(_a0 *github.RateLimits, _a1 error) *GithubClient_RateLimit_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *GithubClient_RateLimit_Call) RunAndReturn(run func(context.Context) (*github.RateLimits, error)) *GithubClient_RateLimit_Call { + _c.Call.Return(run) + return _c +} + // RemoveEntityRunner provides a mock function with given fields: ctx, runnerID func (_m *GithubClient) RemoveEntityRunner(ctx context.Context, runnerID int64) error { ret := _m.Called(ctx, runnerID) @@ -458,6 +840,35 @@ func (_m *GithubClient) RemoveEntityRunner(ctx context.Context, runnerID int64) return r0 } +// GithubClient_RemoveEntityRunner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveEntityRunner' +type GithubClient_RemoveEntityRunner_Call struct { + *mock.Call +} + +// RemoveEntityRunner is a helper method to define mock.On call +// - ctx context.Context +// - runnerID int64 +func (_e *GithubClient_Expecter) RemoveEntityRunner(ctx interface{}, runnerID interface{}) *GithubClient_RemoveEntityRunner_Call { + return &GithubClient_RemoveEntityRunner_Call{Call: _e.mock.On("RemoveEntityRunner", ctx, runnerID)} +} + +func (_c *GithubClient_RemoveEntityRunner_Call) Run(run func(ctx context.Context, runnerID int64)) *GithubClient_RemoveEntityRunner_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *GithubClient_RemoveEntityRunner_Call) Return(_a0 error) *GithubClient_RemoveEntityRunner_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GithubClient_RemoveEntityRunner_Call) RunAndReturn(run func(context.Context, int64) error) *GithubClient_RemoveEntityRunner_Call { + _c.Call.Return(run) + return _c +} + // NewGithubClient creates a new instance of GithubClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewGithubClient(t interface { diff --git a/runner/common/mocks/GithubEntityOperations.go b/runner/common/mocks/GithubEntityOperations.go index 15326795..2448df4c 100644 --- a/runner/common/mocks/GithubEntityOperations.go +++ b/runner/common/mocks/GithubEntityOperations.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.3. DO NOT EDIT. +// Code generated by mockery. DO NOT EDIT. package mocks @@ -18,6 +18,14 @@ type GithubEntityOperations struct { mock.Mock } +type GithubEntityOperations_Expecter struct { + mock *mock.Mock +} + +func (_m *GithubEntityOperations) EXPECT() *GithubEntityOperations_Expecter { + return &GithubEntityOperations_Expecter{mock: &_m.Mock} +} + // CreateEntityHook provides a mock function with given fields: ctx, hook func (_m *GithubEntityOperations) CreateEntityHook(ctx context.Context, hook *github.Hook) (*github.Hook, error) { ret := _m.Called(ctx, hook) @@ -48,6 +56,35 @@ func (_m *GithubEntityOperations) CreateEntityHook(ctx context.Context, hook *gi return r0, r1 } +// GithubEntityOperations_CreateEntityHook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEntityHook' +type GithubEntityOperations_CreateEntityHook_Call struct { + *mock.Call +} + +// CreateEntityHook is a helper method to define mock.On call +// - ctx context.Context +// - hook *github.Hook +func (_e *GithubEntityOperations_Expecter) CreateEntityHook(ctx interface{}, hook interface{}) *GithubEntityOperations_CreateEntityHook_Call { + return &GithubEntityOperations_CreateEntityHook_Call{Call: _e.mock.On("CreateEntityHook", ctx, hook)} +} + +func (_c *GithubEntityOperations_CreateEntityHook_Call) Run(run func(ctx context.Context, hook *github.Hook)) *GithubEntityOperations_CreateEntityHook_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*github.Hook)) + }) + return _c +} + +func (_c *GithubEntityOperations_CreateEntityHook_Call) Return(ret *github.Hook, err error) *GithubEntityOperations_CreateEntityHook_Call { + _c.Call.Return(ret, err) + return _c +} + +func (_c *GithubEntityOperations_CreateEntityHook_Call) RunAndReturn(run func(context.Context, *github.Hook) (*github.Hook, error)) *GithubEntityOperations_CreateEntityHook_Call { + _c.Call.Return(run) + return _c +} + // CreateEntityRegistrationToken provides a mock function with given fields: ctx func (_m *GithubEntityOperations) CreateEntityRegistrationToken(ctx context.Context) (*github.RegistrationToken, *github.Response, error) { ret := _m.Called(ctx) @@ -87,6 +124,34 @@ func (_m *GithubEntityOperations) CreateEntityRegistrationToken(ctx context.Cont return r0, r1, r2 } +// GithubEntityOperations_CreateEntityRegistrationToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEntityRegistrationToken' +type GithubEntityOperations_CreateEntityRegistrationToken_Call struct { + *mock.Call +} + +// CreateEntityRegistrationToken is a helper method to define mock.On call +// - ctx context.Context +func (_e *GithubEntityOperations_Expecter) CreateEntityRegistrationToken(ctx interface{}) *GithubEntityOperations_CreateEntityRegistrationToken_Call { + return &GithubEntityOperations_CreateEntityRegistrationToken_Call{Call: _e.mock.On("CreateEntityRegistrationToken", ctx)} +} + +func (_c *GithubEntityOperations_CreateEntityRegistrationToken_Call) Run(run func(ctx context.Context)) *GithubEntityOperations_CreateEntityRegistrationToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *GithubEntityOperations_CreateEntityRegistrationToken_Call) Return(_a0 *github.RegistrationToken, _a1 *github.Response, _a2 error) *GithubEntityOperations_CreateEntityRegistrationToken_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *GithubEntityOperations_CreateEntityRegistrationToken_Call) RunAndReturn(run func(context.Context) (*github.RegistrationToken, *github.Response, error)) *GithubEntityOperations_CreateEntityRegistrationToken_Call { + _c.Call.Return(run) + return _c +} + // DeleteEntityHook provides a mock function with given fields: ctx, id func (_m *GithubEntityOperations) DeleteEntityHook(ctx context.Context, id int64) (*github.Response, error) { ret := _m.Called(ctx, id) @@ -117,6 +182,35 @@ func (_m *GithubEntityOperations) DeleteEntityHook(ctx context.Context, id int64 return r0, r1 } +// GithubEntityOperations_DeleteEntityHook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteEntityHook' +type GithubEntityOperations_DeleteEntityHook_Call struct { + *mock.Call +} + +// DeleteEntityHook is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *GithubEntityOperations_Expecter) DeleteEntityHook(ctx interface{}, id interface{}) *GithubEntityOperations_DeleteEntityHook_Call { + return &GithubEntityOperations_DeleteEntityHook_Call{Call: _e.mock.On("DeleteEntityHook", ctx, id)} +} + +func (_c *GithubEntityOperations_DeleteEntityHook_Call) Run(run func(ctx context.Context, id int64)) *GithubEntityOperations_DeleteEntityHook_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *GithubEntityOperations_DeleteEntityHook_Call) Return(ret *github.Response, err error) *GithubEntityOperations_DeleteEntityHook_Call { + _c.Call.Return(ret, err) + return _c +} + +func (_c *GithubEntityOperations_DeleteEntityHook_Call) RunAndReturn(run func(context.Context, int64) (*github.Response, error)) *GithubEntityOperations_DeleteEntityHook_Call { + _c.Call.Return(run) + return _c +} + // GetEntity provides a mock function with no fields func (_m *GithubEntityOperations) GetEntity() params.ForgeEntity { ret := _m.Called() @@ -135,6 +229,33 @@ func (_m *GithubEntityOperations) GetEntity() params.ForgeEntity { return r0 } +// GithubEntityOperations_GetEntity_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEntity' +type GithubEntityOperations_GetEntity_Call struct { + *mock.Call +} + +// GetEntity is a helper method to define mock.On call +func (_e *GithubEntityOperations_Expecter) GetEntity() *GithubEntityOperations_GetEntity_Call { + return &GithubEntityOperations_GetEntity_Call{Call: _e.mock.On("GetEntity")} +} + +func (_c *GithubEntityOperations_GetEntity_Call) Run(run func()) *GithubEntityOperations_GetEntity_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GithubEntityOperations_GetEntity_Call) Return(_a0 params.ForgeEntity) *GithubEntityOperations_GetEntity_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GithubEntityOperations_GetEntity_Call) RunAndReturn(run func() params.ForgeEntity) *GithubEntityOperations_GetEntity_Call { + _c.Call.Return(run) + return _c +} + // GetEntityHook provides a mock function with given fields: ctx, id func (_m *GithubEntityOperations) GetEntityHook(ctx context.Context, id int64) (*github.Hook, error) { ret := _m.Called(ctx, id) @@ -165,6 +286,35 @@ func (_m *GithubEntityOperations) GetEntityHook(ctx context.Context, id int64) ( return r0, r1 } +// GithubEntityOperations_GetEntityHook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEntityHook' +type GithubEntityOperations_GetEntityHook_Call struct { + *mock.Call +} + +// GetEntityHook is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *GithubEntityOperations_Expecter) GetEntityHook(ctx interface{}, id interface{}) *GithubEntityOperations_GetEntityHook_Call { + return &GithubEntityOperations_GetEntityHook_Call{Call: _e.mock.On("GetEntityHook", ctx, id)} +} + +func (_c *GithubEntityOperations_GetEntityHook_Call) Run(run func(ctx context.Context, id int64)) *GithubEntityOperations_GetEntityHook_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *GithubEntityOperations_GetEntityHook_Call) Return(ret *github.Hook, err error) *GithubEntityOperations_GetEntityHook_Call { + _c.Call.Return(ret, err) + return _c +} + +func (_c *GithubEntityOperations_GetEntityHook_Call) RunAndReturn(run func(context.Context, int64) (*github.Hook, error)) *GithubEntityOperations_GetEntityHook_Call { + _c.Call.Return(run) + return _c +} + // GetEntityJITConfig provides a mock function with given fields: ctx, instance, pool, labels func (_m *GithubEntityOperations) GetEntityJITConfig(ctx context.Context, instance string, pool params.Pool, labels []string) (map[string]string, *github.Runner, error) { ret := _m.Called(ctx, instance, pool, labels) @@ -204,6 +354,37 @@ func (_m *GithubEntityOperations) GetEntityJITConfig(ctx context.Context, instan return r0, r1, r2 } +// GithubEntityOperations_GetEntityJITConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEntityJITConfig' +type GithubEntityOperations_GetEntityJITConfig_Call struct { + *mock.Call +} + +// GetEntityJITConfig is a helper method to define mock.On call +// - ctx context.Context +// - instance string +// - pool params.Pool +// - labels []string +func (_e *GithubEntityOperations_Expecter) GetEntityJITConfig(ctx interface{}, instance interface{}, pool interface{}, labels interface{}) *GithubEntityOperations_GetEntityJITConfig_Call { + return &GithubEntityOperations_GetEntityJITConfig_Call{Call: _e.mock.On("GetEntityJITConfig", ctx, instance, pool, labels)} +} + +func (_c *GithubEntityOperations_GetEntityJITConfig_Call) Run(run func(ctx context.Context, instance string, pool params.Pool, labels []string)) *GithubEntityOperations_GetEntityJITConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(params.Pool), args[3].([]string)) + }) + return _c +} + +func (_c *GithubEntityOperations_GetEntityJITConfig_Call) Return(jitConfigMap map[string]string, runner *github.Runner, err error) *GithubEntityOperations_GetEntityJITConfig_Call { + _c.Call.Return(jitConfigMap, runner, err) + return _c +} + +func (_c *GithubEntityOperations_GetEntityJITConfig_Call) RunAndReturn(run func(context.Context, string, params.Pool, []string) (map[string]string, *github.Runner, error)) *GithubEntityOperations_GetEntityJITConfig_Call { + _c.Call.Return(run) + return _c +} + // GithubBaseURL provides a mock function with no fields func (_m *GithubEntityOperations) GithubBaseURL() *url.URL { ret := _m.Called() @@ -224,6 +405,33 @@ func (_m *GithubEntityOperations) GithubBaseURL() *url.URL { return r0 } +// GithubEntityOperations_GithubBaseURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GithubBaseURL' +type GithubEntityOperations_GithubBaseURL_Call struct { + *mock.Call +} + +// GithubBaseURL is a helper method to define mock.On call +func (_e *GithubEntityOperations_Expecter) GithubBaseURL() *GithubEntityOperations_GithubBaseURL_Call { + return &GithubEntityOperations_GithubBaseURL_Call{Call: _e.mock.On("GithubBaseURL")} +} + +func (_c *GithubEntityOperations_GithubBaseURL_Call) Run(run func()) *GithubEntityOperations_GithubBaseURL_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *GithubEntityOperations_GithubBaseURL_Call) Return(_a0 *url.URL) *GithubEntityOperations_GithubBaseURL_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GithubEntityOperations_GithubBaseURL_Call) RunAndReturn(run func() *url.URL) *GithubEntityOperations_GithubBaseURL_Call { + _c.Call.Return(run) + return _c +} + // ListEntityHooks provides a mock function with given fields: ctx, opts func (_m *GithubEntityOperations) ListEntityHooks(ctx context.Context, opts *github.ListOptions) ([]*github.Hook, *github.Response, error) { ret := _m.Called(ctx, opts) @@ -263,6 +471,35 @@ func (_m *GithubEntityOperations) ListEntityHooks(ctx context.Context, opts *git return r0, r1, r2 } +// GithubEntityOperations_ListEntityHooks_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEntityHooks' +type GithubEntityOperations_ListEntityHooks_Call struct { + *mock.Call +} + +// ListEntityHooks is a helper method to define mock.On call +// - ctx context.Context +// - opts *github.ListOptions +func (_e *GithubEntityOperations_Expecter) ListEntityHooks(ctx interface{}, opts interface{}) *GithubEntityOperations_ListEntityHooks_Call { + return &GithubEntityOperations_ListEntityHooks_Call{Call: _e.mock.On("ListEntityHooks", ctx, opts)} +} + +func (_c *GithubEntityOperations_ListEntityHooks_Call) Run(run func(ctx context.Context, opts *github.ListOptions)) *GithubEntityOperations_ListEntityHooks_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*github.ListOptions)) + }) + return _c +} + +func (_c *GithubEntityOperations_ListEntityHooks_Call) Return(ret []*github.Hook, response *github.Response, err error) *GithubEntityOperations_ListEntityHooks_Call { + _c.Call.Return(ret, response, err) + return _c +} + +func (_c *GithubEntityOperations_ListEntityHooks_Call) RunAndReturn(run func(context.Context, *github.ListOptions) ([]*github.Hook, *github.Response, error)) *GithubEntityOperations_ListEntityHooks_Call { + _c.Call.Return(run) + return _c +} + // ListEntityRunnerApplicationDownloads provides a mock function with given fields: ctx func (_m *GithubEntityOperations) ListEntityRunnerApplicationDownloads(ctx context.Context) ([]*github.RunnerApplicationDownload, *github.Response, error) { ret := _m.Called(ctx) @@ -302,6 +539,34 @@ func (_m *GithubEntityOperations) ListEntityRunnerApplicationDownloads(ctx conte return r0, r1, r2 } +// GithubEntityOperations_ListEntityRunnerApplicationDownloads_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEntityRunnerApplicationDownloads' +type GithubEntityOperations_ListEntityRunnerApplicationDownloads_Call struct { + *mock.Call +} + +// ListEntityRunnerApplicationDownloads is a helper method to define mock.On call +// - ctx context.Context +func (_e *GithubEntityOperations_Expecter) ListEntityRunnerApplicationDownloads(ctx interface{}) *GithubEntityOperations_ListEntityRunnerApplicationDownloads_Call { + return &GithubEntityOperations_ListEntityRunnerApplicationDownloads_Call{Call: _e.mock.On("ListEntityRunnerApplicationDownloads", ctx)} +} + +func (_c *GithubEntityOperations_ListEntityRunnerApplicationDownloads_Call) Run(run func(ctx context.Context)) *GithubEntityOperations_ListEntityRunnerApplicationDownloads_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *GithubEntityOperations_ListEntityRunnerApplicationDownloads_Call) Return(_a0 []*github.RunnerApplicationDownload, _a1 *github.Response, _a2 error) *GithubEntityOperations_ListEntityRunnerApplicationDownloads_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *GithubEntityOperations_ListEntityRunnerApplicationDownloads_Call) RunAndReturn(run func(context.Context) ([]*github.RunnerApplicationDownload, *github.Response, error)) *GithubEntityOperations_ListEntityRunnerApplicationDownloads_Call { + _c.Call.Return(run) + return _c +} + // ListEntityRunners provides a mock function with given fields: ctx, opts func (_m *GithubEntityOperations) ListEntityRunners(ctx context.Context, opts *github.ListRunnersOptions) (*github.Runners, *github.Response, error) { ret := _m.Called(ctx, opts) @@ -341,6 +606,35 @@ func (_m *GithubEntityOperations) ListEntityRunners(ctx context.Context, opts *g return r0, r1, r2 } +// GithubEntityOperations_ListEntityRunners_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListEntityRunners' +type GithubEntityOperations_ListEntityRunners_Call struct { + *mock.Call +} + +// ListEntityRunners is a helper method to define mock.On call +// - ctx context.Context +// - opts *github.ListRunnersOptions +func (_e *GithubEntityOperations_Expecter) ListEntityRunners(ctx interface{}, opts interface{}) *GithubEntityOperations_ListEntityRunners_Call { + return &GithubEntityOperations_ListEntityRunners_Call{Call: _e.mock.On("ListEntityRunners", ctx, opts)} +} + +func (_c *GithubEntityOperations_ListEntityRunners_Call) Run(run func(ctx context.Context, opts *github.ListRunnersOptions)) *GithubEntityOperations_ListEntityRunners_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(*github.ListRunnersOptions)) + }) + return _c +} + +func (_c *GithubEntityOperations_ListEntityRunners_Call) Return(_a0 *github.Runners, _a1 *github.Response, _a2 error) *GithubEntityOperations_ListEntityRunners_Call { + _c.Call.Return(_a0, _a1, _a2) + return _c +} + +func (_c *GithubEntityOperations_ListEntityRunners_Call) RunAndReturn(run func(context.Context, *github.ListRunnersOptions) (*github.Runners, *github.Response, error)) *GithubEntityOperations_ListEntityRunners_Call { + _c.Call.Return(run) + return _c +} + // PingEntityHook provides a mock function with given fields: ctx, id func (_m *GithubEntityOperations) PingEntityHook(ctx context.Context, id int64) (*github.Response, error) { ret := _m.Called(ctx, id) @@ -371,6 +665,35 @@ func (_m *GithubEntityOperations) PingEntityHook(ctx context.Context, id int64) return r0, r1 } +// GithubEntityOperations_PingEntityHook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'PingEntityHook' +type GithubEntityOperations_PingEntityHook_Call struct { + *mock.Call +} + +// PingEntityHook is a helper method to define mock.On call +// - ctx context.Context +// - id int64 +func (_e *GithubEntityOperations_Expecter) PingEntityHook(ctx interface{}, id interface{}) *GithubEntityOperations_PingEntityHook_Call { + return &GithubEntityOperations_PingEntityHook_Call{Call: _e.mock.On("PingEntityHook", ctx, id)} +} + +func (_c *GithubEntityOperations_PingEntityHook_Call) Run(run func(ctx context.Context, id int64)) *GithubEntityOperations_PingEntityHook_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *GithubEntityOperations_PingEntityHook_Call) Return(ret *github.Response, err error) *GithubEntityOperations_PingEntityHook_Call { + _c.Call.Return(ret, err) + return _c +} + +func (_c *GithubEntityOperations_PingEntityHook_Call) RunAndReturn(run func(context.Context, int64) (*github.Response, error)) *GithubEntityOperations_PingEntityHook_Call { + _c.Call.Return(run) + return _c +} + // RateLimit provides a mock function with given fields: ctx func (_m *GithubEntityOperations) RateLimit(ctx context.Context) (*github.RateLimits, error) { ret := _m.Called(ctx) @@ -401,6 +724,34 @@ func (_m *GithubEntityOperations) RateLimit(ctx context.Context) (*github.RateLi return r0, r1 } +// GithubEntityOperations_RateLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RateLimit' +type GithubEntityOperations_RateLimit_Call struct { + *mock.Call +} + +// RateLimit is a helper method to define mock.On call +// - ctx context.Context +func (_e *GithubEntityOperations_Expecter) RateLimit(ctx interface{}) *GithubEntityOperations_RateLimit_Call { + return &GithubEntityOperations_RateLimit_Call{Call: _e.mock.On("RateLimit", ctx)} +} + +func (_c *GithubEntityOperations_RateLimit_Call) Run(run func(ctx context.Context)) *GithubEntityOperations_RateLimit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *GithubEntityOperations_RateLimit_Call) Return(_a0 *github.RateLimits, _a1 error) *GithubEntityOperations_RateLimit_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *GithubEntityOperations_RateLimit_Call) RunAndReturn(run func(context.Context) (*github.RateLimits, error)) *GithubEntityOperations_RateLimit_Call { + _c.Call.Return(run) + return _c +} + // RemoveEntityRunner provides a mock function with given fields: ctx, runnerID func (_m *GithubEntityOperations) RemoveEntityRunner(ctx context.Context, runnerID int64) error { ret := _m.Called(ctx, runnerID) @@ -419,6 +770,35 @@ func (_m *GithubEntityOperations) RemoveEntityRunner(ctx context.Context, runner return r0 } +// GithubEntityOperations_RemoveEntityRunner_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveEntityRunner' +type GithubEntityOperations_RemoveEntityRunner_Call struct { + *mock.Call +} + +// RemoveEntityRunner is a helper method to define mock.On call +// - ctx context.Context +// - runnerID int64 +func (_e *GithubEntityOperations_Expecter) RemoveEntityRunner(ctx interface{}, runnerID interface{}) *GithubEntityOperations_RemoveEntityRunner_Call { + return &GithubEntityOperations_RemoveEntityRunner_Call{Call: _e.mock.On("RemoveEntityRunner", ctx, runnerID)} +} + +func (_c *GithubEntityOperations_RemoveEntityRunner_Call) Run(run func(ctx context.Context, runnerID int64)) *GithubEntityOperations_RemoveEntityRunner_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(int64)) + }) + return _c +} + +func (_c *GithubEntityOperations_RemoveEntityRunner_Call) Return(_a0 error) *GithubEntityOperations_RemoveEntityRunner_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *GithubEntityOperations_RemoveEntityRunner_Call) RunAndReturn(run func(context.Context, int64) error) *GithubEntityOperations_RemoveEntityRunner_Call { + _c.Call.Return(run) + return _c +} + // NewGithubEntityOperations creates a new instance of GithubEntityOperations. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewGithubEntityOperations(t interface { diff --git a/runner/common/mocks/PoolManager.go b/runner/common/mocks/PoolManager.go index 08cfb975..a1a62f4f 100644 --- a/runner/common/mocks/PoolManager.go +++ b/runner/common/mocks/PoolManager.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.3. DO NOT EDIT. +// Code generated by mockery. DO NOT EDIT. package mocks @@ -14,6 +14,14 @@ type PoolManager struct { mock.Mock } +type PoolManager_Expecter struct { + mock *mock.Mock +} + +func (_m *PoolManager) EXPECT() *PoolManager_Expecter { + return &PoolManager_Expecter{mock: &_m.Mock} +} + // GetWebhookInfo provides a mock function with given fields: ctx func (_m *PoolManager) GetWebhookInfo(ctx context.Context) (params.HookInfo, error) { ret := _m.Called(ctx) @@ -42,6 +50,34 @@ func (_m *PoolManager) GetWebhookInfo(ctx context.Context) (params.HookInfo, err return r0, r1 } +// PoolManager_GetWebhookInfo_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetWebhookInfo' +type PoolManager_GetWebhookInfo_Call struct { + *mock.Call +} + +// GetWebhookInfo is a helper method to define mock.On call +// - ctx context.Context +func (_e *PoolManager_Expecter) GetWebhookInfo(ctx interface{}) *PoolManager_GetWebhookInfo_Call { + return &PoolManager_GetWebhookInfo_Call{Call: _e.mock.On("GetWebhookInfo", ctx)} +} + +func (_c *PoolManager_GetWebhookInfo_Call) Run(run func(ctx context.Context)) *PoolManager_GetWebhookInfo_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *PoolManager_GetWebhookInfo_Call) Return(_a0 params.HookInfo, _a1 error) *PoolManager_GetWebhookInfo_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PoolManager_GetWebhookInfo_Call) RunAndReturn(run func(context.Context) (params.HookInfo, error)) *PoolManager_GetWebhookInfo_Call { + _c.Call.Return(run) + return _c +} + // GithubRunnerRegistrationToken provides a mock function with no fields func (_m *PoolManager) GithubRunnerRegistrationToken() (string, error) { ret := _m.Called() @@ -70,6 +106,33 @@ func (_m *PoolManager) GithubRunnerRegistrationToken() (string, error) { return r0, r1 } +// PoolManager_GithubRunnerRegistrationToken_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GithubRunnerRegistrationToken' +type PoolManager_GithubRunnerRegistrationToken_Call struct { + *mock.Call +} + +// GithubRunnerRegistrationToken is a helper method to define mock.On call +func (_e *PoolManager_Expecter) GithubRunnerRegistrationToken() *PoolManager_GithubRunnerRegistrationToken_Call { + return &PoolManager_GithubRunnerRegistrationToken_Call{Call: _e.mock.On("GithubRunnerRegistrationToken")} +} + +func (_c *PoolManager_GithubRunnerRegistrationToken_Call) Run(run func()) *PoolManager_GithubRunnerRegistrationToken_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PoolManager_GithubRunnerRegistrationToken_Call) Return(_a0 string, _a1 error) *PoolManager_GithubRunnerRegistrationToken_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PoolManager_GithubRunnerRegistrationToken_Call) RunAndReturn(run func() (string, error)) *PoolManager_GithubRunnerRegistrationToken_Call { + _c.Call.Return(run) + return _c +} + // HandleWorkflowJob provides a mock function with given fields: job func (_m *PoolManager) HandleWorkflowJob(job params.WorkflowJob) error { ret := _m.Called(job) @@ -88,6 +151,34 @@ func (_m *PoolManager) HandleWorkflowJob(job params.WorkflowJob) error { return r0 } +// PoolManager_HandleWorkflowJob_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'HandleWorkflowJob' +type PoolManager_HandleWorkflowJob_Call struct { + *mock.Call +} + +// HandleWorkflowJob is a helper method to define mock.On call +// - job params.WorkflowJob +func (_e *PoolManager_Expecter) HandleWorkflowJob(job interface{}) *PoolManager_HandleWorkflowJob_Call { + return &PoolManager_HandleWorkflowJob_Call{Call: _e.mock.On("HandleWorkflowJob", job)} +} + +func (_c *PoolManager_HandleWorkflowJob_Call) Run(run func(job params.WorkflowJob)) *PoolManager_HandleWorkflowJob_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(params.WorkflowJob)) + }) + return _c +} + +func (_c *PoolManager_HandleWorkflowJob_Call) Return(_a0 error) *PoolManager_HandleWorkflowJob_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PoolManager_HandleWorkflowJob_Call) RunAndReturn(run func(params.WorkflowJob) error) *PoolManager_HandleWorkflowJob_Call { + _c.Call.Return(run) + return _c +} + // ID provides a mock function with no fields func (_m *PoolManager) ID() string { ret := _m.Called() @@ -106,6 +197,33 @@ func (_m *PoolManager) ID() string { return r0 } +// PoolManager_ID_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ID' +type PoolManager_ID_Call struct { + *mock.Call +} + +// ID is a helper method to define mock.On call +func (_e *PoolManager_Expecter) ID() *PoolManager_ID_Call { + return &PoolManager_ID_Call{Call: _e.mock.On("ID")} +} + +func (_c *PoolManager_ID_Call) Run(run func()) *PoolManager_ID_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PoolManager_ID_Call) Return(_a0 string) *PoolManager_ID_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PoolManager_ID_Call) RunAndReturn(run func() string) *PoolManager_ID_Call { + _c.Call.Return(run) + return _c +} + // InstallWebhook provides a mock function with given fields: ctx, param func (_m *PoolManager) InstallWebhook(ctx context.Context, param params.InstallWebhookParams) (params.HookInfo, error) { ret := _m.Called(ctx, param) @@ -134,6 +252,35 @@ func (_m *PoolManager) InstallWebhook(ctx context.Context, param params.InstallW return r0, r1 } +// PoolManager_InstallWebhook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'InstallWebhook' +type PoolManager_InstallWebhook_Call struct { + *mock.Call +} + +// InstallWebhook is a helper method to define mock.On call +// - ctx context.Context +// - param params.InstallWebhookParams +func (_e *PoolManager_Expecter) InstallWebhook(ctx interface{}, param interface{}) *PoolManager_InstallWebhook_Call { + return &PoolManager_InstallWebhook_Call{Call: _e.mock.On("InstallWebhook", ctx, param)} +} + +func (_c *PoolManager_InstallWebhook_Call) Run(run func(ctx context.Context, param params.InstallWebhookParams)) *PoolManager_InstallWebhook_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.InstallWebhookParams)) + }) + return _c +} + +func (_c *PoolManager_InstallWebhook_Call) Return(_a0 params.HookInfo, _a1 error) *PoolManager_InstallWebhook_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PoolManager_InstallWebhook_Call) RunAndReturn(run func(context.Context, params.InstallWebhookParams) (params.HookInfo, error)) *PoolManager_InstallWebhook_Call { + _c.Call.Return(run) + return _c +} + // RootCABundle provides a mock function with no fields func (_m *PoolManager) RootCABundle() (params.CertificateBundle, error) { ret := _m.Called() @@ -162,11 +309,67 @@ func (_m *PoolManager) RootCABundle() (params.CertificateBundle, error) { return r0, r1 } +// PoolManager_RootCABundle_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RootCABundle' +type PoolManager_RootCABundle_Call struct { + *mock.Call +} + +// RootCABundle is a helper method to define mock.On call +func (_e *PoolManager_Expecter) RootCABundle() *PoolManager_RootCABundle_Call { + return &PoolManager_RootCABundle_Call{Call: _e.mock.On("RootCABundle")} +} + +func (_c *PoolManager_RootCABundle_Call) Run(run func()) *PoolManager_RootCABundle_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PoolManager_RootCABundle_Call) Return(_a0 params.CertificateBundle, _a1 error) *PoolManager_RootCABundle_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PoolManager_RootCABundle_Call) RunAndReturn(run func() (params.CertificateBundle, error)) *PoolManager_RootCABundle_Call { + _c.Call.Return(run) + return _c +} + // SetPoolRunningState provides a mock function with given fields: isRunning, failureReason func (_m *PoolManager) SetPoolRunningState(isRunning bool, failureReason string) { _m.Called(isRunning, failureReason) } +// PoolManager_SetPoolRunningState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SetPoolRunningState' +type PoolManager_SetPoolRunningState_Call struct { + *mock.Call +} + +// SetPoolRunningState is a helper method to define mock.On call +// - isRunning bool +// - failureReason string +func (_e *PoolManager_Expecter) SetPoolRunningState(isRunning interface{}, failureReason interface{}) *PoolManager_SetPoolRunningState_Call { + return &PoolManager_SetPoolRunningState_Call{Call: _e.mock.On("SetPoolRunningState", isRunning, failureReason)} +} + +func (_c *PoolManager_SetPoolRunningState_Call) Run(run func(isRunning bool, failureReason string)) *PoolManager_SetPoolRunningState_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(bool), args[1].(string)) + }) + return _c +} + +func (_c *PoolManager_SetPoolRunningState_Call) Return() *PoolManager_SetPoolRunningState_Call { + _c.Call.Return() + return _c +} + +func (_c *PoolManager_SetPoolRunningState_Call) RunAndReturn(run func(bool, string)) *PoolManager_SetPoolRunningState_Call { + _c.Run(run) + return _c +} + // Start provides a mock function with no fields func (_m *PoolManager) Start() error { ret := _m.Called() @@ -185,6 +388,33 @@ func (_m *PoolManager) Start() error { return r0 } +// PoolManager_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type PoolManager_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +func (_e *PoolManager_Expecter) Start() *PoolManager_Start_Call { + return &PoolManager_Start_Call{Call: _e.mock.On("Start")} +} + +func (_c *PoolManager_Start_Call) Run(run func()) *PoolManager_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PoolManager_Start_Call) Return(_a0 error) *PoolManager_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PoolManager_Start_Call) RunAndReturn(run func() error) *PoolManager_Start_Call { + _c.Call.Return(run) + return _c +} + // Status provides a mock function with no fields func (_m *PoolManager) Status() params.PoolManagerStatus { ret := _m.Called() @@ -203,6 +433,33 @@ func (_m *PoolManager) Status() params.PoolManagerStatus { return r0 } +// PoolManager_Status_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Status' +type PoolManager_Status_Call struct { + *mock.Call +} + +// Status is a helper method to define mock.On call +func (_e *PoolManager_Expecter) Status() *PoolManager_Status_Call { + return &PoolManager_Status_Call{Call: _e.mock.On("Status")} +} + +func (_c *PoolManager_Status_Call) Run(run func()) *PoolManager_Status_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PoolManager_Status_Call) Return(_a0 params.PoolManagerStatus) *PoolManager_Status_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PoolManager_Status_Call) RunAndReturn(run func() params.PoolManagerStatus) *PoolManager_Status_Call { + _c.Call.Return(run) + return _c +} + // Stop provides a mock function with no fields func (_m *PoolManager) Stop() error { ret := _m.Called() @@ -221,6 +478,33 @@ func (_m *PoolManager) Stop() error { return r0 } +// PoolManager_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' +type PoolManager_Stop_Call struct { + *mock.Call +} + +// Stop is a helper method to define mock.On call +func (_e *PoolManager_Expecter) Stop() *PoolManager_Stop_Call { + return &PoolManager_Stop_Call{Call: _e.mock.On("Stop")} +} + +func (_c *PoolManager_Stop_Call) Run(run func()) *PoolManager_Stop_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PoolManager_Stop_Call) Return(_a0 error) *PoolManager_Stop_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PoolManager_Stop_Call) RunAndReturn(run func() error) *PoolManager_Stop_Call { + _c.Call.Return(run) + return _c +} + // UninstallWebhook provides a mock function with given fields: ctx func (_m *PoolManager) UninstallWebhook(ctx context.Context) error { ret := _m.Called(ctx) @@ -239,6 +523,34 @@ func (_m *PoolManager) UninstallWebhook(ctx context.Context) error { return r0 } +// PoolManager_UninstallWebhook_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UninstallWebhook' +type PoolManager_UninstallWebhook_Call struct { + *mock.Call +} + +// UninstallWebhook is a helper method to define mock.On call +// - ctx context.Context +func (_e *PoolManager_Expecter) UninstallWebhook(ctx interface{}) *PoolManager_UninstallWebhook_Call { + return &PoolManager_UninstallWebhook_Call{Call: _e.mock.On("UninstallWebhook", ctx)} +} + +func (_c *PoolManager_UninstallWebhook_Call) Run(run func(ctx context.Context)) *PoolManager_UninstallWebhook_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *PoolManager_UninstallWebhook_Call) Return(_a0 error) *PoolManager_UninstallWebhook_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PoolManager_UninstallWebhook_Call) RunAndReturn(run func(context.Context) error) *PoolManager_UninstallWebhook_Call { + _c.Call.Return(run) + return _c +} + // Wait provides a mock function with no fields func (_m *PoolManager) Wait() error { ret := _m.Called() @@ -257,6 +569,33 @@ func (_m *PoolManager) Wait() error { return r0 } +// PoolManager_Wait_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Wait' +type PoolManager_Wait_Call struct { + *mock.Call +} + +// Wait is a helper method to define mock.On call +func (_e *PoolManager_Expecter) Wait() *PoolManager_Wait_Call { + return &PoolManager_Wait_Call{Call: _e.mock.On("Wait")} +} + +func (_c *PoolManager_Wait_Call) Run(run func()) *PoolManager_Wait_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PoolManager_Wait_Call) Return(_a0 error) *PoolManager_Wait_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PoolManager_Wait_Call) RunAndReturn(run func() error) *PoolManager_Wait_Call { + _c.Call.Return(run) + return _c +} + // WebhookSecret provides a mock function with no fields func (_m *PoolManager) WebhookSecret() string { ret := _m.Called() @@ -275,6 +614,33 @@ func (_m *PoolManager) WebhookSecret() string { return r0 } +// PoolManager_WebhookSecret_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'WebhookSecret' +type PoolManager_WebhookSecret_Call struct { + *mock.Call +} + +// WebhookSecret is a helper method to define mock.On call +func (_e *PoolManager_Expecter) WebhookSecret() *PoolManager_WebhookSecret_Call { + return &PoolManager_WebhookSecret_Call{Call: _e.mock.On("WebhookSecret")} +} + +func (_c *PoolManager_WebhookSecret_Call) Run(run func()) *PoolManager_WebhookSecret_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PoolManager_WebhookSecret_Call) Return(_a0 string) *PoolManager_WebhookSecret_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PoolManager_WebhookSecret_Call) RunAndReturn(run func() string) *PoolManager_WebhookSecret_Call { + _c.Call.Return(run) + return _c +} + // NewPoolManager creates a new instance of PoolManager. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewPoolManager(t interface { diff --git a/runner/common/mocks/Provider.go b/runner/common/mocks/Provider.go index e7491ac5..5bf94a10 100644 --- a/runner/common/mocks/Provider.go +++ b/runner/common/mocks/Provider.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.3. DO NOT EDIT. +// Code generated by mockery. DO NOT EDIT. package mocks @@ -19,6 +19,14 @@ type Provider struct { mock.Mock } +type Provider_Expecter struct { + mock *mock.Mock +} + +func (_m *Provider) EXPECT() *Provider_Expecter { + return &Provider_Expecter{mock: &_m.Mock} +} + // AsParams provides a mock function with no fields func (_m *Provider) AsParams() params.Provider { ret := _m.Called() @@ -37,6 +45,33 @@ func (_m *Provider) AsParams() params.Provider { return r0 } +// Provider_AsParams_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'AsParams' +type Provider_AsParams_Call struct { + *mock.Call +} + +// AsParams is a helper method to define mock.On call +func (_e *Provider_Expecter) AsParams() *Provider_AsParams_Call { + return &Provider_AsParams_Call{Call: _e.mock.On("AsParams")} +} + +func (_c *Provider_AsParams_Call) Run(run func()) *Provider_AsParams_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Provider_AsParams_Call) Return(_a0 params.Provider) *Provider_AsParams_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Provider_AsParams_Call) RunAndReturn(run func() params.Provider) *Provider_AsParams_Call { + _c.Call.Return(run) + return _c +} + // CreateInstance provides a mock function with given fields: ctx, bootstrapParams, createInstanceParams func (_m *Provider) CreateInstance(ctx context.Context, bootstrapParams garm_provider_commonparams.BootstrapInstance, createInstanceParams common.CreateInstanceParams) (garm_provider_commonparams.ProviderInstance, error) { ret := _m.Called(ctx, bootstrapParams, createInstanceParams) @@ -65,6 +100,36 @@ func (_m *Provider) CreateInstance(ctx context.Context, bootstrapParams garm_pro return r0, r1 } +// Provider_CreateInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateInstance' +type Provider_CreateInstance_Call struct { + *mock.Call +} + +// CreateInstance is a helper method to define mock.On call +// - ctx context.Context +// - bootstrapParams garm_provider_commonparams.BootstrapInstance +// - createInstanceParams common.CreateInstanceParams +func (_e *Provider_Expecter) CreateInstance(ctx interface{}, bootstrapParams interface{}, createInstanceParams interface{}) *Provider_CreateInstance_Call { + return &Provider_CreateInstance_Call{Call: _e.mock.On("CreateInstance", ctx, bootstrapParams, createInstanceParams)} +} + +func (_c *Provider_CreateInstance_Call) Run(run func(ctx context.Context, bootstrapParams garm_provider_commonparams.BootstrapInstance, createInstanceParams common.CreateInstanceParams)) *Provider_CreateInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(garm_provider_commonparams.BootstrapInstance), args[2].(common.CreateInstanceParams)) + }) + return _c +} + +func (_c *Provider_CreateInstance_Call) Return(_a0 garm_provider_commonparams.ProviderInstance, _a1 error) *Provider_CreateInstance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Provider_CreateInstance_Call) RunAndReturn(run func(context.Context, garm_provider_commonparams.BootstrapInstance, common.CreateInstanceParams) (garm_provider_commonparams.ProviderInstance, error)) *Provider_CreateInstance_Call { + _c.Call.Return(run) + return _c +} + // DeleteInstance provides a mock function with given fields: ctx, instance, deleteInstanceParams func (_m *Provider) DeleteInstance(ctx context.Context, instance string, deleteInstanceParams common.DeleteInstanceParams) error { ret := _m.Called(ctx, instance, deleteInstanceParams) @@ -83,6 +148,36 @@ func (_m *Provider) DeleteInstance(ctx context.Context, instance string, deleteI return r0 } +// Provider_DeleteInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteInstance' +type Provider_DeleteInstance_Call struct { + *mock.Call +} + +// DeleteInstance is a helper method to define mock.On call +// - ctx context.Context +// - instance string +// - deleteInstanceParams common.DeleteInstanceParams +func (_e *Provider_Expecter) DeleteInstance(ctx interface{}, instance interface{}, deleteInstanceParams interface{}) *Provider_DeleteInstance_Call { + return &Provider_DeleteInstance_Call{Call: _e.mock.On("DeleteInstance", ctx, instance, deleteInstanceParams)} +} + +func (_c *Provider_DeleteInstance_Call) Run(run func(ctx context.Context, instance string, deleteInstanceParams common.DeleteInstanceParams)) *Provider_DeleteInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(common.DeleteInstanceParams)) + }) + return _c +} + +func (_c *Provider_DeleteInstance_Call) Return(_a0 error) *Provider_DeleteInstance_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Provider_DeleteInstance_Call) RunAndReturn(run func(context.Context, string, common.DeleteInstanceParams) error) *Provider_DeleteInstance_Call { + _c.Call.Return(run) + return _c +} + // DisableJITConfig provides a mock function with no fields func (_m *Provider) DisableJITConfig() bool { ret := _m.Called() @@ -101,6 +196,33 @@ func (_m *Provider) DisableJITConfig() bool { return r0 } +// Provider_DisableJITConfig_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DisableJITConfig' +type Provider_DisableJITConfig_Call struct { + *mock.Call +} + +// DisableJITConfig is a helper method to define mock.On call +func (_e *Provider_Expecter) DisableJITConfig() *Provider_DisableJITConfig_Call { + return &Provider_DisableJITConfig_Call{Call: _e.mock.On("DisableJITConfig")} +} + +func (_c *Provider_DisableJITConfig_Call) Run(run func()) *Provider_DisableJITConfig_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *Provider_DisableJITConfig_Call) Return(_a0 bool) *Provider_DisableJITConfig_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Provider_DisableJITConfig_Call) RunAndReturn(run func() bool) *Provider_DisableJITConfig_Call { + _c.Call.Return(run) + return _c +} + // GetInstance provides a mock function with given fields: ctx, instance, getInstanceParams func (_m *Provider) GetInstance(ctx context.Context, instance string, getInstanceParams common.GetInstanceParams) (garm_provider_commonparams.ProviderInstance, error) { ret := _m.Called(ctx, instance, getInstanceParams) @@ -129,6 +251,36 @@ func (_m *Provider) GetInstance(ctx context.Context, instance string, getInstanc return r0, r1 } +// Provider_GetInstance_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetInstance' +type Provider_GetInstance_Call struct { + *mock.Call +} + +// GetInstance is a helper method to define mock.On call +// - ctx context.Context +// - instance string +// - getInstanceParams common.GetInstanceParams +func (_e *Provider_Expecter) GetInstance(ctx interface{}, instance interface{}, getInstanceParams interface{}) *Provider_GetInstance_Call { + return &Provider_GetInstance_Call{Call: _e.mock.On("GetInstance", ctx, instance, getInstanceParams)} +} + +func (_c *Provider_GetInstance_Call) Run(run func(ctx context.Context, instance string, getInstanceParams common.GetInstanceParams)) *Provider_GetInstance_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(common.GetInstanceParams)) + }) + return _c +} + +func (_c *Provider_GetInstance_Call) Return(_a0 garm_provider_commonparams.ProviderInstance, _a1 error) *Provider_GetInstance_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Provider_GetInstance_Call) RunAndReturn(run func(context.Context, string, common.GetInstanceParams) (garm_provider_commonparams.ProviderInstance, error)) *Provider_GetInstance_Call { + _c.Call.Return(run) + return _c +} + // ListInstances provides a mock function with given fields: ctx, poolID, listInstancesParams func (_m *Provider) ListInstances(ctx context.Context, poolID string, listInstancesParams common.ListInstancesParams) ([]garm_provider_commonparams.ProviderInstance, error) { ret := _m.Called(ctx, poolID, listInstancesParams) @@ -159,6 +311,36 @@ func (_m *Provider) ListInstances(ctx context.Context, poolID string, listInstan return r0, r1 } +// Provider_ListInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ListInstances' +type Provider_ListInstances_Call struct { + *mock.Call +} + +// ListInstances is a helper method to define mock.On call +// - ctx context.Context +// - poolID string +// - listInstancesParams common.ListInstancesParams +func (_e *Provider_Expecter) ListInstances(ctx interface{}, poolID interface{}, listInstancesParams interface{}) *Provider_ListInstances_Call { + return &Provider_ListInstances_Call{Call: _e.mock.On("ListInstances", ctx, poolID, listInstancesParams)} +} + +func (_c *Provider_ListInstances_Call) Run(run func(ctx context.Context, poolID string, listInstancesParams common.ListInstancesParams)) *Provider_ListInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(common.ListInstancesParams)) + }) + return _c +} + +func (_c *Provider_ListInstances_Call) Return(_a0 []garm_provider_commonparams.ProviderInstance, _a1 error) *Provider_ListInstances_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *Provider_ListInstances_Call) RunAndReturn(run func(context.Context, string, common.ListInstancesParams) ([]garm_provider_commonparams.ProviderInstance, error)) *Provider_ListInstances_Call { + _c.Call.Return(run) + return _c +} + // RemoveAllInstances provides a mock function with given fields: ctx, removeAllInstancesParams func (_m *Provider) RemoveAllInstances(ctx context.Context, removeAllInstancesParams common.RemoveAllInstancesParams) error { ret := _m.Called(ctx, removeAllInstancesParams) @@ -177,6 +359,35 @@ func (_m *Provider) RemoveAllInstances(ctx context.Context, removeAllInstancesPa return r0 } +// Provider_RemoveAllInstances_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveAllInstances' +type Provider_RemoveAllInstances_Call struct { + *mock.Call +} + +// RemoveAllInstances is a helper method to define mock.On call +// - ctx context.Context +// - removeAllInstancesParams common.RemoveAllInstancesParams +func (_e *Provider_Expecter) RemoveAllInstances(ctx interface{}, removeAllInstancesParams interface{}) *Provider_RemoveAllInstances_Call { + return &Provider_RemoveAllInstances_Call{Call: _e.mock.On("RemoveAllInstances", ctx, removeAllInstancesParams)} +} + +func (_c *Provider_RemoveAllInstances_Call) Run(run func(ctx context.Context, removeAllInstancesParams common.RemoveAllInstancesParams)) *Provider_RemoveAllInstances_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(common.RemoveAllInstancesParams)) + }) + return _c +} + +func (_c *Provider_RemoveAllInstances_Call) Return(_a0 error) *Provider_RemoveAllInstances_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Provider_RemoveAllInstances_Call) RunAndReturn(run func(context.Context, common.RemoveAllInstancesParams) error) *Provider_RemoveAllInstances_Call { + _c.Call.Return(run) + return _c +} + // Start provides a mock function with given fields: ctx, instance, startParams func (_m *Provider) Start(ctx context.Context, instance string, startParams common.StartParams) error { ret := _m.Called(ctx, instance, startParams) @@ -195,6 +406,36 @@ func (_m *Provider) Start(ctx context.Context, instance string, startParams comm return r0 } +// Provider_Start_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Start' +type Provider_Start_Call struct { + *mock.Call +} + +// Start is a helper method to define mock.On call +// - ctx context.Context +// - instance string +// - startParams common.StartParams +func (_e *Provider_Expecter) Start(ctx interface{}, instance interface{}, startParams interface{}) *Provider_Start_Call { + return &Provider_Start_Call{Call: _e.mock.On("Start", ctx, instance, startParams)} +} + +func (_c *Provider_Start_Call) Run(run func(ctx context.Context, instance string, startParams common.StartParams)) *Provider_Start_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(common.StartParams)) + }) + return _c +} + +func (_c *Provider_Start_Call) Return(_a0 error) *Provider_Start_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Provider_Start_Call) RunAndReturn(run func(context.Context, string, common.StartParams) error) *Provider_Start_Call { + _c.Call.Return(run) + return _c +} + // Stop provides a mock function with given fields: ctx, instance, stopParams func (_m *Provider) Stop(ctx context.Context, instance string, stopParams common.StopParams) error { ret := _m.Called(ctx, instance, stopParams) @@ -213,6 +454,36 @@ func (_m *Provider) Stop(ctx context.Context, instance string, stopParams common return r0 } +// Provider_Stop_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Stop' +type Provider_Stop_Call struct { + *mock.Call +} + +// Stop is a helper method to define mock.On call +// - ctx context.Context +// - instance string +// - stopParams common.StopParams +func (_e *Provider_Expecter) Stop(ctx interface{}, instance interface{}, stopParams interface{}) *Provider_Stop_Call { + return &Provider_Stop_Call{Call: _e.mock.On("Stop", ctx, instance, stopParams)} +} + +func (_c *Provider_Stop_Call) Run(run func(ctx context.Context, instance string, stopParams common.StopParams)) *Provider_Stop_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string), args[2].(common.StopParams)) + }) + return _c +} + +func (_c *Provider_Stop_Call) Return(_a0 error) *Provider_Stop_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *Provider_Stop_Call) RunAndReturn(run func(context.Context, string, common.StopParams) error) *Provider_Stop_Call { + _c.Call.Return(run) + return _c +} + // NewProvider creates a new instance of Provider. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewProvider(t interface { diff --git a/runner/common/mocks/RateLimitClient.go b/runner/common/mocks/RateLimitClient.go index 119f62e1..b7e52f71 100644 --- a/runner/common/mocks/RateLimitClient.go +++ b/runner/common/mocks/RateLimitClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.3. DO NOT EDIT. +// Code generated by mockery. DO NOT EDIT. package mocks @@ -14,6 +14,14 @@ type RateLimitClient struct { mock.Mock } +type RateLimitClient_Expecter struct { + mock *mock.Mock +} + +func (_m *RateLimitClient) EXPECT() *RateLimitClient_Expecter { + return &RateLimitClient_Expecter{mock: &_m.Mock} +} + // RateLimit provides a mock function with given fields: ctx func (_m *RateLimitClient) RateLimit(ctx context.Context) (*github.RateLimits, error) { ret := _m.Called(ctx) @@ -44,6 +52,34 @@ func (_m *RateLimitClient) RateLimit(ctx context.Context) (*github.RateLimits, e return r0, r1 } +// RateLimitClient_RateLimit_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RateLimit' +type RateLimitClient_RateLimit_Call struct { + *mock.Call +} + +// RateLimit is a helper method to define mock.On call +// - ctx context.Context +func (_e *RateLimitClient_Expecter) RateLimit(ctx interface{}) *RateLimitClient_RateLimit_Call { + return &RateLimitClient_RateLimit_Call{Call: _e.mock.On("RateLimit", ctx)} +} + +func (_c *RateLimitClient_RateLimit_Call) Run(run func(ctx context.Context)) *RateLimitClient_RateLimit_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context)) + }) + return _c +} + +func (_c *RateLimitClient_RateLimit_Call) Return(_a0 *github.RateLimits, _a1 error) *RateLimitClient_RateLimit_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *RateLimitClient_RateLimit_Call) RunAndReturn(run func(context.Context) (*github.RateLimits, error)) *RateLimitClient_RateLimit_Call { + _c.Call.Return(run) + return _c +} + // NewRateLimitClient creates a new instance of RateLimitClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewRateLimitClient(t interface { diff --git a/runner/common/pool.go b/runner/common/pool.go index 18f46a9d..4cb86a62 100644 --- a/runner/common/pool.go +++ b/runner/common/pool.go @@ -36,7 +36,7 @@ const ( BackoffTimer = 1 * time.Minute ) -//go:generate mockery --all +//go:generate go run github.com/vektra/mockery/v2@latest type PoolManager interface { // ID returns the ID of the entity (repo, org, enterprise) ID() string diff --git a/runner/common/provider.go b/runner/common/provider.go index 7454540f..a5d0db66 100644 --- a/runner/common/provider.go +++ b/runner/common/provider.go @@ -21,7 +21,7 @@ import ( "github.com/cloudbase/garm/params" ) -//go:generate mockery --all +//go:generate go run github.com/vektra/mockery/v2@latest type Provider interface { // CreateInstance creates a new compute instance in the provider. CreateInstance(ctx context.Context, bootstrapParams commonParams.BootstrapInstance, createInstanceParams CreateInstanceParams) (commonParams.ProviderInstance, error) diff --git a/runner/common/util.go b/runner/common/util.go index 588ab68e..d8519438 100644 --- a/runner/common/util.go +++ b/runner/common/util.go @@ -49,7 +49,7 @@ type RateLimitClient interface { // GithubClient that describes the minimum list of functions we need to interact with github. // Allows for easier testing. // -//go:generate mockery --all +//go:generate go run github.com/vektra/mockery/v2@latest type GithubClient interface { GithubEntityOperations diff --git a/runner/interfaces.go b/runner/interfaces.go index ff8129ed..3d4703f7 100644 --- a/runner/interfaces.go +++ b/runner/interfaces.go @@ -43,7 +43,7 @@ type EnterprisePoolManager interface { GetEnterprisePoolManagers() (map[string]common.PoolManager, error) } -//go:generate mockery --name=PoolManagerController +//go:generate go run github.com/vektra/mockery/v2@latest type PoolManagerController interface { RepoPoolManager diff --git a/runner/mocks/PoolManagerController.go b/runner/mocks/PoolManagerController.go index 05720ebe..b17196ec 100644 --- a/runner/mocks/PoolManagerController.go +++ b/runner/mocks/PoolManagerController.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.53.3. DO NOT EDIT. +// Code generated by mockery. DO NOT EDIT. package mocks @@ -19,6 +19,14 @@ type PoolManagerController struct { mock.Mock } +type PoolManagerController_Expecter struct { + mock *mock.Mock +} + +func (_m *PoolManagerController) EXPECT() *PoolManagerController_Expecter { + return &PoolManagerController_Expecter{mock: &_m.Mock} +} + // CreateEnterprisePoolManager provides a mock function with given fields: ctx, enterprise, providers, store func (_m *PoolManagerController) CreateEnterprisePoolManager(ctx context.Context, enterprise params.Enterprise, providers map[string]common.Provider, store databasecommon.Store) (common.PoolManager, error) { ret := _m.Called(ctx, enterprise, providers, store) @@ -49,6 +57,37 @@ func (_m *PoolManagerController) CreateEnterprisePoolManager(ctx context.Context return r0, r1 } +// PoolManagerController_CreateEnterprisePoolManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateEnterprisePoolManager' +type PoolManagerController_CreateEnterprisePoolManager_Call struct { + *mock.Call +} + +// CreateEnterprisePoolManager is a helper method to define mock.On call +// - ctx context.Context +// - enterprise params.Enterprise +// - providers map[string]common.Provider +// - store databasecommon.Store +func (_e *PoolManagerController_Expecter) CreateEnterprisePoolManager(ctx interface{}, enterprise interface{}, providers interface{}, store interface{}) *PoolManagerController_CreateEnterprisePoolManager_Call { + return &PoolManagerController_CreateEnterprisePoolManager_Call{Call: _e.mock.On("CreateEnterprisePoolManager", ctx, enterprise, providers, store)} +} + +func (_c *PoolManagerController_CreateEnterprisePoolManager_Call) Run(run func(ctx context.Context, enterprise params.Enterprise, providers map[string]common.Provider, store databasecommon.Store)) *PoolManagerController_CreateEnterprisePoolManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.Enterprise), args[2].(map[string]common.Provider), args[3].(databasecommon.Store)) + }) + return _c +} + +func (_c *PoolManagerController_CreateEnterprisePoolManager_Call) Return(_a0 common.PoolManager, _a1 error) *PoolManagerController_CreateEnterprisePoolManager_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PoolManagerController_CreateEnterprisePoolManager_Call) RunAndReturn(run func(context.Context, params.Enterprise, map[string]common.Provider, databasecommon.Store) (common.PoolManager, error)) *PoolManagerController_CreateEnterprisePoolManager_Call { + _c.Call.Return(run) + return _c +} + // CreateOrgPoolManager provides a mock function with given fields: ctx, org, providers, store func (_m *PoolManagerController) CreateOrgPoolManager(ctx context.Context, org params.Organization, providers map[string]common.Provider, store databasecommon.Store) (common.PoolManager, error) { ret := _m.Called(ctx, org, providers, store) @@ -79,6 +118,37 @@ func (_m *PoolManagerController) CreateOrgPoolManager(ctx context.Context, org p return r0, r1 } +// PoolManagerController_CreateOrgPoolManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateOrgPoolManager' +type PoolManagerController_CreateOrgPoolManager_Call struct { + *mock.Call +} + +// CreateOrgPoolManager is a helper method to define mock.On call +// - ctx context.Context +// - org params.Organization +// - providers map[string]common.Provider +// - store databasecommon.Store +func (_e *PoolManagerController_Expecter) CreateOrgPoolManager(ctx interface{}, org interface{}, providers interface{}, store interface{}) *PoolManagerController_CreateOrgPoolManager_Call { + return &PoolManagerController_CreateOrgPoolManager_Call{Call: _e.mock.On("CreateOrgPoolManager", ctx, org, providers, store)} +} + +func (_c *PoolManagerController_CreateOrgPoolManager_Call) Run(run func(ctx context.Context, org params.Organization, providers map[string]common.Provider, store databasecommon.Store)) *PoolManagerController_CreateOrgPoolManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.Organization), args[2].(map[string]common.Provider), args[3].(databasecommon.Store)) + }) + return _c +} + +func (_c *PoolManagerController_CreateOrgPoolManager_Call) Return(_a0 common.PoolManager, _a1 error) *PoolManagerController_CreateOrgPoolManager_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PoolManagerController_CreateOrgPoolManager_Call) RunAndReturn(run func(context.Context, params.Organization, map[string]common.Provider, databasecommon.Store) (common.PoolManager, error)) *PoolManagerController_CreateOrgPoolManager_Call { + _c.Call.Return(run) + return _c +} + // CreateRepoPoolManager provides a mock function with given fields: ctx, repo, providers, store func (_m *PoolManagerController) CreateRepoPoolManager(ctx context.Context, repo params.Repository, providers map[string]common.Provider, store databasecommon.Store) (common.PoolManager, error) { ret := _m.Called(ctx, repo, providers, store) @@ -109,6 +179,37 @@ func (_m *PoolManagerController) CreateRepoPoolManager(ctx context.Context, repo return r0, r1 } +// PoolManagerController_CreateRepoPoolManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateRepoPoolManager' +type PoolManagerController_CreateRepoPoolManager_Call struct { + *mock.Call +} + +// CreateRepoPoolManager is a helper method to define mock.On call +// - ctx context.Context +// - repo params.Repository +// - providers map[string]common.Provider +// - store databasecommon.Store +func (_e *PoolManagerController_Expecter) CreateRepoPoolManager(ctx interface{}, repo interface{}, providers interface{}, store interface{}) *PoolManagerController_CreateRepoPoolManager_Call { + return &PoolManagerController_CreateRepoPoolManager_Call{Call: _e.mock.On("CreateRepoPoolManager", ctx, repo, providers, store)} +} + +func (_c *PoolManagerController_CreateRepoPoolManager_Call) Run(run func(ctx context.Context, repo params.Repository, providers map[string]common.Provider, store databasecommon.Store)) *PoolManagerController_CreateRepoPoolManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(params.Repository), args[2].(map[string]common.Provider), args[3].(databasecommon.Store)) + }) + return _c +} + +func (_c *PoolManagerController_CreateRepoPoolManager_Call) Return(_a0 common.PoolManager, _a1 error) *PoolManagerController_CreateRepoPoolManager_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PoolManagerController_CreateRepoPoolManager_Call) RunAndReturn(run func(context.Context, params.Repository, map[string]common.Provider, databasecommon.Store) (common.PoolManager, error)) *PoolManagerController_CreateRepoPoolManager_Call { + _c.Call.Return(run) + return _c +} + // DeleteEnterprisePoolManager provides a mock function with given fields: enterprise func (_m *PoolManagerController) DeleteEnterprisePoolManager(enterprise params.Enterprise) error { ret := _m.Called(enterprise) @@ -127,6 +228,34 @@ func (_m *PoolManagerController) DeleteEnterprisePoolManager(enterprise params.E return r0 } +// PoolManagerController_DeleteEnterprisePoolManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteEnterprisePoolManager' +type PoolManagerController_DeleteEnterprisePoolManager_Call struct { + *mock.Call +} + +// DeleteEnterprisePoolManager is a helper method to define mock.On call +// - enterprise params.Enterprise +func (_e *PoolManagerController_Expecter) DeleteEnterprisePoolManager(enterprise interface{}) *PoolManagerController_DeleteEnterprisePoolManager_Call { + return &PoolManagerController_DeleteEnterprisePoolManager_Call{Call: _e.mock.On("DeleteEnterprisePoolManager", enterprise)} +} + +func (_c *PoolManagerController_DeleteEnterprisePoolManager_Call) Run(run func(enterprise params.Enterprise)) *PoolManagerController_DeleteEnterprisePoolManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(params.Enterprise)) + }) + return _c +} + +func (_c *PoolManagerController_DeleteEnterprisePoolManager_Call) Return(_a0 error) *PoolManagerController_DeleteEnterprisePoolManager_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PoolManagerController_DeleteEnterprisePoolManager_Call) RunAndReturn(run func(params.Enterprise) error) *PoolManagerController_DeleteEnterprisePoolManager_Call { + _c.Call.Return(run) + return _c +} + // DeleteOrgPoolManager provides a mock function with given fields: org func (_m *PoolManagerController) DeleteOrgPoolManager(org params.Organization) error { ret := _m.Called(org) @@ -145,6 +274,34 @@ func (_m *PoolManagerController) DeleteOrgPoolManager(org params.Organization) e return r0 } +// PoolManagerController_DeleteOrgPoolManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteOrgPoolManager' +type PoolManagerController_DeleteOrgPoolManager_Call struct { + *mock.Call +} + +// DeleteOrgPoolManager is a helper method to define mock.On call +// - org params.Organization +func (_e *PoolManagerController_Expecter) DeleteOrgPoolManager(org interface{}) *PoolManagerController_DeleteOrgPoolManager_Call { + return &PoolManagerController_DeleteOrgPoolManager_Call{Call: _e.mock.On("DeleteOrgPoolManager", org)} +} + +func (_c *PoolManagerController_DeleteOrgPoolManager_Call) Run(run func(org params.Organization)) *PoolManagerController_DeleteOrgPoolManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(params.Organization)) + }) + return _c +} + +func (_c *PoolManagerController_DeleteOrgPoolManager_Call) Return(_a0 error) *PoolManagerController_DeleteOrgPoolManager_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PoolManagerController_DeleteOrgPoolManager_Call) RunAndReturn(run func(params.Organization) error) *PoolManagerController_DeleteOrgPoolManager_Call { + _c.Call.Return(run) + return _c +} + // DeleteRepoPoolManager provides a mock function with given fields: repo func (_m *PoolManagerController) DeleteRepoPoolManager(repo params.Repository) error { ret := _m.Called(repo) @@ -163,6 +320,34 @@ func (_m *PoolManagerController) DeleteRepoPoolManager(repo params.Repository) e return r0 } +// PoolManagerController_DeleteRepoPoolManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteRepoPoolManager' +type PoolManagerController_DeleteRepoPoolManager_Call struct { + *mock.Call +} + +// DeleteRepoPoolManager is a helper method to define mock.On call +// - repo params.Repository +func (_e *PoolManagerController_Expecter) DeleteRepoPoolManager(repo interface{}) *PoolManagerController_DeleteRepoPoolManager_Call { + return &PoolManagerController_DeleteRepoPoolManager_Call{Call: _e.mock.On("DeleteRepoPoolManager", repo)} +} + +func (_c *PoolManagerController_DeleteRepoPoolManager_Call) Run(run func(repo params.Repository)) *PoolManagerController_DeleteRepoPoolManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(params.Repository)) + }) + return _c +} + +func (_c *PoolManagerController_DeleteRepoPoolManager_Call) Return(_a0 error) *PoolManagerController_DeleteRepoPoolManager_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *PoolManagerController_DeleteRepoPoolManager_Call) RunAndReturn(run func(params.Repository) error) *PoolManagerController_DeleteRepoPoolManager_Call { + _c.Call.Return(run) + return _c +} + // GetEnterprisePoolManager provides a mock function with given fields: enterprise func (_m *PoolManagerController) GetEnterprisePoolManager(enterprise params.Enterprise) (common.PoolManager, error) { ret := _m.Called(enterprise) @@ -193,6 +378,34 @@ func (_m *PoolManagerController) GetEnterprisePoolManager(enterprise params.Ente return r0, r1 } +// PoolManagerController_GetEnterprisePoolManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEnterprisePoolManager' +type PoolManagerController_GetEnterprisePoolManager_Call struct { + *mock.Call +} + +// GetEnterprisePoolManager is a helper method to define mock.On call +// - enterprise params.Enterprise +func (_e *PoolManagerController_Expecter) GetEnterprisePoolManager(enterprise interface{}) *PoolManagerController_GetEnterprisePoolManager_Call { + return &PoolManagerController_GetEnterprisePoolManager_Call{Call: _e.mock.On("GetEnterprisePoolManager", enterprise)} +} + +func (_c *PoolManagerController_GetEnterprisePoolManager_Call) Run(run func(enterprise params.Enterprise)) *PoolManagerController_GetEnterprisePoolManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(params.Enterprise)) + }) + return _c +} + +func (_c *PoolManagerController_GetEnterprisePoolManager_Call) Return(_a0 common.PoolManager, _a1 error) *PoolManagerController_GetEnterprisePoolManager_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PoolManagerController_GetEnterprisePoolManager_Call) RunAndReturn(run func(params.Enterprise) (common.PoolManager, error)) *PoolManagerController_GetEnterprisePoolManager_Call { + _c.Call.Return(run) + return _c +} + // GetEnterprisePoolManagers provides a mock function with no fields func (_m *PoolManagerController) GetEnterprisePoolManagers() (map[string]common.PoolManager, error) { ret := _m.Called() @@ -223,6 +436,33 @@ func (_m *PoolManagerController) GetEnterprisePoolManagers() (map[string]common. return r0, r1 } +// PoolManagerController_GetEnterprisePoolManagers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetEnterprisePoolManagers' +type PoolManagerController_GetEnterprisePoolManagers_Call struct { + *mock.Call +} + +// GetEnterprisePoolManagers is a helper method to define mock.On call +func (_e *PoolManagerController_Expecter) GetEnterprisePoolManagers() *PoolManagerController_GetEnterprisePoolManagers_Call { + return &PoolManagerController_GetEnterprisePoolManagers_Call{Call: _e.mock.On("GetEnterprisePoolManagers")} +} + +func (_c *PoolManagerController_GetEnterprisePoolManagers_Call) Run(run func()) *PoolManagerController_GetEnterprisePoolManagers_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PoolManagerController_GetEnterprisePoolManagers_Call) Return(_a0 map[string]common.PoolManager, _a1 error) *PoolManagerController_GetEnterprisePoolManagers_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PoolManagerController_GetEnterprisePoolManagers_Call) RunAndReturn(run func() (map[string]common.PoolManager, error)) *PoolManagerController_GetEnterprisePoolManagers_Call { + _c.Call.Return(run) + return _c +} + // GetOrgPoolManager provides a mock function with given fields: org func (_m *PoolManagerController) GetOrgPoolManager(org params.Organization) (common.PoolManager, error) { ret := _m.Called(org) @@ -253,6 +493,34 @@ func (_m *PoolManagerController) GetOrgPoolManager(org params.Organization) (com return r0, r1 } +// PoolManagerController_GetOrgPoolManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrgPoolManager' +type PoolManagerController_GetOrgPoolManager_Call struct { + *mock.Call +} + +// GetOrgPoolManager is a helper method to define mock.On call +// - org params.Organization +func (_e *PoolManagerController_Expecter) GetOrgPoolManager(org interface{}) *PoolManagerController_GetOrgPoolManager_Call { + return &PoolManagerController_GetOrgPoolManager_Call{Call: _e.mock.On("GetOrgPoolManager", org)} +} + +func (_c *PoolManagerController_GetOrgPoolManager_Call) Run(run func(org params.Organization)) *PoolManagerController_GetOrgPoolManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(params.Organization)) + }) + return _c +} + +func (_c *PoolManagerController_GetOrgPoolManager_Call) Return(_a0 common.PoolManager, _a1 error) *PoolManagerController_GetOrgPoolManager_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PoolManagerController_GetOrgPoolManager_Call) RunAndReturn(run func(params.Organization) (common.PoolManager, error)) *PoolManagerController_GetOrgPoolManager_Call { + _c.Call.Return(run) + return _c +} + // GetOrgPoolManagers provides a mock function with no fields func (_m *PoolManagerController) GetOrgPoolManagers() (map[string]common.PoolManager, error) { ret := _m.Called() @@ -283,6 +551,33 @@ func (_m *PoolManagerController) GetOrgPoolManagers() (map[string]common.PoolMan return r0, r1 } +// PoolManagerController_GetOrgPoolManagers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetOrgPoolManagers' +type PoolManagerController_GetOrgPoolManagers_Call struct { + *mock.Call +} + +// GetOrgPoolManagers is a helper method to define mock.On call +func (_e *PoolManagerController_Expecter) GetOrgPoolManagers() *PoolManagerController_GetOrgPoolManagers_Call { + return &PoolManagerController_GetOrgPoolManagers_Call{Call: _e.mock.On("GetOrgPoolManagers")} +} + +func (_c *PoolManagerController_GetOrgPoolManagers_Call) Run(run func()) *PoolManagerController_GetOrgPoolManagers_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PoolManagerController_GetOrgPoolManagers_Call) Return(_a0 map[string]common.PoolManager, _a1 error) *PoolManagerController_GetOrgPoolManagers_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PoolManagerController_GetOrgPoolManagers_Call) RunAndReturn(run func() (map[string]common.PoolManager, error)) *PoolManagerController_GetOrgPoolManagers_Call { + _c.Call.Return(run) + return _c +} + // GetRepoPoolManager provides a mock function with given fields: repo func (_m *PoolManagerController) GetRepoPoolManager(repo params.Repository) (common.PoolManager, error) { ret := _m.Called(repo) @@ -313,6 +608,34 @@ func (_m *PoolManagerController) GetRepoPoolManager(repo params.Repository) (com return r0, r1 } +// PoolManagerController_GetRepoPoolManager_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepoPoolManager' +type PoolManagerController_GetRepoPoolManager_Call struct { + *mock.Call +} + +// GetRepoPoolManager is a helper method to define mock.On call +// - repo params.Repository +func (_e *PoolManagerController_Expecter) GetRepoPoolManager(repo interface{}) *PoolManagerController_GetRepoPoolManager_Call { + return &PoolManagerController_GetRepoPoolManager_Call{Call: _e.mock.On("GetRepoPoolManager", repo)} +} + +func (_c *PoolManagerController_GetRepoPoolManager_Call) Run(run func(repo params.Repository)) *PoolManagerController_GetRepoPoolManager_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(params.Repository)) + }) + return _c +} + +func (_c *PoolManagerController_GetRepoPoolManager_Call) Return(_a0 common.PoolManager, _a1 error) *PoolManagerController_GetRepoPoolManager_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PoolManagerController_GetRepoPoolManager_Call) RunAndReturn(run func(params.Repository) (common.PoolManager, error)) *PoolManagerController_GetRepoPoolManager_Call { + _c.Call.Return(run) + return _c +} + // GetRepoPoolManagers provides a mock function with no fields func (_m *PoolManagerController) GetRepoPoolManagers() (map[string]common.PoolManager, error) { ret := _m.Called() @@ -343,6 +666,33 @@ func (_m *PoolManagerController) GetRepoPoolManagers() (map[string]common.PoolMa return r0, r1 } +// PoolManagerController_GetRepoPoolManagers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetRepoPoolManagers' +type PoolManagerController_GetRepoPoolManagers_Call struct { + *mock.Call +} + +// GetRepoPoolManagers is a helper method to define mock.On call +func (_e *PoolManagerController_Expecter) GetRepoPoolManagers() *PoolManagerController_GetRepoPoolManagers_Call { + return &PoolManagerController_GetRepoPoolManagers_Call{Call: _e.mock.On("GetRepoPoolManagers")} +} + +func (_c *PoolManagerController_GetRepoPoolManagers_Call) Run(run func()) *PoolManagerController_GetRepoPoolManagers_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *PoolManagerController_GetRepoPoolManagers_Call) Return(_a0 map[string]common.PoolManager, _a1 error) *PoolManagerController_GetRepoPoolManagers_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *PoolManagerController_GetRepoPoolManagers_Call) RunAndReturn(run func() (map[string]common.PoolManager, error)) *PoolManagerController_GetRepoPoolManagers_Call { + _c.Call.Return(run) + return _c +} + // NewPoolManagerController creates a new instance of PoolManagerController. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewPoolManagerController(t interface { diff --git a/testdata/config.toml b/testdata/config.toml index ee85ee33..337c0dd6 100644 --- a/testdata/config.toml +++ b/testdata/config.toml @@ -82,6 +82,8 @@ time_to_live = "8760h" certificate = "" # The path on disk to the corresponding private key for the certificate. key = "" + [apiserver.webui] + enable = true [database] # Turn on/off debugging for database queries. diff --git a/util/util.go b/util/util.go index da1264d2..994e4637 100644 --- a/util/util.go +++ b/util/util.go @@ -17,6 +17,7 @@ package util import ( "context" "net/http" + "unicode/utf8" "github.com/pkg/errors" @@ -43,3 +44,70 @@ func FetchTools(ctx context.Context, cli common.GithubClient) ([]commonParams.Ru } return ret, nil } + +func ASCIIEqualFold(s, t string) bool { + // Fast ASCII path for equal-length ASCII strings + if len(s) == len(t) && isASCII(s) && isASCII(t) { + for i := 0; i < len(s); i++ { + a, b := s[i], t[i] + if a != b { + if 'A' <= a && a <= 'Z' { + a = a + 'a' - 'A' + } + if 'A' <= b && b <= 'Z' { + b = b + 'a' - 'A' + } + if a != b { + return false + } + } + } + return true + } + + // UTF-8 path - handle different byte lengths correctly + i, j := 0, 0 + for i < len(s) && j < len(t) { + sr, sizeS := utf8.DecodeRuneInString(s[i:]) + tr, sizeT := utf8.DecodeRuneInString(t[j:]) + + // Handle invalid UTF-8 - they must be identical + if sr == utf8.RuneError || tr == utf8.RuneError { + // For invalid UTF-8, compare the raw bytes + if sr == utf8.RuneError && tr == utf8.RuneError { + if sizeS == sizeT && s[i:i+sizeS] == t[j:j+sizeT] { + i += sizeS + j += sizeT + continue + } + } + return false + } + + if sr != tr { + // Apply ASCII case folding only + if 'A' <= sr && sr <= 'Z' { + sr = sr + 'a' - 'A' + } + if 'A' <= tr && tr <= 'Z' { + tr = tr + 'a' - 'A' + } + if sr != tr { + return false + } + } + + i += sizeS + j += sizeT + } + return i == len(s) && j == len(t) +} + +func isASCII(s string) bool { + for i := 0; i < len(s); i++ { + if s[i] >= 0x80 { + return false + } + } + return true +} diff --git a/util/util_test.go b/util/util_test.go new file mode 100644 index 00000000..f04dab84 --- /dev/null +++ b/util/util_test.go @@ -0,0 +1,394 @@ +// Copyright 2022 Cloudbase Solutions SRL +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. + +package util + +import ( + "testing" +) + +func TestASCIIEqualFold(t *testing.T) { + tests := []struct { + name string + s string + t string + expected bool + reason string + }{ + // Basic ASCII case folding tests + { + name: "identical strings", + s: "hello", + t: "hello", + expected: true, + reason: "identical strings should match", + }, + { + name: "simple case difference", + s: "Hello", + t: "hello", + expected: true, + reason: "ASCII case folding should match H/h", + }, + { + name: "all uppercase vs lowercase", + s: "HELLO", + t: "hello", + expected: true, + reason: "ASCII case folding should match all cases", + }, + { + name: "mixed case", + s: "HeLLo", + t: "hEllO", + expected: true, + reason: "mixed case should match after folding", + }, + + // Empty string tests + { + name: "both empty", + s: "", + t: "", + expected: true, + reason: "empty strings should match", + }, + { + name: "one empty", + s: "hello", + t: "", + expected: false, + reason: "different length strings should not match", + }, + { + name: "other empty", + s: "", + t: "hello", + expected: false, + reason: "different length strings should not match", + }, + + // Different content tests + { + name: "different strings same case", + s: "hello", + t: "world", + expected: false, + reason: "different content should not match", + }, + { + name: "different strings different case", + s: "Hello", + t: "World", + expected: false, + reason: "different content should not match regardless of case", + }, + { + name: "different length", + s: "hello", + t: "hello world", + expected: false, + reason: "different length strings should not match", + }, + + // ASCII non-alphabetic characters + { + name: "numbers and symbols", + s: "Hello123!@#", + t: "hello123!@#", + expected: true, + reason: "numbers and symbols should be preserved, only letters folded", + }, + { + name: "different numbers", + s: "Hello123", + t: "Hello124", + expected: false, + reason: "different numbers should not match", + }, + { + name: "different symbols", + s: "Hello!", + t: "Hello?", + expected: false, + reason: "different symbols should not match", + }, + + // URL-specific tests (CORS security focus) + { + name: "HTTP scheme case", + s: "HTTP://example.com", + t: "http://example.com", + expected: true, + reason: "HTTP scheme should be case-insensitive", + }, + { + name: "HTTPS scheme case", + s: "HTTPS://EXAMPLE.COM", + t: "https://example.com", + expected: true, + reason: "HTTPS scheme and domain should be case-insensitive", + }, + { + name: "complex URL case", + s: "HTTPS://API.EXAMPLE.COM:8080/PATH", + t: "https://api.example.com:8080/path", + expected: true, + reason: "entire URL should be case-insensitive for ASCII", + }, + { + name: "subdomain case", + s: "https://API.SUB.EXAMPLE.COM", + t: "https://api.sub.example.com", + expected: true, + reason: "subdomains should be case-insensitive", + }, + + // Unicode security tests (homograph attack prevention) + { + name: "cyrillic homograph attack", + s: "https://еxample.com", // Cyrillic 'е' (U+0435) + t: "https://example.com", // Latin 'e' (U+0065) + expected: false, + reason: "should block Cyrillic homograph attack", + }, + { + name: "mixed cyrillic attack", + s: "https://ехample.com", // Cyrillic 'е' and 'х' + t: "https://example.com", // Latin 'e' and 'x' + expected: false, + reason: "should block mixed Cyrillic homograph attack", + }, + { + name: "cyrillic 'а' attack", + s: "https://exаmple.com", // Cyrillic 'а' (U+0430) + t: "https://example.com", // Latin 'a' (U+0061) + expected: false, + reason: "should block Cyrillic 'а' homograph attack", + }, + + // Unicode case folding security tests + { + name: "unicode case folding attack", + s: "https://CAFÉ.com", // Latin É (U+00C9) + t: "https://café.com", // Latin é (U+00E9) + expected: false, + reason: "should NOT perform Unicode case folding (security)", + }, + { + name: "turkish i attack", + s: "https://İSTANBUL.com", // Turkish İ (U+0130) + t: "https://istanbul.com", // Latin i + expected: false, + reason: "should NOT perform Turkish case folding", + }, + { + name: "german sharp s", + s: "https://GROß.com", // German ß (U+00DF) + t: "https://gross.com", // Expanded form + expected: false, + reason: "should NOT perform German ß expansion", + }, + + // Valid Unicode exact matches + { + name: "identical unicode", + s: "https://café.com", + t: "https://café.com", + expected: true, + reason: "identical Unicode strings should match", + }, + { + name: "identical cyrillic", + s: "https://пример.com", // Russian + t: "https://пример.com", // Russian + expected: true, + reason: "identical Cyrillic strings should match", + }, + { + name: "ascii part of unicode domain", + s: "HTTPS://café.COM", // ASCII parts should fold + t: "https://café.com", + expected: true, + reason: "ASCII parts should fold even in Unicode strings", + }, + + // Edge cases with UTF-8 + { + name: "different UTF-8 byte length same rune count", + s: "Café", // é is 2 bytes + t: "Café", // é is 2 bytes (same) + expected: true, + reason: "same Unicode content should match", + }, + { + name: "UTF-8 normalization difference", + s: "café\u0301", // é as e + combining acute (3 bytes for é part) + t: "café", // é as single character (2 bytes for é part) + expected: false, + reason: "different Unicode normalization should not match", + }, + { + name: "CRITICAL: current implementation flaw", + s: "ABC" + string([]byte{0xC3, 0xA9}), // ABC + é (2 bytes) = 5 bytes + t: "abc" + string([]byte{0xC3, 0xA9}), // abc + é (2 bytes) = 5 bytes + expected: true, + reason: "should match after ASCII folding (this should pass with correct implementation)", + }, + { + name: "invalid UTF-8 sequence", + s: "hello\xff", // Invalid UTF-8 + t: "hello\xff", // Invalid UTF-8 + expected: true, + reason: "identical invalid UTF-8 should match", + }, + { + name: "different invalid UTF-8", + s: "hello\xff", // Invalid UTF-8 + t: "hello\xfe", // Different invalid UTF-8 + expected: false, + reason: "different invalid UTF-8 should not match", + }, + + // ASCII boundary tests + { + name: "ascii boundary characters", + s: "A@Z[`a{z", // Test boundaries around A-Z + t: "a@z[`A{Z", + expected: true, + reason: "only A-Z should be folded, not punctuation", + }, + { + name: "digit boundaries", + s: "Test123ABC", + t: "test123abc", + expected: true, + reason: "digits should not be folded, only letters", + }, + + // Long string performance tests + { + name: "long ascii string", + s: "HTTP://" + repeatString("ABCDEFGHIJKLMNOPQRSTUVWXYZ", 100) + ".COM", + t: "http://" + repeatString("abcdefghijklmnopqrstuvwxyz", 100) + ".com", + expected: true, + reason: "long ASCII strings should be handled efficiently", + }, + { + name: "long unicode string", + s: repeatString("CAFÉ", 100), + t: repeatString("CAFÉ", 100), // Same case - should match + expected: true, + reason: "long identical Unicode strings should match", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + result := ASCIIEqualFold(tt.s, tt.t) + if result != tt.expected { + t.Errorf("ASCIIEqualFold(%q, %q) = %v, expected %v\nReason: %s", + tt.s, tt.t, result, tt.expected, tt.reason) + } + }) + } +} + +// Helper function for generating long test strings +func repeatString(s string, count int) string { + if count <= 0 { + return "" + } + result := make([]byte, 0, len(s)*count) + for i := 0; i < count; i++ { + result = append(result, s...) + } + return string(result) +} + +// Benchmark tests for performance verification +func BenchmarkASCIIEqualFold(b *testing.B) { + benchmarks := []struct { + name string + s string + t string + }{ + { + name: "short_ascii_match", + s: "HTTP://EXAMPLE.COM", + t: "http://example.com", + }, + { + name: "short_ascii_nomatch", + s: "HTTP://EXAMPLE.COM", + t: "http://different.com", + }, + { + name: "long_ascii_match", + s: "HTTP://" + repeatString("ABCDEFGHIJKLMNOPQRSTUVWXYZ", 100) + ".COM", + t: "http://" + repeatString("abcdefghijklmnopqrstuvwxyz", 100) + ".com", + }, + { + name: "unicode_nomatch", + s: "https://café.com", + t: "https://CAFÉ.com", + }, + { + name: "unicode_exact_match", + s: "https://café.com", + t: "https://café.com", + }, + } + + for _, bm := range benchmarks { + b.Run(bm.name, func(b *testing.B) { + for i := 0; i < b.N; i++ { + ASCIIEqualFold(bm.s, bm.t) + } + }) + } +} + +// Fuzzing test to catch edge cases +func FuzzASCIIEqualFold(f *testing.F) { + // Seed with interesting test cases + seeds := [][]string{ + {"hello", "HELLO"}, + {"", ""}, + {"café", "CAFÉ"}, + {"https://example.com", "HTTPS://EXAMPLE.COM"}, + {"еxample", "example"}, // Cyrillic attack + {string([]byte{0xff}), string([]byte{0xfe})}, // Invalid UTF-8 + } + + for _, seed := range seeds { + f.Add(seed[0], seed[1]) + } + + f.Fuzz(func(t *testing.T, s1, s2 string) { + // Just ensure it doesn't panic and returns a boolean + result := ASCIIEqualFold(s1, s2) + _ = result // Use the result to prevent optimization + + // Property: function should be symmetric + if ASCIIEqualFold(s1, s2) != ASCIIEqualFold(s2, s1) { + t.Errorf("ASCIIEqualFold is not symmetric: (%q, %q)", s1, s2) + } + + // Property: identical strings should always match + if s1 == s2 && !ASCIIEqualFold(s1, s2) { + t.Errorf("identical strings should match: %q", s1) + } + }) +} diff --git a/vendor/github.com/go-openapi/jsonpointer/.golangci.yml b/vendor/github.com/go-openapi/jsonpointer/.golangci.yml index d2fafb8a..50063062 100644 --- a/vendor/github.com/go-openapi/jsonpointer/.golangci.yml +++ b/vendor/github.com/go-openapi/jsonpointer/.golangci.yml @@ -1,56 +1,62 @@ -linters-settings: - gocyclo: - min-complexity: 45 - dupl: - threshold: 200 - goconst: - min-len: 2 - min-occurrences: 3 - +version: "2" linters: - enable-all: true + default: all disable: - - recvcheck - - unparam - - lll - - gochecknoinits - - gochecknoglobals - - funlen - - godox - - gocognit - - whitespace - - wsl - - wrapcheck - - testpackage - - nlreturn - - errorlint - - nestif - - godot - - gofumpt - - paralleltest - - tparallel - - thelper - - exhaustruct - - varnamelen - - gci + - cyclop - depguard - errchkjson - - inamedparam - - nonamedreturns - - musttag - - ireturn + - errorlint + - exhaustruct - forcetypeassert - - cyclop - # deprecated linters - #- deadcode - #- interfacer - #- scopelint - #- varcheck - #- structcheck - #- golint - #- nosnakecase - #- maligned - #- goerr113 - #- ifshort - #- gomnd - #- exhaustivestruct + - funlen + - gochecknoglobals + - gochecknoinits + - gocognit + - godot + - godox + - gosmopolitan + - inamedparam + - ireturn + - lll + - musttag + - nestif + - nlreturn + - nonamedreturns + - paralleltest + - testpackage + - thelper + - tparallel + - unparam + - varnamelen + - whitespace + - wrapcheck + - wsl + settings: + dupl: + threshold: 200 + goconst: + min-len: 2 + min-occurrences: 3 + gocyclo: + min-complexity: 45 + exclusions: + generated: lax + presets: + - comments + - common-false-positives + - legacy + - std-error-handling + paths: + - third_party$ + - builtin$ + - examples$ +formatters: + enable: + - gofmt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer.go b/vendor/github.com/go-openapi/jsonpointer/pointer.go index a08cd68a..61362105 100644 --- a/vendor/github.com/go-openapi/jsonpointer/pointer.go +++ b/vendor/github.com/go-openapi/jsonpointer/pointer.go @@ -179,6 +179,11 @@ func getSingleImpl(node any, decodedToken string, nameProvider *swag.NameProvide func setSingleImpl(node, data any, decodedToken string, nameProvider *swag.NameProvider) error { rValue := reflect.Indirect(reflect.ValueOf(node)) + // Check for nil to prevent panic when calling rValue.Type() + if isNil(node) { + return fmt.Errorf("cannot set field %q on nil value: %w", decodedToken, ErrPointer) + } + if ns, ok := node.(JSONSetable); ok { // pointer impl return ns.JSONSet(decodedToken, data) } @@ -285,6 +290,11 @@ func (p *Pointer) set(node, data any, nameProvider *swag.NameProvider) error { return setSingleImpl(node, data, decodedToken, nameProvider) } + // Check for nil during traversal + if isNil(node) { + return fmt.Errorf("cannot traverse through nil value at %q: %w", decodedToken, ErrPointer) + } + rValue := reflect.Indirect(reflect.ValueOf(node)) kind := rValue.Kind() diff --git a/vendor/github.com/mattn/go-sqlite3/README.md b/vendor/github.com/mattn/go-sqlite3/README.md index 3b43b033..76f49bac 100644 --- a/vendor/github.com/mattn/go-sqlite3/README.md +++ b/vendor/github.com/mattn/go-sqlite3/README.md @@ -351,6 +351,8 @@ For example the TDM-GCC Toolchain can be found [here](https://jmeubank.github.io # User Authentication +***This is deprecated*** + This package supports the SQLite User Authentication module. ## Compile diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c b/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c index e9cca66c..44d91d9d 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c @@ -1,7 +1,7 @@ #ifndef USE_LIBSQLITE3 /****************************************************************************** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.49.1. By combining all the individual C code files into this +** version 3.50.3. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -19,7 +19,7 @@ ** separate file. This file contains only code for the core SQLite library. ** ** The content in this amalgamation comes from Fossil check-in -** 873d4e274b4988d260ba8354a9718324a1c2 with changes in files: +** 3ce993b8657d6d9deda380a93cdd6404a8c8 with changes in files: ** ** */ @@ -453,7 +453,7 @@ extern "C" { ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -466,9 +466,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.49.1" -#define SQLITE_VERSION_NUMBER 3049001 -#define SQLITE_SOURCE_ID "2025-02-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +#define SQLITE_VERSION "3.50.3" +#define SQLITE_VERSION_NUMBER 3050003 +#define SQLITE_SOURCE_ID "2025-07-17 13:25:10 3ce993b8657d6d9deda380a93cdd6404a8c8ba1b185b2bc423703e41ae5f2543" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -1483,6 +1483,12 @@ struct sqlite3_io_methods { ** the value that M is to be set to. Before returning, the 32-bit signed ** integer is overwritten with the previous value of M. ** +**
  • [[SQLITE_FCNTL_BLOCK_ON_CONNECT]] +** The [SQLITE_FCNTL_BLOCK_ON_CONNECT] opcode is used to configure the +** VFS to block when taking a SHARED lock to connect to a wal mode database. +** This is used to implement the functionality associated with +** SQLITE_SETLK_BLOCK_ON_CONNECT. +** **
  • [[SQLITE_FCNTL_DATA_VERSION]] ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to ** a database file. The argument is a pointer to a 32-bit unsigned integer. @@ -1579,6 +1585,7 @@ struct sqlite3_io_methods { #define SQLITE_FCNTL_CKSM_FILE 41 #define SQLITE_FCNTL_RESET_CACHE 42 #define SQLITE_FCNTL_NULL_IO 43 +#define SQLITE_FCNTL_BLOCK_ON_CONNECT 44 /* deprecated names */ #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE @@ -2309,13 +2316,16 @@ struct sqlite3_mem_methods { ** ** [[SQLITE_CONFIG_LOOKASIDE]]
    SQLITE_CONFIG_LOOKASIDE
    **
    ^(The SQLITE_CONFIG_LOOKASIDE option takes two arguments that determine -** the default size of lookaside memory on each [database connection]. +** the default size of [lookaside memory] on each [database connection]. ** The first argument is the -** size of each lookaside buffer slot and the second is the number of -** slots allocated to each database connection.)^ ^(SQLITE_CONFIG_LOOKASIDE -** sets the default lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE] -** option to [sqlite3_db_config()] can be used to change the lookaside -** configuration on individual connections.)^
    +** size of each lookaside buffer slot ("sz") and the second is the number of +** slots allocated to each database connection ("cnt").)^ +** ^(SQLITE_CONFIG_LOOKASIDE sets the default lookaside size. +** The [SQLITE_DBCONFIG_LOOKASIDE] option to [sqlite3_db_config()] can +** be used to change the lookaside configuration on individual connections.)^ +** The [-DSQLITE_DEFAULT_LOOKASIDE] option can be used to change the +** default lookaside configuration at compile-time. +** ** ** [[SQLITE_CONFIG_PCACHE2]]
    SQLITE_CONFIG_PCACHE2
    **
    ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is @@ -2552,31 +2562,50 @@ struct sqlite3_mem_methods { ** [[SQLITE_DBCONFIG_LOOKASIDE]] **
    SQLITE_DBCONFIG_LOOKASIDE
    **
    The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the -** configuration of the lookaside memory allocator within a database +** configuration of the [lookaside memory allocator] within a database ** connection. ** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are not ** in the [DBCONFIG arguments|usual format]. ** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two, ** so that a call to [sqlite3_db_config()] that uses SQLITE_DBCONFIG_LOOKASIDE ** should have a total of five parameters. -** ^The first argument (the third parameter to [sqlite3_db_config()] is a +**
      +**
    1. The first argument ("buf") is a ** pointer to a memory buffer to use for lookaside memory. -** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb -** may be NULL in which case SQLite will allocate the -** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the -** size of each lookaside buffer slot. ^The third argument is the number of -** slots. The size of the buffer in the first argument must be greater than -** or equal to the product of the second and third arguments. The buffer -** must be aligned to an 8-byte boundary. ^If the second argument to -** SQLITE_DBCONFIG_LOOKASIDE is not a multiple of 8, it is internally -** rounded down to the next smaller multiple of 8. ^(The lookaside memory +** The first argument may be NULL in which case SQLite will allocate the +** lookaside buffer itself using [sqlite3_malloc()]. +**

    2. The second argument ("sz") is the +** size of each lookaside buffer slot. Lookaside is disabled if "sz" +** is less than 8. The "sz" argument should be a multiple of 8 less than +** 65536. If "sz" does not meet this constraint, it is reduced in size until +** it does. +**

    3. The third argument ("cnt") is the number of slots. Lookaside is disabled +** if "cnt"is less than 1. The "cnt" value will be reduced, if necessary, so +** that the product of "sz" and "cnt" does not exceed 2,147,418,112. The "cnt" +** parameter is usually chosen so that the product of "sz" and "cnt" is less +** than 1,000,000. +**

    +**

    If the "buf" argument is not NULL, then it must +** point to a memory buffer with a size that is greater than +** or equal to the product of "sz" and "cnt". +** The buffer must be aligned to an 8-byte boundary. +** The lookaside memory ** configuration for a database connection can only be changed when that ** connection is not currently using lookaside memory, or in other words -** when the "current value" returned by -** [sqlite3_db_status](D,[SQLITE_DBSTATUS_LOOKASIDE_USED],...) is zero. +** when the value returned by [SQLITE_DBSTATUS_LOOKASIDE_USED] is zero. ** Any attempt to change the lookaside memory configuration when lookaside ** memory is in use leaves the configuration unchanged and returns -** [SQLITE_BUSY].)^

    +** [SQLITE_BUSY]. +** If the "buf" argument is NULL and an attempt +** to allocate memory based on "sz" and "cnt" fails, then +** lookaside is silently disabled. +**

    +** The [SQLITE_CONFIG_LOOKASIDE] configuration option can be used to set the +** default lookaside configuration at initialization. The +** [-DSQLITE_DEFAULT_LOOKASIDE] option can be used to set the default lookaside +** configuration at compile-time. Typical values for lookaside are 1200 for +** "sz" and 40 to 100 for "cnt". +** ** ** [[SQLITE_DBCONFIG_ENABLE_FKEY]] **

    SQLITE_DBCONFIG_ENABLE_FKEY
    @@ -3313,6 +3342,44 @@ SQLITE_API int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*); */ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); +/* +** CAPI3REF: Set the Setlk Timeout +** METHOD: sqlite3 +** +** This routine is only useful in SQLITE_ENABLE_SETLK_TIMEOUT builds. If +** the VFS supports blocking locks, it sets the timeout in ms used by +** eligible locks taken on wal mode databases by the specified database +** handle. In non-SQLITE_ENABLE_SETLK_TIMEOUT builds, or if the VFS does +** not support blocking locks, this function is a no-op. +** +** Passing 0 to this function disables blocking locks altogether. Passing +** -1 to this function requests that the VFS blocks for a long time - +** indefinitely if possible. The results of passing any other negative value +** are undefined. +** +** Internally, each SQLite database handle store two timeout values - the +** busy-timeout (used for rollback mode databases, or if the VFS does not +** support blocking locks) and the setlk-timeout (used for blocking locks +** on wal-mode databases). The sqlite3_busy_timeout() method sets both +** values, this function sets only the setlk-timeout value. Therefore, +** to configure separate busy-timeout and setlk-timeout values for a single +** database handle, call sqlite3_busy_timeout() followed by this function. +** +** Whenever the number of connections to a wal mode database falls from +** 1 to 0, the last connection takes an exclusive lock on the database, +** then checkpoints and deletes the wal file. While it is doing this, any +** new connection that tries to read from the database fails with an +** SQLITE_BUSY error. Or, if the SQLITE_SETLK_BLOCK_ON_CONNECT flag is +** passed to this API, the new connection blocks until the exclusive lock +** has been released. +*/ +SQLITE_API int sqlite3_setlk_timeout(sqlite3*, int ms, int flags); + +/* +** CAPI3REF: Flags for sqlite3_setlk_timeout() +*/ +#define SQLITE_SETLK_BLOCK_ON_CONNECT 0x01 + /* ** CAPI3REF: Convenience Routines For Running Queries ** METHOD: sqlite3 @@ -4332,7 +4399,7 @@ SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*); ** ** The sqlite3_create_filename(D,J,W,N,P) allocates memory to hold a version of ** database filename D with corresponding journal file J and WAL file W and -** with N URI parameters key/values pairs in the array P. The result from +** an array P of N URI Key/Value pairs. The result from ** sqlite3_create_filename(D,J,W,N,P) is a pointer to a database filename that ** is safe to pass to routines like: **
      @@ -5013,7 +5080,7 @@ typedef struct sqlite3_context sqlite3_context; ** METHOD: sqlite3_stmt ** ** ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants, -** literals may be replaced by a [parameter] that matches one of following +** literals may be replaced by a [parameter] that matches one of the following ** templates: ** **
        @@ -5058,7 +5125,7 @@ typedef struct sqlite3_context sqlite3_context; ** ** [[byte-order determination rules]] ^The byte-order of ** UTF16 input text is determined by the byte-order mark (BOM, U+FEFF) -** found in first character, which is removed, or in the absence of a BOM +** found in the first character, which is removed, or in the absence of a BOM ** the byte order is the native byte order of the host ** machine for sqlite3_bind_text16() or the byte order specified in ** the 6th parameter for sqlite3_bind_text64().)^ @@ -5078,7 +5145,7 @@ typedef struct sqlite3_context sqlite3_context; ** or sqlite3_bind_text16() or sqlite3_bind_text64() then ** that parameter must be the byte offset ** where the NUL terminator would occur assuming the string were NUL -** terminated. If any NUL characters occurs at byte offsets less than +** terminated. If any NUL characters occur at byte offsets less than ** the value of the fourth parameter then the resulting string value will ** contain embedded NULs. The result of expressions involving strings ** with embedded NULs is undefined. @@ -5290,7 +5357,7 @@ SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N); ** METHOD: sqlite3_stmt ** ** ^These routines provide a means to determine the database, table, and -** table column that is the origin of a particular result column in +** table column that is the origin of a particular result column in a ** [SELECT] statement. ** ^The name of the database or table or column can be returned as ** either a UTF-8 or UTF-16 string. ^The _database_ routines return @@ -5428,7 +5495,7 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** other than [SQLITE_ROW] before any subsequent invocation of ** sqlite3_step(). Failure to reset the prepared statement using ** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from -** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], +** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1]), ** sqlite3_step() began ** calling [sqlite3_reset()] automatically in this circumstance rather ** than returning [SQLITE_MISUSE]. This is not considered a compatibility @@ -5859,8 +5926,8 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** ** For best security, the [SQLITE_DIRECTONLY] flag is recommended for ** all application-defined SQL functions that do not need to be -** used inside of triggers, view, CHECK constraints, or other elements of -** the database schema. This flags is especially recommended for SQL +** used inside of triggers, views, CHECK constraints, or other elements of +** the database schema. This flag is especially recommended for SQL ** functions that have side effects or reveal internal application state. ** Without this flag, an attacker might be able to modify the schema of ** a database file to include invocations of the function with parameters @@ -5891,7 +5958,7 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** [user-defined window functions|available here]. ** ** ^(If the final parameter to sqlite3_create_function_v2() or -** sqlite3_create_window_function() is not NULL, then it is destructor for +** sqlite3_create_window_function() is not NULL, then it is the destructor for ** the application data pointer. The destructor is invoked when the function ** is deleted, either by being overloaded or when the database connection ** closes.)^ ^The destructor is also invoked if the call to @@ -6291,7 +6358,7 @@ SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*); ** METHOD: sqlite3_value ** ** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value] -** object D and returns a pointer to that copy. ^The [sqlite3_value] returned +** object V and returns a pointer to that copy. ^The [sqlite3_value] returned ** is a [protected sqlite3_value] object even if the input is not. ** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a ** memory allocation fails. ^If V is a [pointer value], then the result @@ -6329,7 +6396,7 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*); ** allocation error occurs. ** ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is -** determined by the N parameter on first successful call. Changing the +** determined by the N parameter on the first successful call. Changing the ** value of N in any subsequent call to sqlite3_aggregate_context() within ** the same aggregate function instance will not resize the memory ** allocation.)^ Within the xFinal callback, it is customary to set @@ -6491,7 +6558,7 @@ SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(voi ** ** Security Warning: These interfaces should not be exposed in scripting ** languages or in other circumstances where it might be possible for an -** an attacker to invoke them. Any agent that can invoke these interfaces +** attacker to invoke them. Any agent that can invoke these interfaces ** can probably also take control of the process. ** ** Database connection client data is only available for SQLite @@ -6605,7 +6672,7 @@ typedef void (*sqlite3_destructor_type)(void*); ** pointed to by the 2nd parameter are taken as the application-defined ** function result. If the 3rd parameter is non-negative, then it ** must be the byte offset into the string where the NUL terminator would -** appear if the string where NUL terminated. If any NUL characters occur +** appear if the string were NUL terminated. If any NUL characters occur ** in the string at a byte offset that is less than the value of the 3rd ** parameter, then the resulting string will contain embedded NULs and the ** result of expressions operating on strings with embedded NULs is undefined. @@ -6663,7 +6730,7 @@ typedef void (*sqlite3_destructor_type)(void*); ** string and preferably a string literal. The sqlite3_result_pointer() ** routine is part of the [pointer passing interface] added for SQLite 3.20.0. ** -** If these routines are called from within the different thread +** If these routines are called from within a different thread ** than the one containing the application-defined function that received ** the [sqlite3_context] pointer, the results are undefined. */ @@ -7069,7 +7136,7 @@ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); ** METHOD: sqlite3 ** ** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name -** for the N-th database on database connection D, or a NULL pointer of N is +** for the N-th database on database connection D, or a NULL pointer if N is ** out of range. An N value of 0 means the main database file. An N of 1 is ** the "temp" schema. Larger values of N correspond to various ATTACH-ed ** databases. @@ -7164,7 +7231,7 @@ SQLITE_API int sqlite3_txn_state(sqlite3*,const char *zSchema); **
        The SQLITE_TXN_READ state means that the database is currently ** in a read transaction. Content has been read from the database file ** but nothing in the database file has changed. The transaction state -** will advanced to SQLITE_TXN_WRITE if any changes occur and there are +** will be advanced to SQLITE_TXN_WRITE if any changes occur and there are ** no other conflicting concurrent write transactions. The transaction ** state will revert to SQLITE_TXN_NONE following a [ROLLBACK] or ** [COMMIT].
        @@ -7173,7 +7240,7 @@ SQLITE_API int sqlite3_txn_state(sqlite3*,const char *zSchema); **
        The SQLITE_TXN_WRITE state means that the database is currently ** in a write transaction. Content has been written to the database file ** but has not yet committed. The transaction state will change to -** to SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT].
        +** SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT]. */ #define SQLITE_TXN_NONE 0 #define SQLITE_TXN_READ 1 @@ -7324,6 +7391,8 @@ SQLITE_API int sqlite3_autovacuum_pages( ** ** ^The second argument is a pointer to the function to invoke when a ** row is updated, inserted or deleted in a rowid table. +** ^The update hook is disabled by invoking sqlite3_update_hook() +** with a NULL pointer as the second parameter. ** ^The first argument to the callback is a copy of the third argument ** to sqlite3_update_hook(). ** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], @@ -7452,7 +7521,7 @@ SQLITE_API int sqlite3_db_release_memory(sqlite3*); ** CAPI3REF: Impose A Limit On Heap Size ** ** These interfaces impose limits on the amount of heap memory that will be -** by all database connections within a single process. +** used by all database connections within a single process. ** ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the ** soft limit on the amount of heap memory that may be allocated by SQLite. @@ -7510,7 +7579,7 @@ SQLITE_API int sqlite3_db_release_memory(sqlite3*); **
      )^ ** ** The circumstances under which SQLite will enforce the heap limits may -** changes in future releases of SQLite. +** change in future releases of SQLite. */ SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64(sqlite3_int64 N); @@ -7625,8 +7694,8 @@ SQLITE_API int sqlite3_table_column_metadata( ** ^The entry point is zProc. ** ^(zProc may be 0, in which case SQLite will try to come up with an ** entry point name on its own. It first tries "sqlite3_extension_init". -** If that does not work, it constructs a name "sqlite3_X_init" where the -** X is consists of the lower-case equivalent of all ASCII alphabetic +** If that does not work, it constructs a name "sqlite3_X_init" where +** X consists of the lower-case equivalent of all ASCII alphabetic ** characters in the filename from the last "/" to the first following ** "." and omitting any initial "lib".)^ ** ^The sqlite3_load_extension() interface returns @@ -7697,7 +7766,7 @@ SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff); ** ^(Even though the function prototype shows that xEntryPoint() takes ** no arguments and returns void, SQLite invokes xEntryPoint() with three ** arguments and expects an integer result as if the signature of the -** entry point where as follows: +** entry point were as follows: ** **
       **    int xEntryPoint(
      @@ -7861,7 +7930,7 @@ struct sqlite3_module {
       ** virtual table and might not be checked again by the byte code.)^ ^(The
       ** aConstraintUsage[].omit flag is an optimization hint. When the omit flag
       ** is left in its default setting of false, the constraint will always be
      -** checked separately in byte code.  If the omit flag is change to true, then
      +** checked separately in byte code.  If the omit flag is changed to true, then
       ** the constraint may or may not be checked in byte code.  In other words,
       ** when the omit flag is true there is no guarantee that the constraint will
       ** not be checked again using byte code.)^
      @@ -7887,7 +7956,7 @@ struct sqlite3_module {
       ** The xBestIndex method may optionally populate the idxFlags field with a
       ** mask of SQLITE_INDEX_SCAN_* flags. One such flag is
       ** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN]
      -** output to show the idxNum has hex instead of as decimal.  Another flag is
      +** output to show the idxNum as hex instead of as decimal.  Another flag is
       ** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will
       ** return at most one row.
       **
      @@ -8028,7 +8097,7 @@ struct sqlite3_index_info {
       ** the implementation of the [virtual table module].   ^The fourth
       ** parameter is an arbitrary client data pointer that is passed through
       ** into the [xCreate] and [xConnect] methods of the virtual table module
      -** when a new virtual table is be being created or reinitialized.
      +** when a new virtual table is being created or reinitialized.
       **
       ** ^The sqlite3_create_module_v2() interface has a fifth parameter which
       ** is a pointer to a destructor for the pClientData.  ^SQLite will
      @@ -8193,7 +8262,7 @@ typedef struct sqlite3_blob sqlite3_blob;
       ** in *ppBlob. Otherwise an [error code] is returned and, unless the error
       ** code is SQLITE_MISUSE, *ppBlob is set to NULL.)^ ^This means that, provided
       ** the API is not misused, it is always safe to call [sqlite3_blob_close()]
      -** on *ppBlob after this function it returns.
      +** on *ppBlob after this function returns.
       **
       ** This function fails with SQLITE_ERROR if any of the following are true:
       ** 
        @@ -8313,7 +8382,7 @@ SQLITE_API int sqlite3_blob_close(sqlite3_blob *); ** ** ^Returns the size in bytes of the BLOB accessible via the ** successfully opened [BLOB handle] in its only argument. ^The -** incremental blob I/O routines can only read or overwriting existing +** incremental blob I/O routines can only read or overwrite existing ** blob content; they cannot change the size of a blob. ** ** This routine only works on a [BLOB handle] which has been created @@ -8463,7 +8532,7 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); ** ^The sqlite3_mutex_alloc() routine allocates a new ** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc() ** routine returns NULL if it is unable to allocate the requested -** mutex. The argument to sqlite3_mutex_alloc() must one of these +** mutex. The argument to sqlite3_mutex_alloc() must be one of these ** integer constants: ** **
          @@ -8696,7 +8765,7 @@ SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); ** CAPI3REF: Retrieve the mutex for a database connection ** METHOD: sqlite3 ** -** ^This interface returns a pointer the [sqlite3_mutex] object that +** ^This interface returns a pointer to the [sqlite3_mutex] object that ** serializes access to the [database connection] given in the argument ** when the [threading mode] is Serialized. ** ^If the [threading mode] is Single-thread or Multi-thread then this @@ -8819,7 +8888,7 @@ SQLITE_API int sqlite3_test_control(int op, ...); ** CAPI3REF: SQL Keyword Checking ** ** These routines provide access to the set of SQL language keywords -** recognized by SQLite. Applications can uses these routines to determine +** recognized by SQLite. Applications can use these routines to determine ** whether or not a specific identifier needs to be escaped (for example, ** by enclosing in double-quotes) so as not to confuse the parser. ** @@ -8987,7 +9056,7 @@ SQLITE_API void sqlite3_str_reset(sqlite3_str*); ** content of the dynamic string under construction in X. The value ** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X ** and might be freed or altered by any subsequent method on the same -** [sqlite3_str] object. Applications must not used the pointer returned +** [sqlite3_str] object. Applications must not use the pointer returned by ** [sqlite3_str_value(X)] after any subsequent method call on the same ** object. ^Applications may change the content of the string returned ** by [sqlite3_str_value(X)] as long as they do not write into any bytes @@ -9073,7 +9142,7 @@ SQLITE_API int sqlite3_status64( ** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] ** buffer and where forced to overflow to [sqlite3_malloc()]. The ** returned value includes allocations that overflowed because they -** where too large (they were larger than the "sz" parameter to +** were too large (they were larger than the "sz" parameter to ** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because ** no space was left in the page cache.)^ ** @@ -9157,28 +9226,29 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(
          SQLITE_DBSTATUS_LOOKASIDE_HIT
          **
          This parameter returns the number of malloc attempts that were ** satisfied using lookaside memory. Only the high-water value is meaningful; -** the current value is always zero.)^ +** the current value is always zero.
          )^ ** ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE]] ** ^(
          SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE
          -**
          This parameter returns the number malloc attempts that might have +**
          This parameter returns the number of malloc attempts that might have ** been satisfied using lookaside memory but failed due to the amount of ** memory requested being larger than the lookaside slot size. ** Only the high-water value is meaningful; -** the current value is always zero.)^ +** the current value is always zero.
          )^ ** ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL]] ** ^(
          SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL
          -**
          This parameter returns the number malloc attempts that might have +**
          This parameter returns the number of malloc attempts that might have ** been satisfied using lookaside memory but failed due to all lookaside ** memory already being in use. ** Only the high-water value is meaningful; -** the current value is always zero.)^ +** the current value is always zero.
          )^ ** ** [[SQLITE_DBSTATUS_CACHE_USED]] ^(
          SQLITE_DBSTATUS_CACHE_USED
          **
          This parameter returns the approximate number of bytes of heap ** memory used by all pager caches associated with the database connection.)^ ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. +**
          ** ** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] ** ^(
          SQLITE_DBSTATUS_CACHE_USED_SHARED
          @@ -9187,10 +9257,10 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** memory used by that pager cache is divided evenly between the attached ** connections.)^ In other words, if none of the pager caches associated ** with the database connection are shared, this request returns the same -** value as DBSTATUS_CACHE_USED. Or, if one or more or the pager caches are +** value as DBSTATUS_CACHE_USED. Or, if one or more of the pager caches are ** shared, the value returned by this call will be smaller than that returned ** by DBSTATUS_CACHE_USED. ^The highwater mark associated with -** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0. +** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0. ** ** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(
          SQLITE_DBSTATUS_SCHEMA_USED
          **
          This parameter returns the approximate number of bytes of heap @@ -9200,6 +9270,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** schema memory is shared with other database connections due to ** [shared cache mode] being enabled. ** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. +**
          ** ** [[SQLITE_DBSTATUS_STMT_USED]] ^(
          SQLITE_DBSTATUS_STMT_USED
          **
          This parameter returns the approximate number of bytes of heap @@ -9236,7 +9307,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** been written to disk in the middle of a transaction due to the page ** cache overflowing. Transactions are more efficient if they are written ** to disk all at once. When pages spill mid-transaction, that introduces -** additional overhead. This parameter can be used help identify +** additional overhead. This parameter can be used to help identify ** inefficiencies that can be resolved by increasing the cache size. **
          ** @@ -9307,13 +9378,13 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_SORT]]
          SQLITE_STMTSTATUS_SORT
          **
          ^This is the number of sort operations that have occurred. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance through careful use of indices.
          +** improve performance through careful use of indices. ** ** [[SQLITE_STMTSTATUS_AUTOINDEX]]
          SQLITE_STMTSTATUS_AUTOINDEX
          **
          ^This is the number of rows inserted into transient indices that ** were created automatically in order to help joins run faster. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance by adding permanent indices that do not +** improve performance by adding permanent indices that do not ** need to be reinitialized each time the statement is run.
          ** ** [[SQLITE_STMTSTATUS_VM_STEP]]
          SQLITE_STMTSTATUS_VM_STEP
          @@ -9322,19 +9393,19 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** to 2147483647. The number of virtual machine operations can be ** used as a proxy for the total work done by the prepared statement. ** If the number of virtual machine operations exceeds 2147483647 -** then the value returned by this statement status code is undefined. +** then the value returned by this statement status code is undefined. ** ** [[SQLITE_STMTSTATUS_REPREPARE]]
          SQLITE_STMTSTATUS_REPREPARE
          **
          ^This is the number of times that the prepare statement has been ** automatically regenerated due to schema changes or changes to -** [bound parameters] that might affect the query plan. +** [bound parameters] that might affect the query plan.
          ** ** [[SQLITE_STMTSTATUS_RUN]]
          SQLITE_STMTSTATUS_RUN
          **
          ^This is the number of times that the prepared statement has ** been run. A single "run" for the purposes of this counter is one ** or more calls to [sqlite3_step()] followed by a call to [sqlite3_reset()]. ** The counter is incremented on the first [sqlite3_step()] call of each -** cycle. +** cycle.
          ** ** [[SQLITE_STMTSTATUS_FILTER_MISS]] ** [[SQLITE_STMTSTATUS_FILTER HIT]] @@ -9344,7 +9415,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** step was bypassed because a Bloom filter returned not-found. The ** corresponding SQLITE_STMTSTATUS_FILTER_MISS value is the number of ** times that the Bloom filter returned a find, and thus the join step -** had to be processed as normal. +** had to be processed as normal. ** ** [[SQLITE_STMTSTATUS_MEMUSED]]
          SQLITE_STMTSTATUS_MEMUSED
          **
          ^This is the approximate number of bytes of heap memory @@ -9449,9 +9520,9 @@ struct sqlite3_pcache_page { ** SQLite will typically create one cache instance for each open database file, ** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must -** be allocated by the cache. ^szPage will always a power of two. ^The +** be allocated by the cache. ^szPage will always be a power of two. ^The ** second parameter szExtra is a number of bytes of extra storage -** associated with each page cache entry. ^The szExtra parameter will +** associated with each page cache entry. ^The szExtra parameter will be ** a number less than 250. SQLite will use the ** extra szExtra bytes on each page to store metadata about the underlying ** database page on disk. The value passed into szExtra depends @@ -9459,17 +9530,17 @@ struct sqlite3_pcache_page { ** ^The third argument to xCreate(), bPurgeable, is true if the cache being ** created will be used to cache database pages of a file stored on disk, or ** false if it is used for an in-memory database. The cache implementation -** does not have to do anything special based with the value of bPurgeable; +** does not have to do anything special based upon the value of bPurgeable; ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to ** false will always have the "discard" flag set to true. -** ^Hence, a cache created with bPurgeable false will +** ^Hence, a cache created with bPurgeable set to false will ** never contain any unpinned pages. ** ** [[the xCachesize() page cache method]] ** ^(The xCachesize() method may be called at any time by SQLite to set the -** suggested maximum cache-size (number of pages stored by) the cache +** suggested maximum cache-size (number of pages stored) for the cache ** instance passed as the first argument. This is the value configured using ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable ** parameter, the implementation is not required to do anything with this @@ -9496,12 +9567,12 @@ struct sqlite3_pcache_page { ** implementation must return a pointer to the page buffer with its content ** intact. If the requested page is not already in the cache, then the ** cache implementation should use the value of the createFlag -** parameter to help it determined what action to take: +** parameter to help it determine what action to take: ** ** **
          createFlag Behavior when page is not already in cache **
          0 Do not allocate a new page. Return NULL. -**
          1 Allocate a new page if it easy and convenient to do so. +**
          1 Allocate a new page if it is easy and convenient to do so. ** Otherwise return NULL. **
          2 Make every effort to allocate a new page. Only return ** NULL if allocating a new page is effectively impossible. @@ -9518,7 +9589,7 @@ struct sqlite3_pcache_page { ** as its second argument. If the third parameter, discard, is non-zero, ** then the page must be evicted from the cache. ** ^If the discard parameter is -** zero, then the page may be discarded or retained at the discretion of +** zero, then the page may be discarded or retained at the discretion of the ** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** @@ -9536,7 +9607,7 @@ struct sqlite3_pcache_page { ** When SQLite calls the xTruncate() method, the cache must discard all ** existing cache entries with page numbers (keys) greater than or equal ** to the value of the iLimit parameter passed to xTruncate(). If any -** of these pages are pinned, they are implicitly unpinned, meaning that +** of these pages are pinned, they become implicitly unpinned, meaning that ** they can be safely discarded. ** ** [[the xDestroy() page cache method]] @@ -9716,7 +9787,7 @@ typedef struct sqlite3_backup sqlite3_backup; ** external process or via a database connection other than the one being ** used by the backup operation, then the backup will be automatically ** restarted by the next call to sqlite3_backup_step(). ^If the source -** database is modified by the using the same database connection as is used +** database is modified by using the same database connection as is used ** by the backup operation, then the backup database is automatically ** updated at the same time. ** @@ -9733,7 +9804,7 @@ typedef struct sqlite3_backup sqlite3_backup; ** and may not be used following a call to sqlite3_backup_finish(). ** ** ^The value returned by sqlite3_backup_finish is [SQLITE_OK] if no -** sqlite3_backup_step() errors occurred, regardless or whether or not +** sqlite3_backup_step() errors occurred, regardless of whether or not ** sqlite3_backup_step() completed. ** ^If an out-of-memory condition or IO error occurred during any prior ** sqlite3_backup_step() call on the same [sqlite3_backup] object, then @@ -9835,7 +9906,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** application receives an SQLITE_LOCKED error, it may call the ** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked -** when the blocking connections current transaction is concluded. ^The +** when the blocking connection's current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] ** call that concludes the blocking connection's transaction. ** @@ -9855,7 +9926,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** blocked connection already has a registered unlock-notify callback, ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is canceled. ^The blocked connections +** unlock-notify callback is canceled. ^The blocked connection's ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -10253,7 +10324,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** support constraints. In this configuration (which is the default) if ** a call to the [xUpdate] method returns [SQLITE_CONSTRAINT], then the entire ** statement is rolled back as if [ON CONFLICT | OR ABORT] had been -** specified as part of the users SQL statement, regardless of the actual +** specified as part of the user's SQL statement, regardless of the actual ** ON CONFLICT mode specified. ** ** If X is non-zero, then the virtual table implementation guarantees @@ -10287,7 +10358,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** [[SQLITE_VTAB_INNOCUOUS]]
          SQLITE_VTAB_INNOCUOUS
          **
          Calls of the form ** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the -** the [xConnect] or [xCreate] methods of a [virtual table] implementation +** [xConnect] or [xCreate] methods of a [virtual table] implementation ** identify that virtual table as being safe to use from within triggers ** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the ** virtual table can do no serious harm even if it is controlled by a @@ -10455,7 +10526,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); **
          ** ** ^For the purposes of comparing virtual table output values to see if the -** values are same value for sorting purposes, two NULL values are considered +** values are the same value for sorting purposes, two NULL values are considered ** to be the same. In other words, the comparison operator is "IS" ** (or "IS NOT DISTINCT FROM") and not "==". ** @@ -10465,7 +10536,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); ** ** ^A virtual table implementation is always free to return rows in any order ** it wants, as long as the "orderByConsumed" flag is not set. ^When the -** the "orderByConsumed" flag is unset, the query planner will add extra +** "orderByConsumed" flag is unset, the query planner will add extra ** [bytecode] to ensure that the final results returned by the SQL query are ** ordered correctly. The use of the "orderByConsumed" flag and the ** sqlite3_vtab_distinct() interface is merely an optimization. ^Careful @@ -10562,7 +10633,7 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle); ** sqlite3_vtab_in_next(X,P) should be one of the parameters to the ** xFilter method which invokes these routines, and specifically ** a parameter that was previously selected for all-at-once IN constraint -** processing use the [sqlite3_vtab_in()] interface in the +** processing using the [sqlite3_vtab_in()] interface in the ** [xBestIndex|xBestIndex method]. ^(If the X parameter is not ** an xFilter argument that was selected for all-at-once IN constraint ** processing, then these routines return [SQLITE_ERROR].)^ @@ -10617,7 +10688,7 @@ SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value **ppOut); ** and only if *V is set to a value. ^The sqlite3_vtab_rhs_value(P,J,V) ** inteface returns SQLITE_NOTFOUND if the right-hand side of the J-th ** constraint is not available. ^The sqlite3_vtab_rhs_value() interface -** can return an result code other than SQLITE_OK or SQLITE_NOTFOUND if +** can return a result code other than SQLITE_OK or SQLITE_NOTFOUND if ** something goes wrong. ** ** The sqlite3_vtab_rhs_value() interface is usually only successful if @@ -10645,8 +10716,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** KEYWORDS: {conflict resolution mode} ** ** These constants are returned by [sqlite3_vtab_on_conflict()] to -** inform a [virtual table] implementation what the [ON CONFLICT] mode -** is for the SQL statement being evaluated. +** inform a [virtual table] implementation of the [ON CONFLICT] mode +** for the SQL statement being evaluated. ** ** Note that the [SQLITE_IGNORE] constant is also used as a potential ** return value from the [sqlite3_set_authorizer()] callback and that @@ -10686,39 +10757,39 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** [[SQLITE_SCANSTAT_EST]]
          SQLITE_SCANSTAT_EST
          **
          ^The "double" variable pointed to by the V parameter will be set to the ** query planner's estimate for the average number of rows output from each -** iteration of the X-th loop. If the query planner's estimates was accurate, +** iteration of the X-th loop. If the query planner's estimate was accurate, ** then this value will approximate the quotient NVISIT/NLOOP and the ** product of this value for all prior loops with the same SELECTID will -** be the NLOOP value for the current loop. +** be the NLOOP value for the current loop.
          ** ** [[SQLITE_SCANSTAT_NAME]]
          SQLITE_SCANSTAT_NAME
          **
          ^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the name of the index or table -** used for the X-th loop. +** used for the X-th loop.
          ** ** [[SQLITE_SCANSTAT_EXPLAIN]]
          SQLITE_SCANSTAT_EXPLAIN
          **
          ^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN] -** description for the X-th loop. +** description for the X-th loop.
          ** ** [[SQLITE_SCANSTAT_SELECTID]]
          SQLITE_SCANSTAT_SELECTID
          **
          ^The "int" variable pointed to by the V parameter will be set to the ** id for the X-th query plan element. The id value is unique within the ** statement. The select-id is the same value as is output in the first -** column of an [EXPLAIN QUERY PLAN] query. +** column of an [EXPLAIN QUERY PLAN] query.
          ** ** [[SQLITE_SCANSTAT_PARENTID]]
          SQLITE_SCANSTAT_PARENTID
          **
          The "int" variable pointed to by the V parameter will be set to the -** the id of the parent of the current query element, if applicable, or +** id of the parent of the current query element, if applicable, or ** to zero if the query element has no parent. This is the same value as -** returned in the second column of an [EXPLAIN QUERY PLAN] query. +** returned in the second column of an [EXPLAIN QUERY PLAN] query.
          ** ** [[SQLITE_SCANSTAT_NCYCLE]]
          SQLITE_SCANSTAT_NCYCLE
          **
          The sqlite3_int64 output value is set to the number of cycles, ** according to the processor time-stamp counter, that elapsed while the ** query element was being processed. This value is not available for ** all query elements - if it is unavailable the output variable is -** set to -1. +** set to -1.
          ** */ #define SQLITE_SCANSTAT_NLOOP 0 @@ -10759,8 +10830,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** sqlite3_stmt_scanstatus_v2() with a zeroed flags parameter. ** ** Parameter "idx" identifies the specific query element to retrieve statistics -** for. Query elements are numbered starting from zero. A value of -1 may be -** to query for statistics regarding the entire query. ^If idx is out of range +** for. Query elements are numbered starting from zero. A value of -1 may +** retrieve statistics for the entire query. ^If idx is out of range ** - less than -1 or greater than or equal to the total number of query ** elements used to implement the statement - a non-zero value is returned and ** the variable that pOut points to is unchanged. @@ -10803,7 +10874,7 @@ SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); ** METHOD: sqlite3 ** ** ^If a write-transaction is open on [database connection] D when the -** [sqlite3_db_cacheflush(D)] interface invoked, any dirty +** [sqlite3_db_cacheflush(D)] interface is invoked, any dirty ** pages in the pager-cache that are not currently in use are written out ** to disk. A dirty page may be in use if a database cursor created by an ** active SQL statement is reading from it, or if it is page 1 of a database @@ -10917,8 +10988,8 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); ** triggers; and so forth. ** ** When the [sqlite3_blob_write()] API is used to update a blob column, -** the pre-update hook is invoked with SQLITE_DELETE. This is because the -** in this case the new values are not available. In this case, when a +** the pre-update hook is invoked with SQLITE_DELETE, because +** the new values are not yet available. In this case, when a ** callback made with op==SQLITE_DELETE is actually a write using the ** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns ** the index of the column being written. In other cases, where the @@ -11171,7 +11242,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** For an ordinary on-disk database file, the serialization is just a ** copy of the disk file. For an in-memory database or a "TEMP" database, ** the serialization is the same sequence of bytes which would be written -** to disk if that database where backed up to disk. +** to disk if that database were backed up to disk. ** ** The usual case is that sqlite3_serialize() copies the serialization of ** the database into memory obtained from [sqlite3_malloc64()] and returns @@ -11180,7 +11251,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations ** are made, and the sqlite3_serialize() function will return a pointer ** to the contiguous memory representation of the database that SQLite -** is currently using for that database, or NULL if the no such contiguous +** is currently using for that database, or NULL if no such contiguous ** memory representation of the database exists. A contiguous memory ** representation of the database will usually only exist if there has ** been a prior call to [sqlite3_deserialize(D,S,...)] with the same @@ -11251,7 +11322,7 @@ SQLITE_API unsigned char *sqlite3_serialize( ** database is currently in a read transaction or is involved in a backup ** operation. ** -** It is not possible to deserialized into the TEMP database. If the +** It is not possible to deserialize into the TEMP database. If the ** S argument to sqlite3_deserialize(D,S,P,N,M,F) is "temp" then the ** function returns SQLITE_ERROR. ** @@ -11273,7 +11344,7 @@ SQLITE_API int sqlite3_deserialize( sqlite3 *db, /* The database connection */ const char *zSchema, /* Which DB to reopen with the deserialization */ unsigned char *pData, /* The serialized database content */ - sqlite3_int64 szDb, /* Number bytes in the deserialization */ + sqlite3_int64 szDb, /* Number of bytes in the deserialization */ sqlite3_int64 szBuf, /* Total size of buffer pData[] */ unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */ ); @@ -11281,7 +11352,7 @@ SQLITE_API int sqlite3_deserialize( /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -11806,9 +11877,10 @@ SQLITE_API void sqlite3session_table_filter( ** is inserted while a session object is enabled, then later deleted while ** the same session object is disabled, no INSERT record will appear in the ** changeset, even though the delete took place while the session was disabled. -** Or, if one field of a row is updated while a session is disabled, and -** another field of the same row is updated while the session is enabled, the -** resulting changeset will contain an UPDATE change that updates both fields. +** Or, if one field of a row is updated while a session is enabled, and +** then another field of the same row is updated while the session is disabled, +** the resulting changeset will contain an UPDATE change that updates both +** fields. */ SQLITE_API int sqlite3session_changeset( sqlite3_session *pSession, /* Session object */ @@ -11880,8 +11952,9 @@ SQLITE_API sqlite3_int64 sqlite3session_changeset_size(sqlite3_session *pSession ** database zFrom the contents of the two compatible tables would be ** identical. ** -** It an error if database zFrom does not exist or does not contain the -** required compatible table. +** Unless the call to this function is a no-op as described above, it is an +** error if database zFrom does not exist or does not contain the required +** compatible table. ** ** If the operation is successful, SQLITE_OK is returned. Otherwise, an SQLite ** error code. In this case, if argument pzErrMsg is not NULL, *pzErrMsg @@ -12016,7 +12089,7 @@ SQLITE_API int sqlite3changeset_start_v2( ** The following flags may passed via the 4th parameter to ** [sqlite3changeset_start_v2] and [sqlite3changeset_start_v2_strm]: ** -**
          SQLITE_CHANGESETAPPLY_INVERT
          +**
          SQLITE_CHANGESETSTART_INVERT
          ** Invert the changeset while iterating through it. This is equivalent to ** inverting a changeset using sqlite3changeset_invert() before applying it. ** It is an error to specify this flag with a patchset. @@ -12331,19 +12404,6 @@ SQLITE_API int sqlite3changeset_concat( void **ppOut /* OUT: Buffer containing output changeset */ ); - -/* -** CAPI3REF: Upgrade the Schema of a Changeset/Patchset -*/ -SQLITE_API int sqlite3changeset_upgrade( - sqlite3 *db, - const char *zDb, - int nIn, const void *pIn, /* Input changeset */ - int *pnOut, void **ppOut /* OUT: Inverse of input */ -); - - - /* ** CAPI3REF: Changegroup Handle ** @@ -14091,14 +14151,22 @@ struct fts5_api { ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ -#ifndef SQLITE_MAX_COLUMN +#if !defined(SQLITE_MAX_COLUMN) # define SQLITE_MAX_COLUMN 2000 +#elif SQLITE_MAX_COLUMN>32767 +# error SQLITE_MAX_COLUMN may not exceed 32767 #endif /* @@ -14750,6 +14818,7 @@ struct HashElem { HashElem *next, *prev; /* Next and previous elements in the table */ void *data; /* Data associated with this element */ const char *pKey; /* Key associated with this element */ + unsigned int h; /* hash for pKey */ }; /* @@ -15110,7 +15179,17 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash*); ** ourselves. */ #ifndef offsetof -#define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD)) +#define offsetof(STRUCTURE,FIELD) ((size_t)((char*)&((STRUCTURE*)0)->FIELD)) +#endif + +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. +*/ +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define FLEXARRAY +#else +# define FLEXARRAY 1 #endif /* @@ -15188,6 +15267,11 @@ typedef INT16_TYPE i16; /* 2-byte signed integer */ typedef UINT8_TYPE u8; /* 1-byte unsigned integer */ typedef INT8_TYPE i8; /* 1-byte signed integer */ +/* A bitfield type for use inside of structures. Always follow with :N where +** N is the number of bits. +*/ +typedef unsigned bft; /* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -15356,6 +15440,14 @@ typedef INT16_TYPE LogEst; #define LARGEST_UINT64 (0xffffffff|(((u64)0xffffffff)<<32)) #define SMALLEST_INT64 (((i64)-1) - LARGEST_INT64) +/* +** Macro SMXV(n) return the maximum value that can be held in variable n, +** assuming n is a signed integer type. UMXV(n) is similar for unsigned +** integer types. +*/ +#define SMXV(n) ((((i64)1)<<(sizeof(n)*8-1))-1) +#define UMXV(n) ((((i64)1)<<(sizeof(n)*8))-1) + /* ** Round up a number to the next larger multiple of 8. This is used ** to force 8-byte alignment on 64-bit architectures. @@ -17332,8 +17424,8 @@ SQLITE_PRIVATE int sqlite3NotPureFunc(sqlite3_context*); SQLITE_PRIVATE int sqlite3VdbeBytecodeVtabInit(sqlite3*); #endif -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. +/* Use SQLITE_ENABLE_EXPLAIN_COMMENTS to enable generation of extra +** comments on each VDBE opcode. ** ** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op ** comments in VDBE programs that show key decision points in the code @@ -18056,6 +18148,10 @@ struct sqlite3 { Savepoint *pSavepoint; /* List of active savepoints */ int nAnalysisLimit; /* Number of index rows to ANALYZE */ int busyTimeout; /* Busy handler timeout, in msec */ +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + int setlkTimeout; /* Blocking lock timeout, in msec. -1 -> inf. */ + int setlkFlags; /* Flags passed to setlk_timeout() */ +#endif int nSavepoint; /* Number of non-transaction savepoints */ int nStatement; /* Number of nested statement-transactions */ i64 nDeferredCons; /* Net deferred constraints this transaction. */ @@ -18610,6 +18706,7 @@ struct CollSeq { #define SQLITE_AFF_INTEGER 0x44 /* 'D' */ #define SQLITE_AFF_REAL 0x45 /* 'E' */ #define SQLITE_AFF_FLEXNUM 0x46 /* 'F' */ +#define SQLITE_AFF_DEFER 0x58 /* 'X' - defer computation until later */ #define sqlite3IsNumericAffinity(X) ((X)>=SQLITE_AFF_NUMERIC) @@ -18734,6 +18831,7 @@ struct Table { } u; Trigger *pTrigger; /* List of triggers on this object */ Schema *pSchema; /* Schema that contains this table */ + u8 aHx[16]; /* Column aHt[K%sizeof(aHt)] might have hash K */ }; /* @@ -18867,9 +18965,13 @@ struct FKey { struct sColMap { /* Mapping of columns in pFrom to columns in zTo */ int iFrom; /* Index of column in pFrom */ char *zCol; /* Name of column in zTo. If NULL use PRIMARY KEY */ - } aCol[1]; /* One entry for each of nCol columns */ + } aCol[FLEXARRAY]; /* One entry for each of nCol columns */ }; +/* The size (in bytes) of an FKey object holding N columns. The answer +** does NOT include space to hold the zTo name. */ +#define SZ_FKEY(N) (offsetof(FKey,aCol)+(N)*sizeof(struct sColMap)) + /* ** SQLite supports many different ways to resolve a constraint ** error. ROLLBACK processing means that a constraint violation @@ -18931,9 +19033,12 @@ struct KeyInfo { u16 nAllField; /* Total columns, including key plus others */ sqlite3 *db; /* The database connection */ u8 *aSortFlags; /* Sort order for each column. */ - CollSeq *aColl[1]; /* Collating sequence for each term of the key */ + CollSeq *aColl[FLEXARRAY]; /* Collating sequence for each term of the key */ }; +/* The size (in bytes) of a KeyInfo object with up to N fields */ +#define SZ_KEYINFO(N) (offsetof(KeyInfo,aColl) + (N)*sizeof(CollSeq*)) + /* ** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. */ @@ -19053,7 +19158,7 @@ struct Index { Pgno tnum; /* DB Page containing root of this index */ LogEst szIdxRow; /* Estimated average row size in bytes */ u16 nKeyCol; /* Number of columns forming the key */ - u16 nColumn; /* Number of columns stored in the index */ + u16 nColumn; /* Nr columns in btree. Can be 2*Table.nCol */ u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */ unsigned idxType:2; /* 0:Normal 1:UNIQUE, 2:PRIMARY KEY, 3:IPK */ unsigned bUnordered:1; /* Use this index for == or IN queries only */ @@ -19062,7 +19167,6 @@ struct Index { unsigned isCovering:1; /* True if this is a covering index */ unsigned noSkipScan:1; /* Do not try to use skip-scan if true */ unsigned hasStat1:1; /* aiRowLogEst values come from sqlite_stat1 */ - unsigned bLowQual:1; /* sqlite_stat1 says this is a low-quality index */ unsigned bNoQuery:1; /* Do not use this index to optimize queries */ unsigned bAscKeyBug:1; /* True if the bba7b69f9849b5bf bug applies */ unsigned bHasVCol:1; /* Index references one or more VIRTUAL columns */ @@ -19152,7 +19256,7 @@ struct AggInfo { ** from source tables rather than from accumulators */ u8 useSortingIdx; /* In direct mode, reference the sorting index rather ** than the source table */ - u16 nSortingColumn; /* Number of columns in the sorting index */ + u32 nSortingColumn; /* Number of columns in the sorting index */ int sortingIdx; /* Cursor number of the sorting index */ int sortingIdxPTab; /* Cursor number of pseudo-table */ int iFirstReg; /* First register in range for aCol[] and aFunc[] */ @@ -19161,8 +19265,8 @@ struct AggInfo { Table *pTab; /* Source table */ Expr *pCExpr; /* The original expression */ int iTable; /* Cursor number of the source table */ - i16 iColumn; /* Column number within the source table */ - i16 iSorterColumn; /* Column number in the sorting index */ + int iColumn; /* Column number within the source table */ + int iSorterColumn; /* Column number in the sorting index */ } *aCol; int nColumn; /* Number of used entries in aCol[] */ int nAccumulator; /* Number of columns that show through to the output. @@ -19391,10 +19495,10 @@ struct Expr { /* Macros can be used to test, set, or clear bits in the ** Expr.flags field. */ -#define ExprHasProperty(E,P) (((E)->flags&(P))!=0) -#define ExprHasAllProperty(E,P) (((E)->flags&(P))==(P)) -#define ExprSetProperty(E,P) (E)->flags|=(P) -#define ExprClearProperty(E,P) (E)->flags&=~(P) +#define ExprHasProperty(E,P) (((E)->flags&(u32)(P))!=0) +#define ExprHasAllProperty(E,P) (((E)->flags&(u32)(P))==(u32)(P)) +#define ExprSetProperty(E,P) (E)->flags|=(u32)(P) +#define ExprClearProperty(E,P) (E)->flags&=~(u32)(P) #define ExprAlwaysTrue(E) (((E)->flags&(EP_OuterON|EP_IsTrue))==EP_IsTrue) #define ExprAlwaysFalse(E) (((E)->flags&(EP_OuterON|EP_IsFalse))==EP_IsFalse) #define ExprIsFullSize(E) (((E)->flags&(EP_Reduced|EP_TokenOnly))==0) @@ -19506,9 +19610,14 @@ struct ExprList { int iConstExprReg; /* Register in which Expr value is cached. Used only ** by Parse.pConstExpr */ } u; - } a[1]; /* One slot for each expression in the list */ + } a[FLEXARRAY]; /* One slot for each expression in the list */ }; +/* The size (in bytes) of an ExprList object that is big enough to hold +** as many as N expressions. */ +#define SZ_EXPRLIST(N) \ + (offsetof(ExprList,a) + (N)*sizeof(struct ExprList_item)) + /* ** Allowed values for Expr.a.eEName */ @@ -19536,9 +19645,12 @@ struct IdList { int nId; /* Number of identifiers on the list */ struct IdList_item { char *zName; /* Name of the identifier */ - } a[1]; + } a[FLEXARRAY]; }; +/* The size (in bytes) of an IdList object that can hold up to N IDs. */ +#define SZ_IDLIST(N) (offsetof(IdList,a)+(N)*sizeof(struct IdList_item)) + /* ** Allowed values for IdList.eType, which determines which value of the a.u4 ** is valid. @@ -19658,11 +19770,19 @@ struct OnOrUsing { ** */ struct SrcList { - int nSrc; /* Number of tables or subqueries in the FROM clause */ - u32 nAlloc; /* Number of entries allocated in a[] below */ - SrcItem a[1]; /* One entry for each identifier on the list */ + int nSrc; /* Number of tables or subqueries in the FROM clause */ + u32 nAlloc; /* Number of entries allocated in a[] below */ + SrcItem a[FLEXARRAY]; /* One entry for each identifier on the list */ }; +/* Size (in bytes) of a SrcList object that can hold as many as N +** SrcItem objects. */ +#define SZ_SRCLIST(N) (offsetof(SrcList,a)+(N)*sizeof(SrcItem)) + +/* Size (in bytes( of a SrcList object that holds 1 SrcItem. This is a +** special case of SZ_SRCITEM(1) that comes up often. */ +#define SZ_SRCLIST_1 (offsetof(SrcList,a)+sizeof(SrcItem)) + /* ** Permitted values of the SrcList.a.jointype field */ @@ -20131,25 +20251,32 @@ struct Parse { char *zErrMsg; /* An error message */ Vdbe *pVdbe; /* An engine for executing database bytecode */ int rc; /* Return code from execution */ - u8 colNamesSet; /* TRUE after OP_ColumnName has been issued to pVdbe */ - u8 checkSchema; /* Causes schema cookie check after an error */ + LogEst nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */ u8 nested; /* Number of nested calls to the parser/code generator */ u8 nTempReg; /* Number of temporary registers in aTempReg[] */ u8 isMultiWrite; /* True if statement may modify/insert multiple rows */ u8 mayAbort; /* True if statement may throw an ABORT exception */ u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */ - u8 okConstFactor; /* OK to factor out constants */ u8 disableLookaside; /* Number of times lookaside has been disabled */ u8 prepFlags; /* SQLITE_PREPARE_* flags */ u8 withinRJSubrtn; /* Nesting level for RIGHT JOIN body subroutines */ - u8 bHasWith; /* True if statement contains WITH */ u8 mSubrtnSig; /* mini Bloom filter on available SubrtnSig.selId */ + u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */ + u8 bReturning; /* Coding a RETURNING trigger */ + u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */ + u8 disableTriggers; /* True to disable triggers */ #if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST) u8 earlyCleanup; /* OOM inside sqlite3ParserAddCleanup() */ #endif #ifdef SQLITE_DEBUG u8 ifNotExists; /* Might be true if IF NOT EXISTS. Assert()s only */ + u8 isCreate; /* CREATE TABLE, INDEX, or VIEW (but not TRIGGER) + ** and ALTER TABLE ADD COLUMN. */ #endif + bft colNamesSet :1; /* TRUE after OP_ColumnName has been issued to pVdbe */ + bft bHasWith :1; /* True if statement contains WITH */ + bft okConstFactor :1; /* OK to factor out constants */ + bft checkSchema :1; /* Causes schema cookie check after an error */ int nRangeReg; /* Size of the temporary register block */ int iRangeReg; /* First register in temporary register block */ int nErr; /* Number of errors seen */ @@ -20164,12 +20291,9 @@ struct Parse { ExprList *pConstExpr;/* Constant expressions */ IndexedExpr *pIdxEpr;/* List of expressions used by active indexes */ IndexedExpr *pIdxPartExpr; /* Exprs constrained by index WHERE clauses */ - Token constraintName;/* Name of the constraint currently being parsed */ yDbMask writeMask; /* Start a write transaction on these databases */ yDbMask cookieMask; /* Bitmask of schema verified databases */ - int regRowid; /* Register holding rowid of CREATE TABLE entry */ - int regRoot; /* Register holding root page number for new objects */ - int nMaxArg; /* Max args passed to user function by sub-program */ + int nMaxArg; /* Max args to xUpdate and xFilter vtab methods */ int nSelect; /* Number of SELECT stmts. Counter for Select.selId */ #ifndef SQLITE_OMIT_PROGRESS_CALLBACK u32 nProgressSteps; /* xProgress steps taken during sqlite3_prepare() */ @@ -20183,17 +20307,6 @@ struct Parse { Table *pTriggerTab; /* Table triggers are being coded for */ TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */ ParseCleanup *pCleanup; /* List of cleanup operations to run after parse */ - union { - int addrCrTab; /* Address of OP_CreateBtree on CREATE TABLE */ - Returning *pReturning; /* The RETURNING clause */ - } u1; - u32 oldmask; /* Mask of old.* columns referenced */ - u32 newmask; /* Mask of new.* columns referenced */ - LogEst nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */ - u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */ - u8 bReturning; /* Coding a RETURNING trigger */ - u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */ - u8 disableTriggers; /* True to disable triggers */ /************************************************************************** ** Fields above must be initialized to zero. The fields that follow, @@ -20205,6 +20318,19 @@ struct Parse { int aTempReg[8]; /* Holding area for temporary registers */ Parse *pOuterParse; /* Outer Parse object when nested */ Token sNameToken; /* Token with unqualified schema object name */ + u32 oldmask; /* Mask of old.* columns referenced */ + u32 newmask; /* Mask of new.* columns referenced */ + union { + struct { /* These fields available when isCreate is true */ + int addrCrTab; /* Address of OP_CreateBtree on CREATE TABLE */ + int regRowid; /* Register holding rowid of CREATE TABLE entry */ + int regRoot; /* Register holding root page for new objects */ + Token constraintName; /* Name of the constraint currently being parsed */ + } cr; + struct { /* These fields available to all other statements */ + Returning *pReturning; /* The RETURNING clause */ + } d; + } u1; /************************************************************************ ** Above is constant between recursions. Below is reset before and after @@ -20720,9 +20846,13 @@ struct With { int nCte; /* Number of CTEs in the WITH clause */ int bView; /* Belongs to the outermost Select of a view */ With *pOuter; /* Containing WITH clause, or NULL */ - Cte a[1]; /* For each CTE in the WITH clause.... */ + Cte a[FLEXARRAY]; /* For each CTE in the WITH clause.... */ }; +/* The size (in bytes) of a With object that can hold as many +** as N different CTEs. */ +#define SZ_WITH(N) (offsetof(With,a) + (N)*sizeof(Cte)) + /* ** The Cte object is not guaranteed to persist for the entire duration ** of code generation. (The query flattener or other parser tree @@ -20751,9 +20881,13 @@ struct DbClientData { DbClientData *pNext; /* Next in a linked list */ void *pData; /* The data */ void (*xDestructor)(void*); /* Destructor. Might be NULL */ - char zName[1]; /* Name of this client data. MUST BE LAST */ + char zName[FLEXARRAY]; /* Name of this client data. MUST BE LAST */ }; +/* The size (in bytes) of a DbClientData object that can has a name +** that is N bytes long, including the zero-terminator. */ +#define SZ_DBCLIENTDATA(N) (offsetof(DbClientData,zName)+(N)) + #ifdef SQLITE_DEBUG /* ** An instance of the TreeView object is used for printing the content of @@ -21196,7 +21330,7 @@ SQLITE_PRIVATE void sqlite3SubqueryColumnTypes(Parse*,Table*,Select*,char); SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse*,Select*,char); SQLITE_PRIVATE void sqlite3OpenSchemaTable(Parse *, int); SQLITE_PRIVATE Index *sqlite3PrimaryKeyIndex(Table*); -SQLITE_PRIVATE i16 sqlite3TableColumnToIndex(Index*, i16); +SQLITE_PRIVATE int sqlite3TableColumnToIndex(Index*, int); #ifdef SQLITE_OMIT_GENERATED_COLUMNS # define sqlite3TableColumnToStorage(T,X) (X) /* No-op pass-through */ # define sqlite3StorageColumnToTable(T,X) (X) /* No-op pass-through */ @@ -21294,7 +21428,7 @@ SQLITE_PRIVATE void sqlite3SrcListAssignCursors(Parse*, SrcList*); SQLITE_PRIVATE void sqlite3IdListDelete(sqlite3*, IdList*); SQLITE_PRIVATE void sqlite3ClearOnOrUsing(sqlite3*, OnOrUsing*); SQLITE_PRIVATE void sqlite3SrcListDelete(sqlite3*, SrcList*); -SQLITE_PRIVATE Index *sqlite3AllocateIndexObject(sqlite3*,i16,int,char**); +SQLITE_PRIVATE Index *sqlite3AllocateIndexObject(sqlite3*,int,int,char**); SQLITE_PRIVATE void sqlite3CreateIndex(Parse*,Token*,Token*,SrcList*,ExprList*,int,Token*, Expr*, int, int, u8); SQLITE_PRIVATE void sqlite3DropIndex(Parse*, SrcList*, int); @@ -21430,7 +21564,8 @@ SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3*,const Select*,int); SQLITE_PRIVATE FuncDef *sqlite3FunctionSearch(int,const char*); SQLITE_PRIVATE void sqlite3InsertBuiltinFuncs(FuncDef*,int); SQLITE_PRIVATE FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,u8,u8); -SQLITE_PRIVATE void sqlite3QuoteValue(StrAccum*,sqlite3_value*); +SQLITE_PRIVATE void sqlite3QuoteValue(StrAccum*,sqlite3_value*,int); +SQLITE_PRIVATE int sqlite3AppendOneUtf8Character(char*, u32); SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void); SQLITE_PRIVATE void sqlite3RegisterDateTimeFunctions(void); SQLITE_PRIVATE void sqlite3RegisterJsonFunctions(void); @@ -22295,6 +22430,9 @@ static const char * const sqlite3azCompileOpt[] = { #ifdef SQLITE_BUG_COMPATIBLE_20160819 "BUG_COMPATIBLE_20160819", #endif +#ifdef SQLITE_BUG_COMPATIBLE_20250510 + "BUG_COMPATIBLE_20250510", +#endif #ifdef SQLITE_CASE_SENSITIVE_LIKE "CASE_SENSITIVE_LIKE", #endif @@ -22531,6 +22669,9 @@ static const char * const sqlite3azCompileOpt[] = { #ifdef SQLITE_ENABLE_SESSION "ENABLE_SESSION", #endif +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + "ENABLE_SETLK_TIMEOUT", +#endif #ifdef SQLITE_ENABLE_SNAPSHOT "ENABLE_SNAPSHOT", #endif @@ -22585,6 +22726,9 @@ static const char * const sqlite3azCompileOpt[] = { #ifdef SQLITE_EXTRA_INIT "EXTRA_INIT=" CTIMEOPT_VAL(SQLITE_EXTRA_INIT), #endif +#ifdef SQLITE_EXTRA_INIT_MUTEXED + "EXTRA_INIT_MUTEXED=" CTIMEOPT_VAL(SQLITE_EXTRA_INIT_MUTEXED), +#endif #ifdef SQLITE_EXTRA_SHUTDOWN "EXTRA_SHUTDOWN=" CTIMEOPT_VAL(SQLITE_EXTRA_SHUTDOWN), #endif @@ -23569,12 +23713,19 @@ struct VdbeCursor { #endif VdbeTxtBlbCache *pCache; /* Cache of large TEXT or BLOB values */ - /* 2*nField extra array elements allocated for aType[], beyond the one - ** static element declared in the structure. nField total array slots for - ** aType[] and nField+1 array slots for aOffset[] */ - u32 aType[1]; /* Type values record decode. MUST BE LAST */ + /* Space is allocated for aType to hold at least 2*nField+1 entries: + ** nField slots for aType[] and nField+1 array slots for aOffset[] */ + u32 aType[FLEXARRAY]; /* Type values record decode. MUST BE LAST */ }; +/* +** The size (in bytes) of a VdbeCursor object that has an nField value of N +** or less. The value of SZ_VDBECURSOR(n) is guaranteed to be a multiple +** of 8. +*/ +#define SZ_VDBECURSOR(N) \ + (ROUND8(offsetof(VdbeCursor,aType)) + ((N)+1)*sizeof(u64)) + /* Return true if P is a null-only cursor */ #define IsNullCursor(P) \ @@ -23831,13 +23982,16 @@ struct sqlite3_context { u8 enc; /* Encoding to use for results */ u8 skipFlag; /* Skip accumulator loading if true */ u16 argc; /* Number of arguments */ - sqlite3_value *argv[1]; /* Argument set */ + sqlite3_value *argv[FLEXARRAY]; /* Argument set */ }; -/* A bitfield type for use inside of structures. Always follow with :N where -** N is the number of bits. +/* +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -typedef unsigned bft; /* Bit Field Type */ +#define SZ_CONTEXT(N) \ + (offsetof(sqlite3_context,argv)+(N)*sizeof(sqlite3_value*)) + /* The ScanStatus object holds a single value for the ** sqlite3_stmt_scanstatus() interface. @@ -23898,7 +24052,7 @@ struct Vdbe { i64 nStmtDefCons; /* Number of def. constraints when stmt started */ i64 nStmtDefImmCons; /* Number of def. imm constraints when stmt started */ Mem *aMem; /* The memory locations */ - Mem **apArg; /* Arguments to currently executing user function */ + Mem **apArg; /* Arguments xUpdate and xFilter vtab methods */ VdbeCursor **apCsr; /* One element of this array for each open cursor */ Mem *aVar; /* Values for the OP_Variable opcode. */ @@ -23918,6 +24072,7 @@ struct Vdbe { #ifdef SQLITE_DEBUG int rcApp; /* errcode set by sqlite3_result_error_code() */ u32 nWrite; /* Number of write operations that have occurred */ + int napArg; /* Size of the apArg[] array */ #endif u16 nResColumn; /* Number of columns in one row of the result set */ u16 nResAlloc; /* Column slots allocated to aColName[] */ @@ -23970,7 +24125,7 @@ struct PreUpdate { VdbeCursor *pCsr; /* Cursor to read old values from */ int op; /* One of SQLITE_INSERT, UPDATE, DELETE */ u8 *aRecord; /* old.* database record */ - KeyInfo keyinfo; + KeyInfo *pKeyinfo; /* Key information */ UnpackedRecord *pUnpacked; /* Unpacked version of aRecord[] */ UnpackedRecord *pNewUnpacked; /* Unpacked version of new.* record */ int iNewReg; /* Register for new.* values */ @@ -23982,6 +24137,7 @@ struct PreUpdate { Table *pTab; /* Schema object being updated */ Index *pPk; /* PK index if pTab is WITHOUT ROWID */ sqlite3_value **apDflt; /* Array of default values, if required */ + u8 keyinfoSpace[SZ_KEYINFO(0)]; /* Space to hold pKeyinfo[0] content */ }; /* @@ -24348,8 +24504,9 @@ SQLITE_PRIVATE int sqlite3LookasideUsed(sqlite3 *db, int *pHighwater){ nInit += countLookasideSlots(db->lookaside.pSmallInit); nFree += countLookasideSlots(db->lookaside.pSmallFree); #endif /* SQLITE_OMIT_TWOSIZE_LOOKASIDE */ - if( pHighwater ) *pHighwater = db->lookaside.nSlot - nInit; - return db->lookaside.nSlot - (nInit+nFree); + assert( db->lookaside.nSlot >= nInit+nFree ); + if( pHighwater ) *pHighwater = (int)(db->lookaside.nSlot - nInit); + return (int)(db->lookaside.nSlot - (nInit+nFree)); } /* @@ -24402,7 +24559,7 @@ SQLITE_API int sqlite3_db_status( assert( (op-SQLITE_DBSTATUS_LOOKASIDE_HIT)>=0 ); assert( (op-SQLITE_DBSTATUS_LOOKASIDE_HIT)<3 ); *pCurrent = 0; - *pHighwater = db->lookaside.anStat[op - SQLITE_DBSTATUS_LOOKASIDE_HIT]; + *pHighwater = (int)db->lookaside.anStat[op-SQLITE_DBSTATUS_LOOKASIDE_HIT]; if( resetFlag ){ db->lookaside.anStat[op - SQLITE_DBSTATUS_LOOKASIDE_HIT] = 0; } @@ -25914,7 +26071,7 @@ static int daysAfterMonday(DateTime *pDate){ ** In other words, return the day of the week according ** to this code: ** -** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday */ static int daysAfterSunday(DateTime *pDate){ assert( pDate->validJD ); @@ -30123,6 +30280,8 @@ SQLITE_PRIVATE sqlite3_mutex_methods const *sqlite3DefaultMutex(void){ #ifdef __CYGWIN__ # include +# include /* amalgamator: dontcache */ +# include /* amalgamator: dontcache */ # include /* amalgamator: dontcache */ #endif @@ -31517,17 +31676,17 @@ SQLITE_PRIVATE int sqlite3ApiExit(sqlite3* db, int rc){ #define etPERCENT 7 /* Percent symbol. %% */ #define etCHARX 8 /* Characters. %c */ /* The rest are extensions, not normally found in printf() */ -#define etSQLESCAPE 9 /* Strings with '\'' doubled. %q */ -#define etSQLESCAPE2 10 /* Strings with '\'' doubled and enclosed in '', - NULL pointers replaced by SQL NULL. %Q */ -#define etTOKEN 11 /* a pointer to a Token structure */ -#define etSRCITEM 12 /* a pointer to a SrcItem */ -#define etPOINTER 13 /* The %p conversion */ -#define etSQLESCAPE3 14 /* %w -> Strings with '\"' doubled */ -#define etORDINAL 15 /* %r -> 1st, 2nd, 3rd, 4th, etc. English only */ -#define etDECIMAL 16 /* %d or %u, but not %x, %o */ +#define etESCAPE_q 9 /* Strings with '\'' doubled. %q */ +#define etESCAPE_Q 10 /* Strings with '\'' doubled and enclosed in '', + NULL pointers replaced by SQL NULL. %Q */ +#define etTOKEN 11 /* a pointer to a Token structure */ +#define etSRCITEM 12 /* a pointer to a SrcItem */ +#define etPOINTER 13 /* The %p conversion */ +#define etESCAPE_w 14 /* %w -> Strings with '\"' doubled */ +#define etORDINAL 15 /* %r -> 1st, 2nd, 3rd, 4th, etc. English only */ +#define etDECIMAL 16 /* %d or %u, but not %x, %o */ -#define etINVALID 17 /* Any unrecognized conversion type */ +#define etINVALID 17 /* Any unrecognized conversion type */ /* @@ -31566,9 +31725,9 @@ static const et_info fmtinfo[] = { { 's', 0, 4, etSTRING, 0, 0 }, { 'g', 0, 1, etGENERIC, 30, 0 }, { 'z', 0, 4, etDYNSTRING, 0, 0 }, - { 'q', 0, 4, etSQLESCAPE, 0, 0 }, - { 'Q', 0, 4, etSQLESCAPE2, 0, 0 }, - { 'w', 0, 4, etSQLESCAPE3, 0, 0 }, + { 'q', 0, 4, etESCAPE_q, 0, 0 }, + { 'Q', 0, 4, etESCAPE_Q, 0, 0 }, + { 'w', 0, 4, etESCAPE_w, 0, 0 }, { 'c', 0, 0, etCHARX, 0, 0 }, { 'o', 8, 0, etRADIX, 0, 2 }, { 'u', 10, 0, etDECIMAL, 0, 0 }, @@ -32165,25 +32324,7 @@ SQLITE_API void sqlite3_str_vappendf( } }else{ unsigned int ch = va_arg(ap,unsigned int); - if( ch<0x00080 ){ - buf[0] = ch & 0xff; - length = 1; - }else if( ch<0x00800 ){ - buf[0] = 0xc0 + (u8)((ch>>6)&0x1f); - buf[1] = 0x80 + (u8)(ch & 0x3f); - length = 2; - }else if( ch<0x10000 ){ - buf[0] = 0xe0 + (u8)((ch>>12)&0x0f); - buf[1] = 0x80 + (u8)((ch>>6) & 0x3f); - buf[2] = 0x80 + (u8)(ch & 0x3f); - length = 3; - }else{ - buf[0] = 0xf0 + (u8)((ch>>18) & 0x07); - buf[1] = 0x80 + (u8)((ch>>12) & 0x3f); - buf[2] = 0x80 + (u8)((ch>>6) & 0x3f); - buf[3] = 0x80 + (u8)(ch & 0x3f); - length = 4; - } + length = sqlite3AppendOneUtf8Character(buf, ch); } if( precision>1 ){ i64 nPrior = 1; @@ -32263,22 +32404,31 @@ SQLITE_API void sqlite3_str_vappendf( while( ii>=0 ) if( (bufpt[ii--] & 0xc0)==0x80 ) width++; } break; - case etSQLESCAPE: /* %q: Escape ' characters */ - case etSQLESCAPE2: /* %Q: Escape ' and enclose in '...' */ - case etSQLESCAPE3: { /* %w: Escape " characters */ + case etESCAPE_q: /* %q: Escape ' characters */ + case etESCAPE_Q: /* %Q: Escape ' and enclose in '...' */ + case etESCAPE_w: { /* %w: Escape " characters */ i64 i, j, k, n; - int needQuote, isnull; + int needQuote = 0; char ch; - char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */ char *escarg; + char q; if( bArgList ){ escarg = getTextArg(pArgList); }else{ escarg = va_arg(ap,char*); } - isnull = escarg==0; - if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); + if( escarg==0 ){ + escarg = (xtype==etESCAPE_Q ? "NULL" : "(NULL)"); + }else if( xtype==etESCAPE_Q ){ + needQuote = 1; + } + if( xtype==etESCAPE_w ){ + q = '"'; + flag_alternateform = 0; + }else{ + q = '\''; + } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. ** Because of the extra quoting characters inserted, the number @@ -32291,7 +32441,30 @@ SQLITE_API void sqlite3_str_vappendf( while( (escarg[i+1]&0xc0)==0x80 ){ i++; } } } - needQuote = !isnull && xtype==etSQLESCAPE2; + if( flag_alternateform ){ + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + u32 nBack = 0; + u32 nCtrl = 0; + for(k=0; ketBUFSIZE ){ bufpt = zExtra = printfTempBuf(pAccum, n); @@ -32300,13 +32473,41 @@ SQLITE_API void sqlite3_str_vappendf( bufpt = buf; } j = 0; - if( needQuote ) bufpt[j++] = q; - k = i; - for(i=0; i=0x10 ? '1' : '0'; + bufpt[j++] = "0123456789abcdef"[ch&0xf]; + } + } + }else{ + for(i=0; imxAlloc>0 && !isMalloced(p) ); - zText = sqlite3DbMallocRaw(p->db, p->nChar+1 ); + zText = sqlite3DbMallocRaw(p->db, 1+(u64)p->nChar ); if( zText ){ memcpy(zText, p->zText, p->nChar+1); p->printfFlags |= SQLITE_PRINTF_MALLOCED; @@ -32794,6 +32995,15 @@ SQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){ return zBuf; } +/* Maximum size of an sqlite3_log() message. */ +#if defined(SQLITE_MAX_LOG_MESSAGE) + /* Leave the definition as supplied */ +#elif SQLITE_PRINT_BUF_SIZE*10>10000 +# define SQLITE_MAX_LOG_MESSAGE 10000 +#else +# define SQLITE_MAX_LOG_MESSAGE (SQLITE_PRINT_BUF_SIZE*10) +#endif + /* ** This is the routine that actually formats the sqlite3_log() message. ** We house it in a separate routine from sqlite3_log() to avoid using @@ -32810,7 +33020,7 @@ SQLITE_API char *sqlite3_snprintf(int n, char *zBuf, const char *zFormat, ...){ */ static void renderLogMsg(int iErrCode, const char *zFormat, va_list ap){ StrAccum acc; /* String accumulator */ - char zMsg[SQLITE_PRINT_BUF_SIZE*3]; /* Complete log message */ + char zMsg[SQLITE_MAX_LOG_MESSAGE]; /* Complete log message */ sqlite3StrAccumInit(&acc, 0, zMsg, sizeof(zMsg), 0); sqlite3_str_vappendf(&acc, zFormat, ap); @@ -34805,6 +35015,35 @@ static const unsigned char sqlite3Utf8Trans1[] = { } \ } +/* +** Write a single UTF8 character whose value is v into the +** buffer starting at zOut. zOut must be sized to hold at +** least four bytes. Return the number of bytes needed +** to encode the new character. +*/ +SQLITE_PRIVATE int sqlite3AppendOneUtf8Character(char *zOut, u32 v){ + if( v<0x00080 ){ + zOut[0] = (u8)(v & 0xff); + return 1; + } + if( v<0x00800 ){ + zOut[0] = 0xc0 + (u8)((v>>6) & 0x1f); + zOut[1] = 0x80 + (u8)(v & 0x3f); + return 2; + } + if( v<0x10000 ){ + zOut[0] = 0xe0 + (u8)((v>>12) & 0x0f); + zOut[1] = 0x80 + (u8)((v>>6) & 0x3f); + zOut[2] = 0x80 + (u8)(v & 0x3f); + return 3; + } + zOut[0] = 0xf0 + (u8)((v>>18) & 0x07); + zOut[1] = 0x80 + (u8)((v>>12) & 0x3f); + zOut[2] = 0x80 + (u8)((v>>6) & 0x3f); + zOut[3] = 0x80 + (u8)(v & 0x3f); + return 4; +} + /* ** Translate a single UTF-8 character. Return the unicode value. ** @@ -35226,7 +35465,7 @@ SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nByte, int nChar){ int n = 0; if( SQLITE_UTF16NATIVE==SQLITE_UTF16LE ) z++; - while( n=0xd8 && c<0xdc && z<=zEnd && z[0]>=0xdc && z[0]<0xe0 ) z += 2; @@ -36401,7 +36640,11 @@ SQLITE_PRIVATE void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRou } p->z = &p->zBuf[i+1]; assert( i+p->n < sizeof(p->zBuf) ); - while( ALWAYS(p->n>0) && p->z[p->n-1]=='0' ){ p->n--; } + assert( p->n>0 ); + while( p->z[p->n-1]=='0' ){ + p->n--; + assert( p->n>0 ); + } } /* @@ -36906,7 +37149,7 @@ SQLITE_PRIVATE int sqlite3MulInt64(i64 *pA, i64 iB){ } /* -** Compute the absolute value of a 32-bit signed integer, of possible. Or +** Compute the absolute value of a 32-bit signed integer, if possible. Or ** if the integer has a value of -2147483648, return +2147483647 */ SQLITE_PRIVATE int sqlite3AbsInt32(int x){ @@ -37187,12 +37430,19 @@ SQLITE_PRIVATE void sqlite3HashClear(Hash *pH){ */ static unsigned int strHash(const char *z){ unsigned int h = 0; - unsigned char c; - while( (c = (unsigned char)*z++)!=0 ){ /*OPTIMIZATION-IF-TRUE*/ + while( z[0] ){ /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += sqlite3UpperToLower[c]; + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ +#ifdef SQLITE_EBCDIC + h += 0xbf & (unsigned char)*(z++); +#else + h += 0xdf & (unsigned char)*(z++); +#endif h *= 0x9e3779b1; } return h; @@ -37265,9 +37515,8 @@ static int rehash(Hash *pH, unsigned int new_size){ pH->htsize = new_size = sqlite3MallocSize(new_ht)/sizeof(struct _ht); memset(new_ht, 0, new_size*sizeof(struct _ht)); for(elem=pH->first, pH->first=0; elem; elem = next_elem){ - unsigned int h = strHash(elem->pKey) % new_size; next_elem = elem->next; - insertElement(pH, &new_ht[h], elem); + insertElement(pH, &new_ht[elem->h % new_size], elem); } return 1; } @@ -37285,23 +37534,22 @@ static HashElem *findElementWithHash( HashElem *elem; /* Used to loop thru the element list */ unsigned int count; /* Number of elements left to test */ unsigned int h; /* The computed hash */ - static HashElem nullElement = { 0, 0, 0, 0 }; + static HashElem nullElement = { 0, 0, 0, 0, 0 }; + h = strHash(pKey); if( pH->ht ){ /*OPTIMIZATION-IF-TRUE*/ struct _ht *pEntry; - h = strHash(pKey) % pH->htsize; - pEntry = &pH->ht[h]; + pEntry = &pH->ht[h % pH->htsize]; elem = pEntry->chain; count = pEntry->count; }else{ - h = 0; elem = pH->first; count = pH->count; } if( pHash ) *pHash = h; while( count ){ assert( elem!=0 ); - if( sqlite3StrICmp(elem->pKey,pKey)==0 ){ + if( h==elem->h && sqlite3StrICmp(elem->pKey,pKey)==0 ){ return elem; } elem = elem->next; @@ -37313,10 +37561,9 @@ static HashElem *findElementWithHash( /* Remove a single entry from the hash table given a pointer to that ** element and a hash on the element's key. */ -static void removeElementGivenHash( +static void removeElement( Hash *pH, /* The pH containing "elem" */ - HashElem* elem, /* The element to be removed from the pH */ - unsigned int h /* Hash value for the element */ + HashElem *elem /* The element to be removed from the pH */ ){ struct _ht *pEntry; if( elem->prev ){ @@ -37328,7 +37575,7 @@ static void removeElementGivenHash( elem->next->prev = elem->prev; } if( pH->ht ){ - pEntry = &pH->ht[h]; + pEntry = &pH->ht[elem->h % pH->htsize]; if( pEntry->chain==elem ){ pEntry->chain = elem->next; } @@ -37379,7 +37626,7 @@ SQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const char *pKey, void *data){ if( elem->data ){ void *old_data = elem->data; if( data==0 ){ - removeElementGivenHash(pH,elem,h); + removeElement(pH,elem); }else{ elem->data = data; elem->pKey = pKey; @@ -37390,15 +37637,13 @@ SQLITE_PRIVATE void *sqlite3HashInsert(Hash *pH, const char *pKey, void *data){ new_elem = (HashElem*)sqlite3Malloc( sizeof(HashElem) ); if( new_elem==0 ) return data; new_elem->pKey = pKey; + new_elem->h = h; new_elem->data = data; pH->count++; - if( pH->count>=10 && pH->count > 2*pH->htsize ){ - if( rehash(pH, pH->count*2) ){ - assert( pH->htsize>0 ); - h = strHash(pKey) % pH->htsize; - } + if( pH->count>=5 && pH->count > 2*pH->htsize ){ + rehash(pH, pH->count*3); } - insertElement(pH, pH->ht ? &pH->ht[h] : 0, new_elem); + insertElement(pH, pH->ht ? &pH->ht[new_elem->h % pH->htsize] : 0, new_elem); return 0; } @@ -38881,6 +39126,7 @@ struct unixFile { #endif #ifdef SQLITE_ENABLE_SETLK_TIMEOUT unsigned iBusyTimeout; /* Wait this many millisec on locks */ + int bBlockOnConnect; /* True to block for SHARED locks */ #endif #if OS_VXWORKS struct vxworksFileId *pId; /* Unique file ID */ @@ -40274,6 +40520,13 @@ static int unixFileLock(unixFile *pFile, struct flock *pLock){ rc = 0; } }else{ +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + if( pFile->bBlockOnConnect && pLock->l_type==F_RDLCK + && pLock->l_start==SHARED_FIRST && pLock->l_len==SHARED_SIZE + ){ + rc = osFcntl(pFile->h, F_SETLKW, pLock); + }else +#endif rc = osSetPosixAdvisoryLock(pFile->h, pLock, pFile); } return rc; @@ -42635,8 +42888,9 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){ #ifdef SQLITE_ENABLE_SETLK_TIMEOUT case SQLITE_FCNTL_LOCK_TIMEOUT: { int iOld = pFile->iBusyTimeout; + int iNew = *(int*)pArg; #if SQLITE_ENABLE_SETLK_TIMEOUT==1 - pFile->iBusyTimeout = *(int*)pArg; + pFile->iBusyTimeout = iNew<0 ? 0x7FFFFFFF : (unsigned)iNew; #elif SQLITE_ENABLE_SETLK_TIMEOUT==2 pFile->iBusyTimeout = !!(*(int*)pArg); #else @@ -42645,7 +42899,12 @@ static int unixFileControl(sqlite3_file *id, int op, void *pArg){ *(int*)pArg = iOld; return SQLITE_OK; } -#endif + case SQLITE_FCNTL_BLOCK_ON_CONNECT: { + int iNew = *(int*)pArg; + pFile->bBlockOnConnect = iNew; + return SQLITE_OK; + } +#endif /* SQLITE_ENABLE_SETLK_TIMEOUT */ #if SQLITE_MAX_MMAP_SIZE>0 case SQLITE_FCNTL_MMAP_SIZE: { i64 newLimit = *(i64*)pArg; @@ -43618,21 +43877,20 @@ static int unixShmLock( /* Check that, if this to be a blocking lock, no locks that occur later ** in the following list than the lock being obtained are already held: ** - ** 1. Checkpointer lock (ofst==1). - ** 2. Write lock (ofst==0). - ** 3. Read locks (ofst>=3 && ofst=3 && ofstexclMask|p->sharedMask); assert( (flags & SQLITE_SHM_UNLOCK) || pDbFd->iBusyTimeout==0 || ( - (ofst!=2) /* not RECOVER */ + (ofst!=2 || lockMask==0) && (ofst!=1 || lockMask==0 || lockMask==2) && (ofst!=0 || lockMask<3) && (ofst<3 || lockMask<(1<iBusyTimeout +#else +# define winFileBusyTimeout(pDbFd) 0 +#endif + /* ** The winVfsAppData structure is used for the pAppData member for all of the ** Win32 VFS variants. @@ -47478,7 +47746,7 @@ static struct win_syscall { { "FileTimeToLocalFileTime", (SYSCALL)0, 0 }, #endif -#define osFileTimeToLocalFileTime ((BOOL(WINAPI*)(CONST FILETIME*, \ +#define osFileTimeToLocalFileTime ((BOOL(WINAPI*)(const FILETIME*, \ LPFILETIME))aSyscall[11].pCurrent) #if SQLITE_OS_WINCE @@ -47487,7 +47755,7 @@ static struct win_syscall { { "FileTimeToSystemTime", (SYSCALL)0, 0 }, #endif -#define osFileTimeToSystemTime ((BOOL(WINAPI*)(CONST FILETIME*, \ +#define osFileTimeToSystemTime ((BOOL(WINAPI*)(const FILETIME*, \ LPSYSTEMTIME))aSyscall[12].pCurrent) { "FlushFileBuffers", (SYSCALL)FlushFileBuffers, 0 }, @@ -47593,6 +47861,12 @@ static struct win_syscall { #define osGetFullPathNameW ((DWORD(WINAPI*)(LPCWSTR,DWORD,LPWSTR, \ LPWSTR*))aSyscall[25].pCurrent) +/* +** For GetLastError(), MSDN says: +** +** Minimum supported client: Windows XP [desktop apps | UWP apps] +** Minimum supported server: Windows Server 2003 [desktop apps | UWP apps] +*/ { "GetLastError", (SYSCALL)GetLastError, 0 }, #define osGetLastError ((DWORD(WINAPI*)(VOID))aSyscall[26].pCurrent) @@ -47761,7 +48035,7 @@ static struct win_syscall { { "LockFile", (SYSCALL)0, 0 }, #endif -#ifndef osLockFile +#if !defined(osLockFile) && defined(SQLITE_WIN32_HAS_ANSI) #define osLockFile ((BOOL(WINAPI*)(HANDLE,DWORD,DWORD,DWORD, \ DWORD))aSyscall[47].pCurrent) #endif @@ -47825,7 +48099,7 @@ static struct win_syscall { { "SystemTimeToFileTime", (SYSCALL)SystemTimeToFileTime, 0 }, -#define osSystemTimeToFileTime ((BOOL(WINAPI*)(CONST SYSTEMTIME*, \ +#define osSystemTimeToFileTime ((BOOL(WINAPI*)(const SYSTEMTIME*, \ LPFILETIME))aSyscall[56].pCurrent) #if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT @@ -47834,7 +48108,7 @@ static struct win_syscall { { "UnlockFile", (SYSCALL)0, 0 }, #endif -#ifndef osUnlockFile +#if !defined(osUnlockFile) && defined(SQLITE_WIN32_HAS_ANSI) #define osUnlockFile ((BOOL(WINAPI*)(HANDLE,DWORD,DWORD,DWORD, \ DWORD))aSyscall[57].pCurrent) #endif @@ -47875,11 +48149,13 @@ static struct win_syscall { #define osCreateEventExW ((HANDLE(WINAPI*)(LPSECURITY_ATTRIBUTES,LPCWSTR, \ DWORD,DWORD))aSyscall[62].pCurrent) -#if !SQLITE_OS_WINRT +/* +** For WaitForSingleObject(), MSDN says: +** +** Minimum supported client: Windows XP [desktop apps | UWP apps] +** Minimum supported server: Windows Server 2003 [desktop apps | UWP apps] +*/ { "WaitForSingleObject", (SYSCALL)WaitForSingleObject, 0 }, -#else - { "WaitForSingleObject", (SYSCALL)0, 0 }, -#endif #define osWaitForSingleObject ((DWORD(WINAPI*)(HANDLE, \ DWORD))aSyscall[63].pCurrent) @@ -48026,6 +48302,97 @@ static struct win_syscall { #define osFlushViewOfFile \ ((BOOL(WINAPI*)(LPCVOID,SIZE_T))aSyscall[79].pCurrent) +/* +** If SQLITE_ENABLE_SETLK_TIMEOUT is defined, we require CreateEvent() +** to implement blocking locks with timeouts. MSDN says: +** +** Minimum supported client: Windows XP [desktop apps | UWP apps] +** Minimum supported server: Windows Server 2003 [desktop apps | UWP apps] +*/ +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + { "CreateEvent", (SYSCALL)CreateEvent, 0 }, +#else + { "CreateEvent", (SYSCALL)0, 0 }, +#endif + +#define osCreateEvent ( \ + (HANDLE(WINAPI*) (LPSECURITY_ATTRIBUTES,BOOL,BOOL,LPCSTR)) \ + aSyscall[80].pCurrent \ +) + +/* +** If SQLITE_ENABLE_SETLK_TIMEOUT is defined, we require CancelIo() +** for the case where a timeout expires and a lock request must be +** cancelled. +** +** Minimum supported client: Windows XP [desktop apps | UWP apps] +** Minimum supported server: Windows Server 2003 [desktop apps | UWP apps] +*/ +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + { "CancelIo", (SYSCALL)CancelIo, 0 }, +#else + { "CancelIo", (SYSCALL)0, 0 }, +#endif + +#define osCancelIo ((BOOL(WINAPI*)(HANDLE))aSyscall[81].pCurrent) + +#if defined(SQLITE_WIN32_HAS_WIDE) && defined(_WIN32) + { "GetModuleHandleW", (SYSCALL)GetModuleHandleW, 0 }, +#else + { "GetModuleHandleW", (SYSCALL)0, 0 }, +#endif + +#define osGetModuleHandleW ((HMODULE(WINAPI*)(LPCWSTR))aSyscall[82].pCurrent) + +#ifndef _WIN32 + { "getenv", (SYSCALL)getenv, 0 }, +#else + { "getenv", (SYSCALL)0, 0 }, +#endif + +#define osGetenv ((const char *(*)(const char *))aSyscall[83].pCurrent) + +#ifndef _WIN32 + { "getcwd", (SYSCALL)getcwd, 0 }, +#else + { "getcwd", (SYSCALL)0, 0 }, +#endif + +#define osGetcwd ((char*(*)(char*,size_t))aSyscall[84].pCurrent) + +#ifndef _WIN32 + { "readlink", (SYSCALL)readlink, 0 }, +#else + { "readlink", (SYSCALL)0, 0 }, +#endif + +#define osReadlink ((ssize_t(*)(const char*,char*,size_t))aSyscall[85].pCurrent) + +#ifndef _WIN32 + { "lstat", (SYSCALL)lstat, 0 }, +#else + { "lstat", (SYSCALL)0, 0 }, +#endif + +#define osLstat ((int(*)(const char*,struct stat*))aSyscall[86].pCurrent) + +#ifndef _WIN32 + { "__errno", (SYSCALL)__errno, 0 }, +#else + { "__errno", (SYSCALL)0, 0 }, +#endif + +#define osErrno (*((int*(*)(void))aSyscall[87].pCurrent)()) + +#ifndef _WIN32 + { "cygwin_conv_path", (SYSCALL)cygwin_conv_path, 0 }, +#else + { "cygwin_conv_path", (SYSCALL)0, 0 }, +#endif + +#define osCygwin_conv_path ((size_t(*)(unsigned int, \ + const void *, void *, size_t))aSyscall[88].pCurrent) + }; /* End of the overrideable system calls */ /* @@ -48199,6 +48566,7 @@ SQLITE_API int sqlite3_win32_reset_heap(){ } #endif /* SQLITE_WIN32_MALLOC */ +#ifdef _WIN32 /* ** This function outputs the specified (ANSI) string to the Win32 debugger ** (if available). @@ -48241,6 +48609,7 @@ SQLITE_API void sqlite3_win32_write_debug(const char *zBuf, int nBuf){ } #endif } +#endif /* _WIN32 */ /* ** The following routine suspends the current thread for at least ms @@ -48324,7 +48693,9 @@ SQLITE_API int sqlite3_win32_is_nt(void){ } return osInterlockedCompareExchange(&sqlite3_os_type, 2, 2)==2; #elif SQLITE_TEST - return osInterlockedCompareExchange(&sqlite3_os_type, 2, 2)==2; + return osInterlockedCompareExchange(&sqlite3_os_type, 2, 2)==2 + || osInterlockedCompareExchange(&sqlite3_os_type, 0, 0)==0 + ; #else /* ** NOTE: All sub-platforms where the GetVersionEx[AW] functions are @@ -48539,6 +48910,7 @@ SQLITE_PRIVATE void sqlite3MemSetDefault(void){ } #endif /* SQLITE_WIN32_MALLOC */ +#ifdef _WIN32 /* ** Convert a UTF-8 string to Microsoft Unicode. ** @@ -48564,6 +48936,7 @@ static LPWSTR winUtf8ToUnicode(const char *zText){ } return zWideText; } +#endif /* _WIN32 */ /* ** Convert a Microsoft Unicode string to UTF-8. @@ -48598,28 +48971,29 @@ static char *winUnicodeToUtf8(LPCWSTR zWideText){ ** Space to hold the returned string is obtained from sqlite3_malloc(). */ static LPWSTR winMbcsToUnicode(const char *zText, int useAnsi){ - int nByte; + int nWideChar; LPWSTR zMbcsText; int codepage = useAnsi ? CP_ACP : CP_OEMCP; - nByte = osMultiByteToWideChar(codepage, 0, zText, -1, NULL, - 0)*sizeof(WCHAR); - if( nByte==0 ){ + nWideChar = osMultiByteToWideChar(codepage, 0, zText, -1, NULL, + 0); + if( nWideChar==0 ){ return 0; } - zMbcsText = sqlite3MallocZero( nByte*sizeof(WCHAR) ); + zMbcsText = sqlite3MallocZero( nWideChar*sizeof(WCHAR) ); if( zMbcsText==0 ){ return 0; } - nByte = osMultiByteToWideChar(codepage, 0, zText, -1, zMbcsText, - nByte); - if( nByte==0 ){ + nWideChar = osMultiByteToWideChar(codepage, 0, zText, -1, zMbcsText, + nWideChar); + if( nWideChar==0 ){ sqlite3_free(zMbcsText); zMbcsText = 0; } return zMbcsText; } +#ifdef _WIN32 /* ** Convert a Microsoft Unicode string to a multi-byte character string, ** using the ANSI or OEM code page. @@ -48647,6 +49021,7 @@ static char *winUnicodeToMbcs(LPCWSTR zWideText, int useAnsi){ } return zText; } +#endif /* _WIN32 */ /* ** Convert a multi-byte character string to UTF-8. @@ -48666,6 +49041,7 @@ static char *winMbcsToUtf8(const char *zText, int useAnsi){ return zTextUtf8; } +#ifdef _WIN32 /* ** Convert a UTF-8 string to a multi-byte character string. ** @@ -48715,6 +49091,7 @@ SQLITE_API char *sqlite3_win32_unicode_to_utf8(LPCWSTR zWideText){ #endif return winUnicodeToUtf8(zWideText); } +#endif /* _WIN32 */ /* ** This is a public wrapper for the winMbcsToUtf8() function. @@ -48732,6 +49109,7 @@ SQLITE_API char *sqlite3_win32_mbcs_to_utf8(const char *zText){ return winMbcsToUtf8(zText, osAreFileApisANSI()); } +#ifdef _WIN32 /* ** This is a public wrapper for the winMbcsToUtf8() function. */ @@ -48856,6 +49234,7 @@ SQLITE_API int sqlite3_win32_set_directory( ){ return sqlite3_win32_set_directory16(type, zValue); } +#endif /* _WIN32 */ /* ** The return value of winGetLastErrorMsg @@ -49404,13 +49783,98 @@ static BOOL winLockFile( ovlp.Offset = offsetLow; ovlp.OffsetHigh = offsetHigh; return osLockFileEx(*phFile, flags, 0, numBytesLow, numBytesHigh, &ovlp); +#ifdef SQLITE_WIN32_HAS_ANSI }else{ return osLockFile(*phFile, offsetLow, offsetHigh, numBytesLow, numBytesHigh); +#endif } #endif } +/* +** Lock a region of nByte bytes starting at offset offset of file hFile. +** Take an EXCLUSIVE lock if parameter bExclusive is true, or a SHARED lock +** otherwise. If nMs is greater than zero and the lock cannot be obtained +** immediately, block for that many ms before giving up. +** +** This function returns SQLITE_OK if the lock is obtained successfully. If +** some other process holds the lock, SQLITE_BUSY is returned if nMs==0, or +** SQLITE_BUSY_TIMEOUT otherwise. Or, if an error occurs, SQLITE_IOERR. +*/ +static int winHandleLockTimeout( + HANDLE hFile, + DWORD offset, + DWORD nByte, + int bExcl, + DWORD nMs +){ + DWORD flags = LOCKFILE_FAIL_IMMEDIATELY | (bExcl?LOCKFILE_EXCLUSIVE_LOCK:0); + int rc = SQLITE_OK; + BOOL ret; + + if( !osIsNT() ){ + ret = winLockFile(&hFile, flags, offset, 0, nByte, 0); + }else{ + OVERLAPPED ovlp; + memset(&ovlp, 0, sizeof(OVERLAPPED)); + ovlp.Offset = offset; + +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + if( nMs!=0 ){ + flags &= ~LOCKFILE_FAIL_IMMEDIATELY; + } + ovlp.hEvent = osCreateEvent(NULL, TRUE, FALSE, NULL); + if( ovlp.hEvent==NULL ){ + return SQLITE_IOERR_LOCK; + } +#endif + + ret = osLockFileEx(hFile, flags, 0, nByte, 0, &ovlp); + +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + /* If SQLITE_ENABLE_SETLK_TIMEOUT is defined, then the file-handle was + ** opened with FILE_FLAG_OVERHEAD specified. In this case, the call to + ** LockFileEx() may fail because the request is still pending. This can + ** happen even if LOCKFILE_FAIL_IMMEDIATELY was specified. + ** + ** If nMs is 0, then LOCKFILE_FAIL_IMMEDIATELY was set in the flags + ** passed to LockFileEx(). In this case, if the operation is pending, + ** block indefinitely until it is finished. + ** + ** Otherwise, wait for up to nMs ms for the operation to finish. nMs + ** may be set to INFINITE. + */ + if( !ret && GetLastError()==ERROR_IO_PENDING ){ + DWORD nDelay = (nMs==0 ? INFINITE : nMs); + DWORD res = osWaitForSingleObject(ovlp.hEvent, nDelay); + if( res==WAIT_OBJECT_0 ){ + ret = TRUE; + }else if( res==WAIT_TIMEOUT ){ +#if SQLITE_ENABLE_SETLK_TIMEOUT==1 + rc = SQLITE_BUSY_TIMEOUT; +#else + rc = SQLITE_BUSY; +#endif + }else{ + /* Some other error has occurred */ + rc = SQLITE_IOERR_LOCK; + } + + /* If it is still pending, cancel the LockFileEx() call. */ + osCancelIo(hFile); + } + + osCloseHandle(ovlp.hEvent); +#endif + } + + if( rc==SQLITE_OK && !ret ){ + rc = SQLITE_BUSY; + } + return rc; +} + /* ** Unlock a file region. */ @@ -49435,13 +49899,23 @@ static BOOL winUnlockFile( ovlp.Offset = offsetLow; ovlp.OffsetHigh = offsetHigh; return osUnlockFileEx(*phFile, 0, numBytesLow, numBytesHigh, &ovlp); +#ifdef SQLITE_WIN32_HAS_ANSI }else{ return osUnlockFile(*phFile, offsetLow, offsetHigh, numBytesLow, numBytesHigh); +#endif } #endif } +/* +** Remove an nByte lock starting at offset iOff from HANDLE h. +*/ +static int winHandleUnlock(HANDLE h, int iOff, int nByte){ + BOOL ret = winUnlockFile(&h, iOff, 0, nByte, 0); + return (ret ? SQLITE_OK : SQLITE_IOERR_UNLOCK); +} + /***************************************************************************** ** The next group of routines implement the I/O methods specified ** by the sqlite3_io_methods object. @@ -49455,66 +49929,70 @@ static BOOL winUnlockFile( #endif /* -** Move the current position of the file handle passed as the first -** argument to offset iOffset within the file. If successful, return 0. -** Otherwise, set pFile->lastErrno and return non-zero. +** Seek the file handle h to offset nByte of the file. +** +** If successful, return SQLITE_OK. Or, if an error occurs, return an SQLite +** error code. */ -static int winSeekFile(winFile *pFile, sqlite3_int64 iOffset){ +static int winHandleSeek(HANDLE h, sqlite3_int64 iOffset){ + int rc = SQLITE_OK; /* Return value */ + #if !SQLITE_OS_WINRT LONG upperBits; /* Most sig. 32 bits of new offset */ LONG lowerBits; /* Least sig. 32 bits of new offset */ DWORD dwRet; /* Value returned by SetFilePointer() */ - DWORD lastErrno; /* Value returned by GetLastError() */ - - OSTRACE(("SEEK file=%p, offset=%lld\n", pFile->h, iOffset)); upperBits = (LONG)((iOffset>>32) & 0x7fffffff); lowerBits = (LONG)(iOffset & 0xffffffff); + dwRet = osSetFilePointer(h, lowerBits, &upperBits, FILE_BEGIN); + /* API oddity: If successful, SetFilePointer() returns a dword ** containing the lower 32-bits of the new file-offset. Or, if it fails, ** it returns INVALID_SET_FILE_POINTER. However according to MSDN, ** INVALID_SET_FILE_POINTER may also be a valid new offset. So to determine ** whether an error has actually occurred, it is also necessary to call - ** GetLastError(). - */ - dwRet = osSetFilePointer(pFile->h, lowerBits, &upperBits, FILE_BEGIN); - - if( (dwRet==INVALID_SET_FILE_POINTER - && ((lastErrno = osGetLastError())!=NO_ERROR)) ){ - pFile->lastErrno = lastErrno; - winLogError(SQLITE_IOERR_SEEK, pFile->lastErrno, - "winSeekFile", pFile->zPath); - OSTRACE(("SEEK file=%p, rc=SQLITE_IOERR_SEEK\n", pFile->h)); - return 1; + ** GetLastError(). */ + if( dwRet==INVALID_SET_FILE_POINTER ){ + DWORD lastErrno = osGetLastError(); + if( lastErrno!=NO_ERROR ){ + rc = SQLITE_IOERR_SEEK; + } } - - OSTRACE(("SEEK file=%p, rc=SQLITE_OK\n", pFile->h)); - return 0; #else - /* - ** Same as above, except that this implementation works for WinRT. - */ - + /* This implementation works for WinRT. */ LARGE_INTEGER x; /* The new offset */ BOOL bRet; /* Value returned by SetFilePointerEx() */ x.QuadPart = iOffset; - bRet = osSetFilePointerEx(pFile->h, x, 0, FILE_BEGIN); + bRet = osSetFilePointerEx(h, x, 0, FILE_BEGIN); if(!bRet){ - pFile->lastErrno = osGetLastError(); - winLogError(SQLITE_IOERR_SEEK, pFile->lastErrno, - "winSeekFile", pFile->zPath); - OSTRACE(("SEEK file=%p, rc=SQLITE_IOERR_SEEK\n", pFile->h)); - return 1; + rc = SQLITE_IOERR_SEEK; } - - OSTRACE(("SEEK file=%p, rc=SQLITE_OK\n", pFile->h)); - return 0; #endif + + OSTRACE(("SEEK file=%p, offset=%lld rc=%s\n", h, iOffset, sqlite3ErrName(rc))); + return rc; } +/* +** Move the current position of the file handle passed as the first +** argument to offset iOffset within the file. If successful, return 0. +** Otherwise, set pFile->lastErrno and return non-zero. +*/ +static int winSeekFile(winFile *pFile, sqlite3_int64 iOffset){ + int rc; + + rc = winHandleSeek(pFile->h, iOffset); + if( rc!=SQLITE_OK ){ + pFile->lastErrno = osGetLastError(); + winLogError(rc, pFile->lastErrno, "winSeekFile", pFile->zPath); + } + return rc; +} + + #if SQLITE_MAX_MMAP_SIZE>0 /* Forward references to VFS helper methods used for memory mapped files */ static int winMapfile(winFile*, sqlite3_int64); @@ -49774,6 +50252,60 @@ static int winWrite( return SQLITE_OK; } +/* +** Truncate the file opened by handle h to nByte bytes in size. +*/ +static int winHandleTruncate(HANDLE h, sqlite3_int64 nByte){ + int rc = SQLITE_OK; /* Return code */ + rc = winHandleSeek(h, nByte); + if( rc==SQLITE_OK ){ + if( 0==osSetEndOfFile(h) ){ + rc = SQLITE_IOERR_TRUNCATE; + } + } + return rc; +} + +/* +** Determine the size in bytes of the file opened by the handle passed as +** the first argument. +*/ +static int winHandleSize(HANDLE h, sqlite3_int64 *pnByte){ + int rc = SQLITE_OK; + +#if SQLITE_OS_WINRT + FILE_STANDARD_INFO info; + BOOL b; + b = osGetFileInformationByHandleEx(h, FileStandardInfo, &info, sizeof(info)); + if( b ){ + *pnByte = info.EndOfFile.QuadPart; + }else{ + rc = SQLITE_IOERR_FSTAT; + } +#else + DWORD upperBits = 0; + DWORD lowerBits = 0; + + assert( pnByte ); + lowerBits = osGetFileSize(h, &upperBits); + *pnByte = (((sqlite3_int64)upperBits)<<32) + lowerBits; + if( lowerBits==INVALID_FILE_SIZE && osGetLastError()!=NO_ERROR ){ + rc = SQLITE_IOERR_FSTAT; + } +#endif + + return rc; +} + +/* +** Close the handle passed as the only argument. +*/ +static void winHandleClose(HANDLE h){ + if( h!=INVALID_HANDLE_VALUE ){ + osCloseHandle(h); + } +} + /* ** Truncate an open file to a specified size */ @@ -50029,8 +50561,9 @@ static int winFileSize(sqlite3_file *id, sqlite3_int64 *pSize){ ** Different API routines are called depending on whether or not this ** is Win9x or WinNT. */ -static int winGetReadLock(winFile *pFile){ +static int winGetReadLock(winFile *pFile, int bBlock){ int res; + DWORD mask = ~(bBlock ? LOCKFILE_FAIL_IMMEDIATELY : 0); OSTRACE(("READ-LOCK file=%p, lock=%d\n", pFile->h, pFile->locktype)); if( osIsNT() ){ #if SQLITE_OS_WINCE @@ -50040,7 +50573,7 @@ static int winGetReadLock(winFile *pFile){ */ res = winceLockFile(&pFile->h, SHARED_FIRST, 0, 1, 0); #else - res = winLockFile(&pFile->h, SQLITE_LOCKFILEEX_FLAGS, SHARED_FIRST, 0, + res = winLockFile(&pFile->h, SQLITE_LOCKFILEEX_FLAGS&mask, SHARED_FIRST, 0, SHARED_SIZE, 0); #endif } @@ -50049,7 +50582,7 @@ static int winGetReadLock(winFile *pFile){ int lk; sqlite3_randomness(sizeof(lk), &lk); pFile->sharedLockByte = (short)((lk & 0x7fffffff)%(SHARED_SIZE - 1)); - res = winLockFile(&pFile->h, SQLITE_LOCKFILE_FLAGS, + res = winLockFile(&pFile->h, SQLITE_LOCKFILE_FLAGS&mask, SHARED_FIRST+pFile->sharedLockByte, 0, 1, 0); } #endif @@ -50144,46 +50677,62 @@ static int winLock(sqlite3_file *id, int locktype){ assert( locktype!=PENDING_LOCK ); assert( locktype!=RESERVED_LOCK || pFile->locktype==SHARED_LOCK ); - /* Lock the PENDING_LOCK byte if we need to acquire a PENDING lock or + /* Lock the PENDING_LOCK byte if we need to acquire an EXCLUSIVE lock or ** a SHARED lock. If we are acquiring a SHARED lock, the acquisition of ** the PENDING_LOCK byte is temporary. */ newLocktype = pFile->locktype; - if( pFile->locktype==NO_LOCK - || (locktype==EXCLUSIVE_LOCK && pFile->locktype<=RESERVED_LOCK) + if( locktype==SHARED_LOCK + || (locktype==EXCLUSIVE_LOCK && pFile->locktype==RESERVED_LOCK) ){ int cnt = 3; - while( cnt-->0 && (res = winLockFile(&pFile->h, SQLITE_LOCKFILE_FLAGS, - PENDING_BYTE, 0, 1, 0))==0 ){ + + /* Flags for the LockFileEx() call. This should be an exclusive lock if + ** this call is to obtain EXCLUSIVE, or a shared lock if this call is to + ** obtain SHARED. */ + int flags = LOCKFILE_FAIL_IMMEDIATELY; + if( locktype==EXCLUSIVE_LOCK ){ + flags |= LOCKFILE_EXCLUSIVE_LOCK; + } + while( cnt>0 ){ /* Try 3 times to get the pending lock. This is needed to work ** around problems caused by indexing and/or anti-virus software on ** Windows systems. + ** ** If you are using this code as a model for alternative VFSes, do not - ** copy this retry logic. It is a hack intended for Windows only. - */ + ** copy this retry logic. It is a hack intended for Windows only. */ + res = winLockFile(&pFile->h, flags, PENDING_BYTE, 0, 1, 0); + if( res ) break; + lastErrno = osGetLastError(); OSTRACE(("LOCK-PENDING-FAIL file=%p, count=%d, result=%d\n", - pFile->h, cnt, res)); + pFile->h, cnt, res + )); + if( lastErrno==ERROR_INVALID_HANDLE ){ pFile->lastErrno = lastErrno; rc = SQLITE_IOERR_LOCK; OSTRACE(("LOCK-FAIL file=%p, count=%d, rc=%s\n", - pFile->h, cnt, sqlite3ErrName(rc))); + pFile->h, cnt, sqlite3ErrName(rc) + )); return rc; } - if( cnt ) sqlite3_win32_sleep(1); + + cnt--; + if( cnt>0 ) sqlite3_win32_sleep(1); } gotPendingLock = res; - if( !res ){ - lastErrno = osGetLastError(); - } } /* Acquire a shared lock */ if( locktype==SHARED_LOCK && res ){ assert( pFile->locktype==NO_LOCK ); - res = winGetReadLock(pFile); +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + res = winGetReadLock(pFile, pFile->bBlockOnConnect); +#else + res = winGetReadLock(pFile, 0); +#endif if( res ){ newLocktype = SHARED_LOCK; }else{ @@ -50221,7 +50770,7 @@ static int winLock(sqlite3_file *id, int locktype){ newLocktype = EXCLUSIVE_LOCK; }else{ lastErrno = osGetLastError(); - winGetReadLock(pFile); + winGetReadLock(pFile, 0); } } @@ -50301,7 +50850,7 @@ static int winUnlock(sqlite3_file *id, int locktype){ type = pFile->locktype; if( type>=EXCLUSIVE_LOCK ){ winUnlockFile(&pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0); - if( locktype==SHARED_LOCK && !winGetReadLock(pFile) ){ + if( locktype==SHARED_LOCK && !winGetReadLock(pFile, 0) ){ /* This should never happen. We should always be able to ** reacquire the read lock */ rc = winLogError(SQLITE_IOERR_UNLOCK, osGetLastError(), @@ -50511,6 +51060,28 @@ static int winFileControl(sqlite3_file *id, int op, void *pArg){ return rc; } #endif + +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + case SQLITE_FCNTL_LOCK_TIMEOUT: { + int iOld = pFile->iBusyTimeout; + int iNew = *(int*)pArg; +#if SQLITE_ENABLE_SETLK_TIMEOUT==1 + pFile->iBusyTimeout = (iNew < 0) ? INFINITE : (DWORD)iNew; +#elif SQLITE_ENABLE_SETLK_TIMEOUT==2 + pFile->iBusyTimeout = (DWORD)(!!iNew); +#else +# error "SQLITE_ENABLE_SETLK_TIMEOUT must be set to 1 or 2" +#endif + *(int*)pArg = iOld; + return SQLITE_OK; + } + case SQLITE_FCNTL_BLOCK_ON_CONNECT: { + int iNew = *(int*)pArg; + pFile->bBlockOnConnect = iNew; + return SQLITE_OK; + } +#endif /* SQLITE_ENABLE_SETLK_TIMEOUT */ + } OSTRACE(("FCNTL file=%p, rc=SQLITE_NOTFOUND\n", pFile->h)); return SQLITE_NOTFOUND; @@ -50591,23 +51162,27 @@ static int winShmMutexHeld(void) { ** ** The following fields are read-only after the object is created: ** -** fid ** zFilename ** ** Either winShmNode.mutex must be held or winShmNode.nRef==0 and ** winShmMutexHeld() is true when reading or writing any other field ** in this structure. ** +** File-handle hSharedShm is used to (a) take the DMS lock, (b) truncate +** the *-shm file if the DMS-locking protocol demands it, and (c) map +** regions of the *-shm file into memory using MapViewOfFile() or +** similar. Other locks are taken by individual clients using the +** winShm.hShm handles. */ struct winShmNode { sqlite3_mutex *mutex; /* Mutex to access this object */ char *zFilename; /* Name of the file */ - winFile hFile; /* File handle from winOpen */ + HANDLE hSharedShm; /* File handle open on zFilename */ + int isUnlocked; /* DMS lock has not yet been obtained */ + int isReadonly; /* True if read-only */ int szRegion; /* Size of shared-memory regions */ int nRegion; /* Size of array apRegion */ - u8 isReadonly; /* True if read-only */ - u8 isUnlocked; /* True if no DMS lock held */ struct ShmRegion { HANDLE hMap; /* File handle from CreateFileMapping */ @@ -50616,7 +51191,6 @@ struct winShmNode { DWORD lastErrno; /* The Windows errno from the last I/O error */ int nRef; /* Number of winShm objects pointing to this */ - winShm *pFirst; /* All winShm objects pointing to this */ winShmNode *pNext; /* Next in list of all winShmNode objects */ #if defined(SQLITE_DEBUG) || defined(SQLITE_HAVE_OS_TRACE) u8 nextShmId; /* Next available winShm.id value */ @@ -50632,23 +51206,15 @@ static winShmNode *winShmNodeList = 0; /* ** Structure used internally by this VFS to record the state of an -** open shared memory connection. -** -** The following fields are initialized when this object is created and -** are read-only thereafter: -** -** winShm.pShmNode -** winShm.id -** -** All other fields are read/write. The winShm.pShmNode->mutex must be held -** while accessing any read/write fields. +** open shared memory connection. There is one such structure for each +** winFile open on a wal mode database. */ struct winShm { winShmNode *pShmNode; /* The underlying winShmNode object */ - winShm *pNext; /* Next winShm with the same winShmNode */ - u8 hasMutex; /* True if holding the winShmNode mutex */ u16 sharedMask; /* Mask of shared locks held */ u16 exclMask; /* Mask of exclusive locks held */ + HANDLE hShm; /* File-handle on *-shm file. For locking. */ + int bReadonly; /* True if hShm is opened read-only */ #if defined(SQLITE_DEBUG) || defined(SQLITE_HAVE_OS_TRACE) u8 id; /* Id of this connection with its winShmNode */ #endif @@ -50660,50 +51226,6 @@ struct winShm { #define WIN_SHM_BASE ((22+SQLITE_SHM_NLOCK)*4) /* first lock byte */ #define WIN_SHM_DMS (WIN_SHM_BASE+SQLITE_SHM_NLOCK) /* deadman switch */ -/* -** Apply advisory locks for all n bytes beginning at ofst. -*/ -#define WINSHM_UNLCK 1 -#define WINSHM_RDLCK 2 -#define WINSHM_WRLCK 3 -static int winShmSystemLock( - winShmNode *pFile, /* Apply locks to this open shared-memory segment */ - int lockType, /* WINSHM_UNLCK, WINSHM_RDLCK, or WINSHM_WRLCK */ - int ofst, /* Offset to first byte to be locked/unlocked */ - int nByte /* Number of bytes to lock or unlock */ -){ - int rc = 0; /* Result code form Lock/UnlockFileEx() */ - - /* Access to the winShmNode object is serialized by the caller */ - assert( pFile->nRef==0 || sqlite3_mutex_held(pFile->mutex) ); - - OSTRACE(("SHM-LOCK file=%p, lock=%d, offset=%d, size=%d\n", - pFile->hFile.h, lockType, ofst, nByte)); - - /* Release/Acquire the system-level lock */ - if( lockType==WINSHM_UNLCK ){ - rc = winUnlockFile(&pFile->hFile.h, ofst, 0, nByte, 0); - }else{ - /* Initialize the locking parameters */ - DWORD dwFlags = LOCKFILE_FAIL_IMMEDIATELY; - if( lockType == WINSHM_WRLCK ) dwFlags |= LOCKFILE_EXCLUSIVE_LOCK; - rc = winLockFile(&pFile->hFile.h, dwFlags, ofst, 0, nByte, 0); - } - - if( rc!= 0 ){ - rc = SQLITE_OK; - }else{ - pFile->lastErrno = osGetLastError(); - rc = SQLITE_BUSY; - } - - OSTRACE(("SHM-LOCK file=%p, func=%s, errno=%lu, rc=%s\n", - pFile->hFile.h, (lockType == WINSHM_UNLCK) ? "winUnlockFile" : - "winLockFile", pFile->lastErrno, sqlite3ErrName(rc))); - - return rc; -} - /* Forward references to VFS methods */ static int winOpen(sqlite3_vfs*,const char*,sqlite3_file*,int,int*); static int winDelete(sqlite3_vfs *,const char*,int); @@ -50735,11 +51257,7 @@ static void winShmPurge(sqlite3_vfs *pVfs, int deleteFlag){ osGetCurrentProcessId(), i, bRc ? "ok" : "failed")); UNUSED_VARIABLE_VALUE(bRc); } - if( p->hFile.h!=NULL && p->hFile.h!=INVALID_HANDLE_VALUE ){ - SimulateIOErrorBenign(1); - winClose((sqlite3_file *)&p->hFile); - SimulateIOErrorBenign(0); - } + winHandleClose(p->hSharedShm); if( deleteFlag ){ SimulateIOErrorBenign(1); sqlite3BeginBenignMalloc(); @@ -50757,42 +51275,239 @@ static void winShmPurge(sqlite3_vfs *pVfs, int deleteFlag){ } /* -** The DMS lock has not yet been taken on shm file pShmNode. Attempt to -** take it now. Return SQLITE_OK if successful, or an SQLite error -** code otherwise. -** -** If the DMS cannot be locked because this is a readonly_shm=1 -** connection and no other process already holds a lock, return -** SQLITE_READONLY_CANTINIT and set pShmNode->isUnlocked=1. +** The DMS lock has not yet been taken on the shm file associated with +** pShmNode. Take the lock. Truncate the *-shm file if required. +** Return SQLITE_OK if successful, or an SQLite error code otherwise. */ -static int winLockSharedMemory(winShmNode *pShmNode){ - int rc = winShmSystemLock(pShmNode, WINSHM_WRLCK, WIN_SHM_DMS, 1); +static int winLockSharedMemory(winShmNode *pShmNode, DWORD nMs){ + HANDLE h = pShmNode->hSharedShm; + int rc = SQLITE_OK; + + assert( sqlite3_mutex_held(pShmNode->mutex) ); + rc = winHandleLockTimeout(h, WIN_SHM_DMS, 1, 1, 0); + if( rc==SQLITE_OK ){ + /* We have an EXCLUSIVE lock on the DMS byte. This means that this + ** is the first process to open the file. Truncate it to zero bytes + ** in this case. */ + if( pShmNode->isReadonly ){ + rc = SQLITE_READONLY_CANTINIT; + }else{ + rc = winHandleTruncate(h, 0); + } + + /* Release the EXCLUSIVE lock acquired above. */ + winUnlockFile(&h, WIN_SHM_DMS, 0, 1, 0); + }else if( (rc & 0xFF)==SQLITE_BUSY ){ + rc = SQLITE_OK; + } if( rc==SQLITE_OK ){ - if( pShmNode->isReadonly ){ - pShmNode->isUnlocked = 1; - winShmSystemLock(pShmNode, WINSHM_UNLCK, WIN_SHM_DMS, 1); - return SQLITE_READONLY_CANTINIT; - }else if( winTruncate((sqlite3_file*)&pShmNode->hFile, 0) ){ - winShmSystemLock(pShmNode, WINSHM_UNLCK, WIN_SHM_DMS, 1); - return winLogError(SQLITE_IOERR_SHMOPEN, osGetLastError(), - "winLockSharedMemory", pShmNode->zFilename); + /* Take a SHARED lock on the DMS byte. */ + rc = winHandleLockTimeout(h, WIN_SHM_DMS, 1, 0, nMs); + if( rc==SQLITE_OK ){ + pShmNode->isUnlocked = 0; } } - if( rc==SQLITE_OK ){ - winShmSystemLock(pShmNode, WINSHM_UNLCK, WIN_SHM_DMS, 1); - } + return rc; +} - return winShmSystemLock(pShmNode, WINSHM_RDLCK, WIN_SHM_DMS, 1); + +/* +** Convert a UTF-8 filename into whatever form the underlying +** operating system wants filenames in. Space to hold the result +** is obtained from malloc and must be freed by the calling +** function +** +** On Cygwin, 3 possible input forms are accepted: +** - If the filename starts with ":/" or ":\", +** it is converted to UTF-16 as-is. +** - If the filename contains '/', it is assumed to be a +** Cygwin absolute path, it is converted to a win32 +** absolute path in UTF-16. +** - Otherwise it must be a filename only, the win32 filename +** is returned in UTF-16. +** Note: If the function cygwin_conv_path() fails, only +** UTF-8 -> UTF-16 conversion will be done. This can only +** happen when the file path >32k, in which case winUtf8ToUnicode() +** will fail too. +*/ +static void *winConvertFromUtf8Filename(const char *zFilename){ + void *zConverted = 0; + if( osIsNT() ){ +#ifdef __CYGWIN__ + int nChar; + LPWSTR zWideFilename; + + if( osCygwin_conv_path && !(winIsDriveLetterAndColon(zFilename) + && winIsDirSep(zFilename[2])) ){ + i64 nByte; + int convertflag = CCP_POSIX_TO_WIN_W; + if( !strchr(zFilename, '/') ) convertflag |= CCP_RELATIVE; + nByte = (i64)osCygwin_conv_path(convertflag, + zFilename, 0, 0); + if( nByte>0 ){ + zConverted = sqlite3MallocZero(12+(u64)nByte); + if ( zConverted==0 ){ + return zConverted; + } + zWideFilename = zConverted; + /* Filenames should be prefixed, except when converted + * full path already starts with "\\?\". */ + if( osCygwin_conv_path(convertflag, zFilename, + zWideFilename+4, nByte)==0 ){ + if( (convertflag&CCP_RELATIVE) ){ + memmove(zWideFilename, zWideFilename+4, nByte); + }else if( memcmp(zWideFilename+4, L"\\\\", 4) ){ + memcpy(zWideFilename, L"\\\\?\\", 8); + }else if( zWideFilename[6]!='?' ){ + memmove(zWideFilename+6, zWideFilename+4, nByte); + memcpy(zWideFilename, L"\\\\?\\UNC", 14); + }else{ + memmove(zWideFilename, zWideFilename+4, nByte); + } + return zConverted; + } + sqlite3_free(zConverted); + } + } + nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, NULL, 0); + if( nChar==0 ){ + return 0; + } + zWideFilename = sqlite3MallocZero( nChar*sizeof(WCHAR)+12 ); + if( zWideFilename==0 ){ + return 0; + } + nChar = osMultiByteToWideChar(CP_UTF8, 0, zFilename, -1, + zWideFilename, nChar); + if( nChar==0 ){ + sqlite3_free(zWideFilename); + zWideFilename = 0; + }else if( nChar>MAX_PATH + && winIsDriveLetterAndColon(zFilename) + && winIsDirSep(zFilename[2]) ){ + memmove(zWideFilename+4, zWideFilename, nChar*sizeof(WCHAR)); + zWideFilename[2] = '\\'; + memcpy(zWideFilename, L"\\\\?\\", 8); + }else if( nChar>MAX_PATH + && winIsDirSep(zFilename[0]) && winIsDirSep(zFilename[1]) + && zFilename[2] != '?' ){ + memmove(zWideFilename+6, zWideFilename, nChar*sizeof(WCHAR)); + memcpy(zWideFilename, L"\\\\?\\UNC", 14); + } + zConverted = zWideFilename; +#else + zConverted = winUtf8ToUnicode(zFilename); +#endif /* __CYGWIN__ */ + } +#if defined(SQLITE_WIN32_HAS_ANSI) && defined(_WIN32) + else{ + zConverted = winUtf8ToMbcs(zFilename, osAreFileApisANSI()); + } +#endif + /* caller will handle out of memory */ + return zConverted; } /* -** Open the shared-memory area associated with database file pDbFd. +** This function is used to open a handle on a *-shm file. ** -** When opening a new shared-memory file, if no other instances of that -** file are currently open, in this process or in other processes, then -** the file must be truncated to zero length or have its header cleared. +** If SQLITE_ENABLE_SETLK_TIMEOUT is defined at build time, then the file +** is opened with FILE_FLAG_OVERLAPPED specified. If not, it is not. +*/ +static int winHandleOpen( + const char *zUtf8, /* File to open */ + int *pbReadonly, /* IN/OUT: True for readonly handle */ + HANDLE *ph /* OUT: New HANDLE for file */ +){ + int rc = SQLITE_OK; + void *zConverted = 0; + int bReadonly = *pbReadonly; + HANDLE h = INVALID_HANDLE_VALUE; + +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + const DWORD flag_overlapped = FILE_FLAG_OVERLAPPED; +#else + const DWORD flag_overlapped = 0; +#endif + + /* Convert the filename to the system encoding. */ + zConverted = winConvertFromUtf8Filename(zUtf8); + if( zConverted==0 ){ + OSTRACE(("OPEN name=%s, rc=SQLITE_IOERR_NOMEM", zUtf8)); + rc = SQLITE_IOERR_NOMEM_BKPT; + goto winopenfile_out; + } + + /* Ensure the file we are trying to open is not actually a directory. */ + if( winIsDir(zConverted) ){ + OSTRACE(("OPEN name=%s, rc=SQLITE_CANTOPEN_ISDIR", zUtf8)); + rc = SQLITE_CANTOPEN_ISDIR; + goto winopenfile_out; + } + + /* TODO: platforms. + ** TODO: retry-on-ioerr. + */ + if( osIsNT() ){ +#if SQLITE_OS_WINRT + CREATEFILE2_EXTENDED_PARAMETERS extendedParameters; + memset(&extendedParameters, 0, sizeof(extendedParameters)); + extendedParameters.dwSize = sizeof(extendedParameters); + extendedParameters.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; + extendedParameters.dwFileFlags = flag_overlapped; + extendedParameters.dwSecurityQosFlags = SECURITY_ANONYMOUS; + h = osCreateFile2((LPCWSTR)zConverted, + (GENERIC_READ | (bReadonly ? 0 : GENERIC_WRITE)),/* dwDesiredAccess */ + FILE_SHARE_READ | FILE_SHARE_WRITE, /* dwShareMode */ + OPEN_ALWAYS, /* dwCreationDisposition */ + &extendedParameters + ); +#else + h = osCreateFileW((LPCWSTR)zConverted, /* lpFileName */ + (GENERIC_READ | (bReadonly ? 0 : GENERIC_WRITE)), /* dwDesiredAccess */ + FILE_SHARE_READ | FILE_SHARE_WRITE, /* dwShareMode */ + NULL, /* lpSecurityAttributes */ + OPEN_ALWAYS, /* dwCreationDisposition */ + FILE_ATTRIBUTE_NORMAL|flag_overlapped, + NULL + ); +#endif + }else{ + /* Due to pre-processor directives earlier in this file, + ** SQLITE_WIN32_HAS_ANSI is always defined if osIsNT() is false. */ +#ifdef SQLITE_WIN32_HAS_ANSI + h = osCreateFileA((LPCSTR)zConverted, + (GENERIC_READ | (bReadonly ? 0 : GENERIC_WRITE)), /* dwDesiredAccess */ + FILE_SHARE_READ | FILE_SHARE_WRITE, /* dwShareMode */ + NULL, /* lpSecurityAttributes */ + OPEN_ALWAYS, /* dwCreationDisposition */ + FILE_ATTRIBUTE_NORMAL|flag_overlapped, + NULL + ); +#endif + } + + if( h==INVALID_HANDLE_VALUE ){ + if( bReadonly==0 ){ + bReadonly = 1; + rc = winHandleOpen(zUtf8, &bReadonly, &h); + }else{ + rc = SQLITE_CANTOPEN_BKPT; + } + } + + winopenfile_out: + sqlite3_free(zConverted); + *pbReadonly = bReadonly; + *ph = h; + return rc; +} + + +/* +** Open the shared-memory area associated with database file pDbFd. */ static int winOpenSharedMemory(winFile *pDbFd){ struct winShm *p; /* The connection to be opened */ @@ -50804,98 +51519,83 @@ static int winOpenSharedMemory(winFile *pDbFd){ assert( pDbFd->pShm==0 ); /* Not previously opened */ /* Allocate space for the new sqlite3_shm object. Also speculatively - ** allocate space for a new winShmNode and filename. - */ + ** allocate space for a new winShmNode and filename. */ p = sqlite3MallocZero( sizeof(*p) ); if( p==0 ) return SQLITE_IOERR_NOMEM_BKPT; nName = sqlite3Strlen30(pDbFd->zPath); - pNew = sqlite3MallocZero( sizeof(*pShmNode) + nName + 17 ); + pNew = sqlite3MallocZero( sizeof(*pShmNode) + (i64)nName + 17 ); if( pNew==0 ){ sqlite3_free(p); return SQLITE_IOERR_NOMEM_BKPT; } pNew->zFilename = (char*)&pNew[1]; + pNew->hSharedShm = INVALID_HANDLE_VALUE; + pNew->isUnlocked = 1; sqlite3_snprintf(nName+15, pNew->zFilename, "%s-shm", pDbFd->zPath); sqlite3FileSuffix3(pDbFd->zPath, pNew->zFilename); + /* Open a file-handle on the *-shm file for this connection. This file-handle + ** is only used for locking. The mapping of the *-shm file is created using + ** the shared file handle in winShmNode.hSharedShm. */ + p->bReadonly = sqlite3_uri_boolean(pDbFd->zPath, "readonly_shm", 0); + rc = winHandleOpen(pNew->zFilename, &p->bReadonly, &p->hShm); + /* Look to see if there is an existing winShmNode that can be used. - ** If no matching winShmNode currently exists, create a new one. - */ + ** If no matching winShmNode currently exists, then create a new one. */ winShmEnterMutex(); for(pShmNode = winShmNodeList; pShmNode; pShmNode=pShmNode->pNext){ /* TBD need to come up with better match here. Perhaps - ** use FILE_ID_BOTH_DIR_INFO Structure. - */ + ** use FILE_ID_BOTH_DIR_INFO Structure. */ if( sqlite3StrICmp(pShmNode->zFilename, pNew->zFilename)==0 ) break; } - if( pShmNode ){ - sqlite3_free(pNew); - }else{ - int inFlags = SQLITE_OPEN_WAL; - int outFlags = 0; - + if( pShmNode==0 ){ pShmNode = pNew; - pNew = 0; - ((winFile*)(&pShmNode->hFile))->h = INVALID_HANDLE_VALUE; - pShmNode->pNext = winShmNodeList; - winShmNodeList = pShmNode; + /* Allocate a mutex for this winShmNode object, if one is required. */ if( sqlite3GlobalConfig.bCoreMutex ){ pShmNode->mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_FAST); - if( pShmNode->mutex==0 ){ - rc = SQLITE_IOERR_NOMEM_BKPT; - goto shm_open_err; + if( pShmNode->mutex==0 ) rc = SQLITE_IOERR_NOMEM_BKPT; + } + + /* Open a file-handle to use for mappings, and for the DMS lock. */ + if( rc==SQLITE_OK ){ + HANDLE h = INVALID_HANDLE_VALUE; + pShmNode->isReadonly = p->bReadonly; + rc = winHandleOpen(pNew->zFilename, &pShmNode->isReadonly, &h); + pShmNode->hSharedShm = h; + } + + /* If successful, link the new winShmNode into the global list. If an + ** error occurred, free the object. */ + if( rc==SQLITE_OK ){ + pShmNode->pNext = winShmNodeList; + winShmNodeList = pShmNode; + pNew = 0; + }else{ + sqlite3_mutex_free(pShmNode->mutex); + if( pShmNode->hSharedShm!=INVALID_HANDLE_VALUE ){ + osCloseHandle(pShmNode->hSharedShm); } } - - if( 0==sqlite3_uri_boolean(pDbFd->zPath, "readonly_shm", 0) ){ - inFlags |= SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE; - }else{ - inFlags |= SQLITE_OPEN_READONLY; - } - rc = winOpen(pDbFd->pVfs, pShmNode->zFilename, - (sqlite3_file*)&pShmNode->hFile, - inFlags, &outFlags); - if( rc!=SQLITE_OK ){ - rc = winLogError(rc, osGetLastError(), "winOpenShm", - pShmNode->zFilename); - goto shm_open_err; - } - if( outFlags==SQLITE_OPEN_READONLY ) pShmNode->isReadonly = 1; - - rc = winLockSharedMemory(pShmNode); - if( rc!=SQLITE_OK && rc!=SQLITE_READONLY_CANTINIT ) goto shm_open_err; } - /* Make the new connection a child of the winShmNode */ - p->pShmNode = pShmNode; + /* If no error has occurred, link the winShm object to the winShmNode and + ** the winShm to pDbFd. */ + if( rc==SQLITE_OK ){ + p->pShmNode = pShmNode; + pShmNode->nRef++; #if defined(SQLITE_DEBUG) || defined(SQLITE_HAVE_OS_TRACE) - p->id = pShmNode->nextShmId++; + p->id = pShmNode->nextShmId++; #endif - pShmNode->nRef++; - pDbFd->pShm = p; + pDbFd->pShm = p; + }else if( p ){ + winHandleClose(p->hShm); + sqlite3_free(p); + } + + assert( rc!=SQLITE_OK || pShmNode->isUnlocked==0 || pShmNode->nRegion==0 ); winShmLeaveMutex(); - - /* The reference count on pShmNode has already been incremented under - ** the cover of the winShmEnterMutex() mutex and the pointer from the - ** new (struct winShm) object to the pShmNode has been set. All that is - ** left to do is to link the new object into the linked list starting - ** at pShmNode->pFirst. This must be done while holding the pShmNode->mutex - ** mutex. - */ - sqlite3_mutex_enter(pShmNode->mutex); - p->pNext = pShmNode->pFirst; - pShmNode->pFirst = p; - sqlite3_mutex_leave(pShmNode->mutex); - return rc; - - /* Jump here on any error */ -shm_open_err: - winShmSystemLock(pShmNode, WINSHM_UNLCK, WIN_SHM_DMS, 1); - winShmPurge(pDbFd->pVfs, 0); /* This call frees pShmNode if required */ - sqlite3_free(p); sqlite3_free(pNew); - winShmLeaveMutex(); return rc; } @@ -50910,27 +51610,19 @@ static int winShmUnmap( winFile *pDbFd; /* Database holding shared-memory */ winShm *p; /* The connection to be closed */ winShmNode *pShmNode; /* The underlying shared-memory file */ - winShm **pp; /* For looping over sibling connections */ pDbFd = (winFile*)fd; p = pDbFd->pShm; if( p==0 ) return SQLITE_OK; + if( p->hShm!=INVALID_HANDLE_VALUE ){ + osCloseHandle(p->hShm); + } + pShmNode = p->pShmNode; - - /* Remove connection p from the set of connections associated - ** with pShmNode */ - sqlite3_mutex_enter(pShmNode->mutex); - for(pp=&pShmNode->pFirst; (*pp)!=p; pp = &(*pp)->pNext){} - *pp = p->pNext; - - /* Free the connection p */ - sqlite3_free(p); - pDbFd->pShm = 0; - sqlite3_mutex_leave(pShmNode->mutex); + winShmEnterMutex(); /* If pShmNode->nRef has reached 0, then close the underlying - ** shared-memory file, too */ - winShmEnterMutex(); + ** shared-memory file, too. */ assert( pShmNode->nRef>0 ); pShmNode->nRef--; if( pShmNode->nRef==0 ){ @@ -50938,6 +51630,9 @@ static int winShmUnmap( } winShmLeaveMutex(); + /* Free the connection p */ + sqlite3_free(p); + pDbFd->pShm = 0; return SQLITE_OK; } @@ -50952,10 +51647,9 @@ static int winShmLock( ){ winFile *pDbFd = (winFile*)fd; /* Connection holding shared memory */ winShm *p = pDbFd->pShm; /* The shared memory being locked */ - winShm *pX; /* For looping over all siblings */ winShmNode *pShmNode; int rc = SQLITE_OK; /* Result code */ - u16 mask; /* Mask of locks to take or release */ + u16 mask = (u16)((1U<<(ofst+n)) - (1U<pShmNode; @@ -50969,85 +51663,81 @@ static int winShmLock( || flags==(SQLITE_SHM_UNLOCK | SQLITE_SHM_EXCLUSIVE) ); assert( n==1 || (flags & SQLITE_SHM_EXCLUSIVE)!=0 ); - mask = (u16)((1U<<(ofst+n)) - (1U<1 || mask==(1<mutex); - if( flags & SQLITE_SHM_UNLOCK ){ - u16 allMask = 0; /* Mask of locks held by siblings */ + /* Check that, if this to be a blocking lock, no locks that occur later + ** in the following list than the lock being obtained are already held: + ** + ** 1. Recovery lock (ofst==2). + ** 2. Checkpointer lock (ofst==1). + ** 3. Write lock (ofst==0). + ** 4. Read locks (ofst>=3 && ofstexclMask|p->sharedMask); + assert( (flags & SQLITE_SHM_UNLOCK) || pDbFd->iBusyTimeout==0 || ( + (ofst!=2 || lockMask==0) + && (ofst!=1 || lockMask==0 || lockMask==2) + && (ofst!=0 || lockMask<3) + && (ofst<3 || lockMask<(1<pFirst; pX; pX=pX->pNext){ - if( pX==p ) continue; - assert( (pX->exclMask & (p->exclMask|p->sharedMask))==0 ); - allMask |= pX->sharedMask; - } + /* Check if there is any work to do. There are three cases: + ** + ** a) An unlock operation where there are locks to unlock, + ** b) An shared lock where the requested lock is not already held + ** c) An exclusive lock where the requested lock is not already held + ** + ** The SQLite core never requests an exclusive lock that it already holds. + ** This is assert()ed immediately below. */ + assert( flags!=(SQLITE_SHM_EXCLUSIVE|SQLITE_SHM_LOCK) + || 0==(p->exclMask & mask) + ); + if( ((flags & SQLITE_SHM_UNLOCK) && ((p->exclMask|p->sharedMask) & mask)) + || (flags==(SQLITE_SHM_SHARED|SQLITE_SHM_LOCK) && 0==(p->sharedMask & mask)) + || (flags==(SQLITE_SHM_EXCLUSIVE|SQLITE_SHM_LOCK)) + ){ - /* Unlock the system-level locks */ - if( (mask & allMask)==0 ){ - rc = winShmSystemLock(pShmNode, WINSHM_UNLCK, ofst+WIN_SHM_BASE, n); - }else{ - rc = SQLITE_OK; - } + if( flags & SQLITE_SHM_UNLOCK ){ + /* Case (a) - unlock. */ - /* Undo the local locks */ - if( rc==SQLITE_OK ){ - p->exclMask &= ~mask; - p->sharedMask &= ~mask; - } - }else if( flags & SQLITE_SHM_SHARED ){ - u16 allShared = 0; /* Union of locks held by connections other than "p" */ + assert( (p->exclMask & p->sharedMask)==0 ); + assert( !(flags & SQLITE_SHM_EXCLUSIVE) || (p->exclMask & mask)==mask ); + assert( !(flags & SQLITE_SHM_SHARED) || (p->sharedMask & mask)==mask ); - /* Find out which shared locks are already held by sibling connections. - ** If any sibling already holds an exclusive lock, go ahead and return - ** SQLITE_BUSY. - */ - for(pX=pShmNode->pFirst; pX; pX=pX->pNext){ - if( (pX->exclMask & mask)!=0 ){ - rc = SQLITE_BUSY; - break; - } - allShared |= pX->sharedMask; - } + rc = winHandleUnlock(p->hShm, ofst+WIN_SHM_BASE, n); - /* Get shared locks at the system level, if necessary */ - if( rc==SQLITE_OK ){ - if( (allShared & mask)==0 ){ - rc = winShmSystemLock(pShmNode, WINSHM_RDLCK, ofst+WIN_SHM_BASE, n); - }else{ - rc = SQLITE_OK; - } - } - - /* Get the local shared locks */ - if( rc==SQLITE_OK ){ - p->sharedMask |= mask; - } - }else{ - /* Make sure no sibling connections hold locks that will block this - ** lock. If any do, return SQLITE_BUSY right away. - */ - for(pX=pShmNode->pFirst; pX; pX=pX->pNext){ - if( (pX->exclMask & mask)!=0 || (pX->sharedMask & mask)!=0 ){ - rc = SQLITE_BUSY; - break; - } - } - - /* Get the exclusive locks at the system level. Then if successful - ** also mark the local connection as being locked. - */ - if( rc==SQLITE_OK ){ - rc = winShmSystemLock(pShmNode, WINSHM_WRLCK, ofst+WIN_SHM_BASE, n); + /* If successful, also clear the bits in sharedMask/exclMask */ if( rc==SQLITE_OK ){ - assert( (p->sharedMask & mask)==0 ); - p->exclMask |= mask; + p->exclMask = (p->exclMask & ~mask); + p->sharedMask = (p->sharedMask & ~mask); + } + }else{ + int bExcl = ((flags & SQLITE_SHM_EXCLUSIVE) ? 1 : 0); + DWORD nMs = winFileBusyTimeout(pDbFd); + rc = winHandleLockTimeout(p->hShm, ofst+WIN_SHM_BASE, n, bExcl, nMs); + if( rc==SQLITE_OK ){ + if( bExcl ){ + p->exclMask = (p->exclMask | mask); + }else{ + p->sharedMask = (p->sharedMask | mask); + } } } } - sqlite3_mutex_leave(pShmNode->mutex); - OSTRACE(("SHM-LOCK pid=%lu, id=%d, sharedMask=%03x, exclMask=%03x, rc=%s\n", - osGetCurrentProcessId(), p->id, p->sharedMask, p->exclMask, - sqlite3ErrName(rc))); + + OSTRACE(( + "SHM-LOCK(%d,%d,%d) pid=%lu, id=%d, sharedMask=%03x, exclMask=%03x," + " rc=%s\n", + ofst, n, flags, + osGetCurrentProcessId(), p->id, p->sharedMask, p->exclMask, + sqlite3ErrName(rc)) + ); return rc; } @@ -51109,13 +51799,15 @@ static int winShmMap( sqlite3_mutex_enter(pShmNode->mutex); if( pShmNode->isUnlocked ){ - rc = winLockSharedMemory(pShmNode); + /* Take the DMS lock. */ + assert( pShmNode->nRegion==0 ); + rc = winLockSharedMemory(pShmNode, winFileBusyTimeout(pDbFd)); if( rc!=SQLITE_OK ) goto shmpage_out; - pShmNode->isUnlocked = 0; } - assert( szRegion==pShmNode->szRegion || pShmNode->nRegion==0 ); + assert( szRegion==pShmNode->szRegion || pShmNode->nRegion==0 ); if( pShmNode->nRegion<=iRegion ){ + HANDLE hShared = pShmNode->hSharedShm; struct ShmRegion *apNew; /* New aRegion[] array */ int nByte = (iRegion+1)*szRegion; /* Minimum required file size */ sqlite3_int64 sz; /* Current size of wal-index file */ @@ -51126,10 +51818,9 @@ static int winShmMap( ** Check to see if it has been allocated (i.e. if the wal-index file is ** large enough to contain the requested region). */ - rc = winFileSize((sqlite3_file *)&pShmNode->hFile, &sz); + rc = winHandleSize(hShared, &sz); if( rc!=SQLITE_OK ){ - rc = winLogError(SQLITE_IOERR_SHMSIZE, osGetLastError(), - "winShmMap1", pDbFd->zPath); + rc = winLogError(rc, osGetLastError(), "winShmMap1", pDbFd->zPath); goto shmpage_out; } @@ -51138,19 +51829,17 @@ static int winShmMap( ** zero, exit early. *pp will be set to NULL and SQLITE_OK returned. ** ** Alternatively, if isWrite is non-zero, use ftruncate() to allocate - ** the requested memory region. - */ + ** the requested memory region. */ if( !isWrite ) goto shmpage_out; - rc = winTruncate((sqlite3_file *)&pShmNode->hFile, nByte); + rc = winHandleTruncate(hShared, nByte); if( rc!=SQLITE_OK ){ - rc = winLogError(SQLITE_IOERR_SHMSIZE, osGetLastError(), - "winShmMap2", pDbFd->zPath); + rc = winLogError(rc, osGetLastError(), "winShmMap2", pDbFd->zPath); goto shmpage_out; } } /* Map the requested memory region into this processes address space. */ - apNew = (struct ShmRegion *)sqlite3_realloc64( + apNew = (struct ShmRegion*)sqlite3_realloc64( pShmNode->aRegion, (iRegion+1)*sizeof(apNew[0]) ); if( !apNew ){ @@ -51169,18 +51858,13 @@ static int winShmMap( void *pMap = 0; /* Mapped memory region */ #if SQLITE_OS_WINRT - hMap = osCreateFileMappingFromApp(pShmNode->hFile.h, - NULL, protect, nByte, NULL - ); + hMap = osCreateFileMappingFromApp(hShared, NULL, protect, nByte, NULL); #elif defined(SQLITE_WIN32_HAS_WIDE) - hMap = osCreateFileMappingW(pShmNode->hFile.h, - NULL, protect, 0, nByte, NULL - ); + hMap = osCreateFileMappingW(hShared, NULL, protect, 0, nByte, NULL); #elif defined(SQLITE_WIN32_HAS_ANSI) && SQLITE_WIN32_CREATEFILEMAPPINGA - hMap = osCreateFileMappingA(pShmNode->hFile.h, - NULL, protect, 0, nByte, NULL - ); + hMap = osCreateFileMappingA(hShared, NULL, protect, 0, nByte, NULL); #endif + OSTRACE(("SHM-MAP-CREATE pid=%lu, region=%d, size=%d, rc=%s\n", osGetCurrentProcessId(), pShmNode->nRegion, nByte, hMap ? "ok" : "failed")); @@ -51223,7 +51907,9 @@ shmpage_out: }else{ *pp = 0; } - if( pShmNode->isReadonly && rc==SQLITE_OK ) rc = SQLITE_READONLY; + if( pShmNode->isReadonly && rc==SQLITE_OK ){ + rc = SQLITE_READONLY; + } sqlite3_mutex_leave(pShmNode->mutex); return rc; } @@ -51543,47 +52229,6 @@ static winVfsAppData winNolockAppData = { ** sqlite3_vfs object. */ -#if defined(__CYGWIN__) -/* -** Convert a filename from whatever the underlying operating system -** supports for filenames into UTF-8. Space to hold the result is -** obtained from malloc and must be freed by the calling function. -*/ -static char *winConvertToUtf8Filename(const void *zFilename){ - char *zConverted = 0; - if( osIsNT() ){ - zConverted = winUnicodeToUtf8(zFilename); - } -#ifdef SQLITE_WIN32_HAS_ANSI - else{ - zConverted = winMbcsToUtf8(zFilename, osAreFileApisANSI()); - } -#endif - /* caller will handle out of memory */ - return zConverted; -} -#endif - -/* -** Convert a UTF-8 filename into whatever form the underlying -** operating system wants filenames in. Space to hold the result -** is obtained from malloc and must be freed by the calling -** function. -*/ -static void *winConvertFromUtf8Filename(const char *zFilename){ - void *zConverted = 0; - if( osIsNT() ){ - zConverted = winUtf8ToUnicode(zFilename); - } -#ifdef SQLITE_WIN32_HAS_ANSI - else{ - zConverted = winUtf8ToMbcs(zFilename, osAreFileApisANSI()); - } -#endif - /* caller will handle out of memory */ - return zConverted; -} - /* ** This function returns non-zero if the specified UTF-8 string buffer ** ends with a directory separator character or one was successfully @@ -51596,7 +52241,14 @@ static int winMakeEndInDirSep(int nBuf, char *zBuf){ if( winIsDirSep(zBuf[nLen-1]) ){ return 1; }else if( nLen+1mxPathname; nBuf = nMax + 2; + nMax = pVfs->mxPathname; + nBuf = 2 + (i64)nMax; zBuf = sqlite3MallocZero( nBuf ); if( !zBuf ){ OSTRACE(("TEMP-FILENAME rc=SQLITE_IOERR_NOMEM\n")); @@ -51673,7 +52326,7 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){ } #if defined(__CYGWIN__) - else{ + else if( osGetenv!=NULL ){ static const char *azDirs[] = { 0, /* getenv("SQLITE_TMPDIR") */ 0, /* getenv("TMPDIR") */ @@ -51689,11 +52342,11 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){ unsigned int i; const char *zDir = 0; - if( !azDirs[0] ) azDirs[0] = getenv("SQLITE_TMPDIR"); - if( !azDirs[1] ) azDirs[1] = getenv("TMPDIR"); - if( !azDirs[2] ) azDirs[2] = getenv("TMP"); - if( !azDirs[3] ) azDirs[3] = getenv("TEMP"); - if( !azDirs[4] ) azDirs[4] = getenv("USERPROFILE"); + if( !azDirs[0] ) azDirs[0] = osGetenv("SQLITE_TMPDIR"); + if( !azDirs[1] ) azDirs[1] = osGetenv("TMPDIR"); + if( !azDirs[2] ) azDirs[2] = osGetenv("TMP"); + if( !azDirs[3] ) azDirs[3] = osGetenv("TEMP"); + if( !azDirs[4] ) azDirs[4] = osGetenv("USERPROFILE"); for(i=0; inOut ){ + /* SQLite assumes that xFullPathname() nul-terminates the output buffer + ** even if it returns an error. */ + zOut[iOff] = '\0'; + return SQLITE_CANTOPEN_BKPT; + } + sqlite3_snprintf(nOut-iOff, &zOut[iOff], "%s", zPath); + return SQLITE_OK; +} +#endif /* __CYGWIN__ */ /* ** Turn a relative pathname into a full pathname. Write the full @@ -52476,8 +53178,8 @@ static int winFullPathnameNoMutex( int nFull, /* Size of output buffer in bytes */ char *zFull /* Output buffer */ ){ -#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(__CYGWIN__) - DWORD nByte; +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT + int nByte; void *zConverted; char *zOut; #endif @@ -52490,64 +53192,82 @@ static int winFullPathnameNoMutex( zRelative++; } -#if defined(__CYGWIN__) SimulateIOError( return SQLITE_ERROR ); - UNUSED_PARAMETER(nFull); - assert( nFull>=pVfs->mxPathname ); - if ( sqlite3_data_directory && !winIsVerbatimPathname(zRelative) ){ - /* - ** NOTE: We are dealing with a relative path name and the data - ** directory has been set. Therefore, use it as the basis - ** for converting the relative path name to an absolute - ** one by prepending the data directory and a slash. - */ - char *zOut = sqlite3MallocZero( pVfs->mxPathname+1 ); - if( !zOut ){ - return SQLITE_IOERR_NOMEM_BKPT; - } - if( cygwin_conv_path( - (osIsNT() ? CCP_POSIX_TO_WIN_W : CCP_POSIX_TO_WIN_A) | - CCP_RELATIVE, zRelative, zOut, pVfs->mxPathname+1)<0 ){ - sqlite3_free(zOut); - return winLogError(SQLITE_CANTOPEN_CONVPATH, (DWORD)errno, - "winFullPathname1", zRelative); - }else{ - char *zUtf8 = winConvertToUtf8Filename(zOut); - if( !zUtf8 ){ - sqlite3_free(zOut); - return SQLITE_IOERR_NOMEM_BKPT; - } - sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s%c%s", - sqlite3_data_directory, winGetDirSep(), zUtf8); - sqlite3_free(zUtf8); - sqlite3_free(zOut); - } - }else{ - char *zOut = sqlite3MallocZero( pVfs->mxPathname+1 ); - if( !zOut ){ - return SQLITE_IOERR_NOMEM_BKPT; - } - if( cygwin_conv_path( - (osIsNT() ? CCP_POSIX_TO_WIN_W : CCP_POSIX_TO_WIN_A), - zRelative, zOut, pVfs->mxPathname+1)<0 ){ - sqlite3_free(zOut); - return winLogError(SQLITE_CANTOPEN_CONVPATH, (DWORD)errno, - "winFullPathname2", zRelative); - }else{ - char *zUtf8 = winConvertToUtf8Filename(zOut); - if( !zUtf8 ){ - sqlite3_free(zOut); - return SQLITE_IOERR_NOMEM_BKPT; - } - sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s", zUtf8); - sqlite3_free(zUtf8); - sqlite3_free(zOut); + +#ifdef __CYGWIN__ + if( osGetcwd ){ + zFull[nFull-1] = '\0'; + if( !winIsDriveLetterAndColon(zRelative) || !winIsDirSep(zRelative[2]) ){ + int rc = SQLITE_OK; + int nLink = 1; /* Number of symbolic links followed so far */ + const char *zIn = zRelative; /* Input path for each iteration of loop */ + char *zDel = 0; + struct stat buf; + + UNUSED_PARAMETER(pVfs); + + do { + /* Call lstat() on path zIn. Set bLink to true if the path is a symbolic + ** link, or false otherwise. */ + int bLink = 0; + if( osLstat && osReadlink ) { + if( osLstat(zIn, &buf)!=0 ){ + int myErrno = osErrno; + if( myErrno!=ENOENT ){ + rc = winLogError(SQLITE_CANTOPEN_BKPT, (DWORD)myErrno, "lstat", zIn); + } + }else{ + bLink = ((buf.st_mode & 0170000) == 0120000); + } + + if( bLink ){ + if( zDel==0 ){ + zDel = sqlite3MallocZero(nFull); + if( zDel==0 ) rc = SQLITE_NOMEM; + }else if( ++nLink>SQLITE_MAX_SYMLINKS ){ + rc = SQLITE_CANTOPEN_BKPT; + } + + if( rc==SQLITE_OK ){ + nByte = osReadlink(zIn, zDel, nFull-1); + if( nByte ==(DWORD)-1 ){ + rc = winLogError(SQLITE_CANTOPEN_BKPT, (DWORD)osErrno, "readlink", zIn); + }else{ + if( zDel[0]!='/' ){ + int n; + for(n = sqlite3Strlen30(zIn); n>0 && zIn[n-1]!='/'; n--); + if( nByte+n+1>nFull ){ + rc = SQLITE_CANTOPEN_BKPT; + }else{ + memmove(&zDel[n], zDel, nByte+1); + memcpy(zDel, zIn, n); + nByte += n; + } + } + zDel[nByte] = '\0'; + } + } + + zIn = zDel; + } + } + + assert( rc!=SQLITE_OK || zIn!=zFull || zIn[0]=='/' ); + if( rc==SQLITE_OK && zIn!=zFull ){ + rc = mkFullPathname(zIn, zFull, nFull); + } + if( bLink==0 ) break; + zIn = zFull; + }while( rc==SQLITE_OK ); + + sqlite3_free(zDel); + winSimplifyName(zFull); + return rc; } } - return SQLITE_OK; -#endif +#endif /* __CYGWIN__ */ -#if (SQLITE_OS_WINCE || SQLITE_OS_WINRT) && !defined(__CYGWIN__) +#if (SQLITE_OS_WINCE || SQLITE_OS_WINRT) && defined(_WIN32) SimulateIOError( return SQLITE_ERROR ); /* WinCE has no concept of a relative pathname, or so I am told. */ /* WinRT has no way to convert a relative path to an absolute one. */ @@ -52566,7 +53286,8 @@ static int winFullPathnameNoMutex( return SQLITE_OK; #endif -#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(__CYGWIN__) +#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT +#if defined(_WIN32) /* It's odd to simulate an io-error here, but really this is just ** using the io-error infrastructure to test that SQLite handles this ** function failing. This function could fail if, for example, the @@ -52584,6 +53305,7 @@ static int winFullPathnameNoMutex( sqlite3_data_directory, winGetDirSep(), zRelative); return SQLITE_OK; } +#endif zConverted = winConvertFromUtf8Filename(zRelative); if( zConverted==0 ){ return SQLITE_IOERR_NOMEM_BKPT; @@ -52622,13 +53344,12 @@ static int winFullPathnameNoMutex( return winLogError(SQLITE_CANTOPEN_FULLPATH, osGetLastError(), "winFullPathname3", zRelative); } - nByte += 3; - zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) ); + zTemp = sqlite3MallocZero( nByte*sizeof(zTemp[0]) + 3*sizeof(zTemp[0]) ); if( zTemp==0 ){ sqlite3_free(zConverted); return SQLITE_IOERR_NOMEM_BKPT; } - nByte = osGetFullPathNameA((char*)zConverted, nByte, zTemp, 0); + nByte = osGetFullPathNameA((char*)zConverted, nByte+3, zTemp, 0); if( nByte==0 ){ sqlite3_free(zConverted); sqlite3_free(zTemp); @@ -52641,7 +53362,26 @@ static int winFullPathnameNoMutex( } #endif if( zOut ){ +#ifdef __CYGWIN__ + if( memcmp(zOut, "\\\\?\\", 4) ){ + sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s", zOut); + }else if( memcmp(zOut+4, "UNC\\", 4) ){ + sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s", zOut+4); + }else{ + char *p = zOut+6; + *p = '\\'; + if( osGetcwd ){ + /* On Cygwin, UNC paths use forward slashes */ + while( *p ){ + if( *p=='\\' ) *p = '/'; + ++p; + } + } + sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s", zOut+6); + } +#else sqlite3_snprintf(MIN(nFull, pVfs->mxPathname), zFull, "%s", zOut); +#endif /* __CYGWIN__ */ sqlite3_free(zOut); return SQLITE_OK; }else{ @@ -52671,25 +53411,8 @@ static int winFullPathname( */ static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){ HANDLE h; -#if defined(__CYGWIN__) - int nFull = pVfs->mxPathname+1; - char *zFull = sqlite3MallocZero( nFull ); - void *zConverted = 0; - if( zFull==0 ){ - OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)0)); - return 0; - } - if( winFullPathname(pVfs, zFilename, nFull, zFull)!=SQLITE_OK ){ - sqlite3_free(zFull); - OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)0)); - return 0; - } - zConverted = winConvertFromUtf8Filename(zFull); - sqlite3_free(zFull); -#else void *zConverted = winConvertFromUtf8Filename(zFilename); UNUSED_PARAMETER(pVfs); -#endif if( zConverted==0 ){ OSTRACE(("DLOPEN name=%s, handle=%p\n", zFilename, (void*)0)); return 0; @@ -53038,7 +53761,7 @@ SQLITE_API int sqlite3_os_init(void){ /* Double-check that the aSyscall[] array has been constructed ** correctly. See ticket [bb3a86e890c8e96ab] */ - assert( ArraySize(aSyscall)==80 ); + assert( ArraySize(aSyscall)==89 ); /* get memory map allocation granularity */ memset(&winSysInfo, 0, sizeof(SYSTEM_INFO)); @@ -53657,13 +54380,13 @@ static int memdbOpen( } if( p==0 ){ MemStore **apNew; - p = sqlite3Malloc( sizeof(*p) + szName + 3 ); + p = sqlite3Malloc( sizeof(*p) + (i64)szName + 3 ); if( p==0 ){ sqlite3_mutex_leave(pVfsMutex); return SQLITE_NOMEM; } apNew = sqlite3Realloc(memdb_g.apMemStore, - sizeof(apNew[0])*(memdb_g.nMemStore+1) ); + sizeof(apNew[0])*(1+(i64)memdb_g.nMemStore) ); if( apNew==0 ){ sqlite3_free(p); sqlite3_mutex_leave(pVfsMutex); @@ -54096,7 +54819,7 @@ SQLITE_PRIVATE int sqlite3MemdbInit(void){ ** no fewer collisions than the no-op *1. */ #define BITVEC_HASH(X) (((X)*1)%BITVEC_NINT) -#define BITVEC_NPTR (BITVEC_USIZE/sizeof(Bitvec *)) +#define BITVEC_NPTR ((u32)(BITVEC_USIZE/sizeof(Bitvec *))) /* @@ -54245,7 +54968,9 @@ bitvec_set_rehash: }else{ memcpy(aiValues, p->u.aHash, sizeof(p->u.aHash)); memset(p->u.apSub, 0, sizeof(p->u.apSub)); - p->iDivisor = (p->iSize + BITVEC_NPTR - 1)/BITVEC_NPTR; + p->iDivisor = p->iSize/BITVEC_NPTR; + if( (p->iSize%BITVEC_NPTR)!=0 ) p->iDivisor++; + if( p->iDivisoriDivisor = BITVEC_NBIT; rc = sqlite3BitvecSet(p, i); for(j=0; jiSize<=BITVEC_NBIT ){ - p->u.aBitmap[i/BITVEC_SZELEM] &= ~(1 << (i&(BITVEC_SZELEM-1))); + p->u.aBitmap[i/BITVEC_SZELEM] &= ~(BITVEC_TELEM)(1<<(i&(BITVEC_SZELEM-1))); }else{ unsigned int j; u32 *aiValues = pBuf; @@ -54330,7 +55055,7 @@ SQLITE_PRIVATE u32 sqlite3BitvecSize(Bitvec *p){ ** individual bits within V. */ #define SETBIT(V,I) V[I>>3] |= (1<<(I&7)) -#define CLEARBIT(V,I) V[I>>3] &= ~(1<<(I&7)) +#define CLEARBIT(V,I) V[I>>3] &= ~(BITVEC_TELEM)(1<<(I&7)) #define TESTBIT(V,I) (V[I>>3]&(1<<(I&7)))!=0 /* @@ -54373,7 +55098,7 @@ SQLITE_PRIVATE int sqlite3BitvecBuiltinTest(int sz, int *aOp){ /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = sqlite3BitvecCreate( sz ); - pV = sqlite3MallocZero( (sz+7)/8 + 1 ); + pV = sqlite3MallocZero( (7+(i64)sz)/8 + 1 ); pTmpSpace = sqlite3_malloc64(BITVEC_SZ); if( pBitvec==0 || pV==0 || pTmpSpace==0 ) goto bitvec_end; @@ -55614,10 +56339,6 @@ static SQLITE_WSD struct PCacheGlobal { sqlite3_mutex *mutex; /* Mutex for accessing the following: */ PgFreeslot *pFree; /* Free page blocks */ int nFreeSlot; /* Number of unused pcache slots */ - /* The following value requires a mutex to change. We skip the mutex on - ** reading because (1) most platforms read a 32-bit integer atomically and - ** (2) even if an incorrect value is read, no great harm is done since this - ** is really just an optimization. */ int bUnderPressure; /* True if low on PAGECACHE memory */ } pcache1_g; @@ -55665,7 +56386,7 @@ SQLITE_PRIVATE void sqlite3PCacheBufferSetup(void *pBuf, int sz, int n){ pcache1.nReserve = n>90 ? 10 : (n/10 + 1); pcache1.pStart = pBuf; pcache1.pFree = 0; - pcache1.bUnderPressure = 0; + AtomicStore(&pcache1.bUnderPressure,0); while( n-- ){ p = (PgFreeslot*)pBuf; p->pNext = pcache1.pFree; @@ -55733,7 +56454,7 @@ static void *pcache1Alloc(int nByte){ if( p ){ pcache1.pFree = pcache1.pFree->pNext; pcache1.nFreeSlot--; - pcache1.bUnderPressure = pcache1.nFreeSlot=0 ); sqlite3StatusHighwater(SQLITE_STATUS_PAGECACHE_SIZE, nByte); sqlite3StatusUp(SQLITE_STATUS_PAGECACHE_USED, 1); @@ -55772,7 +56493,7 @@ static void pcache1Free(void *p){ pSlot->pNext = pcache1.pFree; pcache1.pFree = pSlot; pcache1.nFreeSlot++; - pcache1.bUnderPressure = pcache1.nFreeSlotszPage+pCache->szExtra)<=pcache1.szSlot ){ - return pcache1.bUnderPressure; + return AtomicLoad(&pcache1.bUnderPressure); }else{ return sqlite3HeapNearlyFull(); } @@ -55920,12 +56641,12 @@ static int pcache1UnderMemoryPressure(PCache1 *pCache){ */ static void pcache1ResizeHash(PCache1 *p){ PgHdr1 **apNew; - unsigned int nNew; - unsigned int i; + u64 nNew; + u32 i; assert( sqlite3_mutex_held(p->pGroup->mutex) ); - nNew = p->nHash*2; + nNew = 2*(u64)p->nHash; if( nNew<256 ){ nNew = 256; } @@ -56148,7 +56869,7 @@ static void pcache1Destroy(sqlite3_pcache *p); static sqlite3_pcache *pcache1Create(int szPage, int szExtra, int bPurgeable){ PCache1 *pCache; /* The newly created page cache */ PGroup *pGroup; /* The group the new page cache will belong to */ - int sz; /* Bytes of memory required to allocate the new cache */ + i64 sz; /* Bytes of memory required to allocate the new cache */ assert( (szPage & (szPage-1))==0 && szPage>=512 && szPage<=65536 ); assert( szExtra < 300 ); @@ -58036,6 +58757,9 @@ struct Pager { Wal *pWal; /* Write-ahead log used by "journal_mode=wal" */ char *zWal; /* File name for write-ahead log */ #endif +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + sqlite3 *dbWal; +#endif }; /* @@ -58627,7 +59351,7 @@ static void checkPage(PgHdr *pPg){ ** If an error occurs while reading from the journal file, an SQLite ** error code is returned. */ -static int readSuperJournal(sqlite3_file *pJrnl, char *zSuper, u32 nSuper){ +static int readSuperJournal(sqlite3_file *pJrnl, char *zSuper, u64 nSuper){ int rc; /* Return code */ u32 len; /* Length in bytes of super-journal name */ i64 szJ; /* Total size in bytes of journal file pJrnl */ @@ -59182,6 +59906,15 @@ static void pager_unlock(Pager *pPager){ if( pagerUseWal(pPager) ){ assert( !isOpen(pPager->jfd) ); + if( pPager->eState==PAGER_ERROR ){ + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + sqlite3WalEndWriteTransaction(pPager->pWal); + } sqlite3WalEndReadTransaction(pPager->pWal); pPager->eState = PAGER_OPEN; }else if( !pPager->exclusiveMode ){ @@ -59863,12 +60596,12 @@ static int pager_delsuper(Pager *pPager, const char *zSuper){ char *zJournal; /* Pointer to one journal within MJ file */ char *zSuperPtr; /* Space to hold super-journal filename */ char *zFree = 0; /* Free this buffer */ - int nSuperPtr; /* Amount of space allocated to zSuperPtr[] */ + i64 nSuperPtr; /* Amount of space allocated to zSuperPtr[] */ /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile * 2); + pSuper = (sqlite3_file *)sqlite3MallocZero(2 * (i64)pVfs->szOsFile); if( !pSuper ){ rc = SQLITE_NOMEM_BKPT; pJournal = 0; @@ -59886,11 +60619,14 @@ static int pager_delsuper(Pager *pPager, const char *zSuper){ */ rc = sqlite3OsFileSize(pSuper, &nSuperJournal); if( rc!=SQLITE_OK ) goto delsuper_out; - nSuperPtr = pVfs->mxPathname+1; + nSuperPtr = 1 + (i64)pVfs->mxPathname; + assert( nSuperJournal>=0 && nSuperPtr>0 ); zFree = sqlite3Malloc(4 + nSuperJournal + nSuperPtr + 2); if( !zFree ){ rc = SQLITE_NOMEM_BKPT; goto delsuper_out; + }else{ + assert( nSuperJournal<=0x7fffffff ); } zFree[0] = zFree[1] = zFree[2] = zFree[3] = 0; zSuperJournal = &zFree[4]; @@ -60151,7 +60887,7 @@ static int pager_playback(Pager *pPager, int isHot){ ** for pageSize. */ zSuper = pPager->pTmpSpace; - rc = readSuperJournal(pPager->jfd, zSuper, pPager->pVfs->mxPathname+1); + rc = readSuperJournal(pPager->jfd, zSuper, 1+(i64)pPager->pVfs->mxPathname); if( rc==SQLITE_OK && zSuper[0] ){ rc = sqlite3OsAccess(pVfs, zSuper, SQLITE_ACCESS_EXISTS, &res); } @@ -60290,7 +61026,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = &pPager->pTmpSpace[4]; - rc = readSuperJournal(pPager->jfd, zSuper, pPager->pVfs->mxPathname+1); + rc = readSuperJournal(pPager->jfd, zSuper, 1+(i64)pPager->pVfs->mxPathname); testcase( rc!=SQLITE_OK ); } if( rc==SQLITE_OK @@ -62061,6 +62797,7 @@ SQLITE_PRIVATE int sqlite3PagerOpen( const char *zUri = 0; /* URI args to copy */ int nUriByte = 1; /* Number of bytes of URI args at *zUri */ + /* Figure out how much space is required for each journal file-handle ** (there are two of them, the main journal and the sub-journal). */ journalFileSize = ROUND8(sqlite3JournalSize(pVfs)); @@ -62086,8 +62823,8 @@ SQLITE_PRIVATE int sqlite3PagerOpen( */ if( zFilename && zFilename[0] ){ const char *z; - nPathname = pVfs->mxPathname+1; - zPathname = sqlite3DbMallocRaw(0, nPathname*2); + nPathname = pVfs->mxPathname + 1; + zPathname = sqlite3DbMallocRaw(0, 2*(i64)nPathname); if( zPathname==0 ){ return SQLITE_NOMEM_BKPT; } @@ -62174,14 +62911,14 @@ SQLITE_PRIVATE int sqlite3PagerOpen( ROUND8(sizeof(*pPager)) + /* Pager structure */ ROUND8(pcacheSize) + /* PCache object */ ROUND8(pVfs->szOsFile) + /* The main db file */ - journalFileSize * 2 + /* The two journal files */ + (u64)journalFileSize * 2 + /* The two journal files */ SQLITE_PTRSIZE + /* Space to hold a pointer */ 4 + /* Database prefix */ - nPathname + 1 + /* database filename */ - nUriByte + /* query parameters */ - nPathname + 8 + 1 + /* Journal filename */ + (u64)nPathname + 1 + /* database filename */ + (u64)nUriByte + /* query parameters */ + (u64)nPathname + 8 + 1 + /* Journal filename */ #ifndef SQLITE_OMIT_WAL - nPathname + 4 + 1 + /* WAL filename */ + (u64)nPathname + 4 + 1 + /* WAL filename */ #endif 3 /* Terminator */ ); @@ -64904,6 +65641,11 @@ static int pagerOpenWal(Pager *pPager){ pPager->fd, pPager->zWal, pPager->exclusiveMode, pPager->journalSizeLimit, &pPager->pWal ); +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + if( rc==SQLITE_OK ){ + sqlite3WalDb(pPager->pWal, pPager->dbWal); + } +#endif } pagerFixMaplimit(pPager); @@ -65023,6 +65765,7 @@ SQLITE_PRIVATE int sqlite3PagerWalWriteLock(Pager *pPager, int bLock){ ** blocking locks are required. */ SQLITE_PRIVATE void sqlite3PagerWalDb(Pager *pPager, sqlite3 *db){ + pPager->dbWal = db; if( pagerUseWal(pPager) ){ sqlite3WalDb(pPager->pWal, db); } @@ -65636,6 +66379,11 @@ struct WalCkptInfo { /* ** An open write-ahead log file is represented by an instance of the ** following object. +** +** writeLock: +** This is usually set to 1 whenever the WRITER lock is held. However, +** if it is set to 2, then the WRITER lock is held but must be released +** by walHandleException() if a SEH exception is thrown. */ struct Wal { sqlite3_vfs *pVfs; /* The VFS used to create pDbFd */ @@ -65726,9 +66474,13 @@ struct WalIterator { u32 *aPgno; /* Array of page numbers. */ int nEntry; /* Nr. of entries in aPgno[] and aIndex[] */ int iZero; /* Frame number associated with aPgno[0] */ - } aSegment[1]; /* One for every 32KB page in the wal-index */ + } aSegment[FLEXARRAY]; /* One for every 32KB page in the wal-index */ }; +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ +#define SZ_WALITERATOR(N) \ + (offsetof(WalIterator,aSegment)*(N)*sizeof(struct WalSegment)) + /* ** Define the parameters of the hash tables in the wal-index file. There ** is a hash-table following every HASHTABLE_NPAGE page numbers in the @@ -65887,7 +66639,7 @@ static SQLITE_NOINLINE int walIndexPageRealloc( /* Enlarge the pWal->apWiData[] array if required */ if( pWal->nWiData<=iPage ){ - sqlite3_int64 nByte = sizeof(u32*)*(iPage+1); + sqlite3_int64 nByte = sizeof(u32*)*(1+(i64)iPage); volatile u32 **apNew; apNew = (volatile u32 **)sqlite3Realloc((void *)pWal->apWiData, nByte); if( !apNew ){ @@ -65996,10 +66748,8 @@ static void walChecksumBytes( s1 = s2 = 0; } - assert( nByte>=8 ); - assert( (nByte&0x00000007)==0 ); - assert( nByte<=65536 ); - assert( nByte%4==0 ); + /* nByte is a multiple of 8 between 8 and 65536 */ + assert( nByte>=8 && (nByte&7)==0 && nByte<=65536 ); if( !nativeCksum ){ do { @@ -67089,8 +67839,7 @@ static int walIteratorInit(Wal *pWal, u32 nBackfill, WalIterator **pp){ /* Allocate space for the WalIterator object. */ nSegment = walFramePage(iLast) + 1; - nByte = sizeof(WalIterator) - + (nSegment-1)*sizeof(struct WalSegment) + nByte = SZ_WALITERATOR(nSegment) + iLast*sizeof(ht_slot); p = (WalIterator *)sqlite3_malloc64(nByte + sizeof(ht_slot) * (iLast>HASHTABLE_NPAGE?HASHTABLE_NPAGE:iLast) @@ -67161,7 +67910,7 @@ static int walEnableBlockingMs(Wal *pWal, int nMs){ static int walEnableBlocking(Wal *pWal){ int res = 0; if( pWal->db ){ - int tmout = pWal->db->busyTimeout; + int tmout = pWal->db->setlkTimeout; if( tmout ){ res = walEnableBlockingMs(pWal, tmout); } @@ -67547,7 +68296,9 @@ static int walHandleException(Wal *pWal){ static const int S = 1; static const int E = (1<lockMask & ~( + u32 mUnlock; + if( pWal->writeLock==2 ) pWal->writeLock = 0; + mUnlock = pWal->lockMask & ~( (pWal->readLock<0 ? 0 : (S << WAL_READ_LOCK(pWal->readLock))) | (pWal->writeLock ? (E << WAL_WRITE_LOCK) : 0) | (pWal->ckptLock ? (E << WAL_CKPT_LOCK) : 0) @@ -67819,7 +68570,12 @@ static int walIndexReadHdr(Wal *pWal, int *pChanged){ if( bWriteLock || SQLITE_OK==(rc = walLockExclusive(pWal, WAL_WRITE_LOCK, 1)) ){ - pWal->writeLock = 1; + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if( !bWriteLock ) pWal->writeLock = 2; if( SQLITE_OK==(rc = walIndexPage(pWal, 0, &page0)) ){ badHdr = walIndexTryHdr(pWal, pChanged); if( badHdr ){ @@ -68183,7 +68939,6 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int *pCnt){ rc = walIndexReadHdr(pWal, pChanged); } #ifdef SQLITE_ENABLE_SETLK_TIMEOUT - walDisableBlocking(pWal); if( rc==SQLITE_BUSY_TIMEOUT ){ rc = SQLITE_BUSY; *pCnt |= WAL_RETRY_BLOCKED_MASK; @@ -68198,6 +68953,7 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int *pCnt){ ** WAL_RETRY this routine will be called again and will probably be ** right on the second iteration. */ + (void)walEnableBlocking(pWal); if( pWal->apWiData[0]==0 ){ /* This branch is taken when the xShmMap() method returns SQLITE_BUSY. ** We assume this is a transient condition, so return WAL_RETRY. The @@ -68214,6 +68970,7 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int *pCnt){ rc = SQLITE_BUSY_RECOVERY; } } + walDisableBlocking(pWal); if( rc!=SQLITE_OK ){ return rc; } @@ -68604,8 +69361,11 @@ SQLITE_PRIVATE int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){ ** read-lock. */ SQLITE_PRIVATE void sqlite3WalEndReadTransaction(Wal *pWal){ - sqlite3WalEndWriteTransaction(pWal); +#ifndef SQLITE_ENABLE_SETLK_TIMEOUT + assert( pWal->writeLock==0 || pWal->readLock<0 ); +#endif if( pWal->readLock>=0 ){ + sqlite3WalEndWriteTransaction(pWal); walUnlockShared(pWal, WAL_READ_LOCK(pWal->readLock)); pWal->readLock = -1; } @@ -68798,7 +69558,7 @@ SQLITE_PRIVATE int sqlite3WalBeginWriteTransaction(Wal *pWal){ ** read-transaction was even opened, making this call a no-op. ** Return early. */ if( pWal->writeLock ){ - assert( !memcmp(&pWal->hdr,(void *)walIndexHdr(pWal),sizeof(WalIndexHdr)) ); + assert( !memcmp(&pWal->hdr,(void*)pWal->apWiData[0],sizeof(WalIndexHdr)) ); return SQLITE_OK; } #endif @@ -68898,6 +69658,7 @@ SQLITE_PRIVATE int sqlite3WalUndo(Wal *pWal, int (*xUndo)(void *, Pgno), void *p if( iMax!=pWal->hdr.mxFrame ) walCleanupHash(pWal); } SEH_EXCEPT( rc = SQLITE_IOERR_IN_PAGE; ) + pWal->iReCksum = 0; } return rc; } @@ -68945,6 +69706,9 @@ SQLITE_PRIVATE int sqlite3WalSavepointUndo(Wal *pWal, u32 *aWalData){ walCleanupHash(pWal); } SEH_EXCEPT( rc = SQLITE_IOERR_IN_PAGE; ) + if( pWal->iReCksum>pWal->hdr.mxFrame ){ + pWal->iReCksum = 0; + } } return rc; @@ -70247,6 +71011,12 @@ struct CellInfo { */ #define BTCURSOR_MAX_DEPTH 20 +/* +** Maximum amount of storage local to a database page, regardless of +** page size. +*/ +#define BT_MAX_LOCAL 65501 /* 65536 - 35 */ + /* ** A cursor is a pointer to a particular entry within a particular ** b-tree within a database file. @@ -70655,7 +71425,7 @@ SQLITE_PRIVATE int sqlite3BtreeHoldsMutex(Btree *p){ */ static void SQLITE_NOINLINE btreeEnterAll(sqlite3 *db){ int i; - int skipOk = 1; + u8 skipOk = 1; Btree *p; assert( sqlite3_mutex_held(db->mutex) ); for(i=0; inDb; i++){ @@ -71511,7 +72281,7 @@ static int saveCursorKey(BtCursor *pCur){ ** below. */ void *pKey; pCur->nKey = sqlite3BtreePayloadSize(pCur); - pKey = sqlite3Malloc( pCur->nKey + 9 + 8 ); + pKey = sqlite3Malloc( ((i64)pCur->nKey) + 9 + 8 ); if( pKey ){ rc = sqlite3BtreePayload(pCur, 0, (int)pCur->nKey, pKey); if( rc==SQLITE_OK ){ @@ -71801,7 +72571,7 @@ SQLITE_PRIVATE void sqlite3BtreeCursorHint(BtCursor *pCur, int eHintType, ...){ */ SQLITE_PRIVATE void sqlite3BtreeCursorHintFlags(BtCursor *pCur, unsigned x){ assert( x==BTREE_SEEK_EQ || x==BTREE_BULKLOAD || x==0 ); - pCur->hints = x; + pCur->hints = (u8)x; } @@ -71995,14 +72765,15 @@ static SQLITE_NOINLINE void btreeParseCellAdjustSizeForOverflow( static int btreePayloadToLocal(MemPage *pPage, i64 nPayload){ int maxLocal; /* Maximum amount of payload held locally */ maxLocal = pPage->maxLocal; + assert( nPayload>=0 ); if( nPayload<=maxLocal ){ - return nPayload; + return (int)nPayload; }else{ int minLocal; /* Minimum amount of payload held locally */ int surplus; /* Overflow payload available for local storage */ minLocal = pPage->minLocal; - surplus = minLocal + (nPayload - minLocal)%(pPage->pBt->usableSize-4); - return ( surplus <= maxLocal ) ? surplus : minLocal; + surplus = (int)(minLocal +(nPayload - minLocal)%(pPage->pBt->usableSize-4)); + return (surplus <= maxLocal) ? surplus : minLocal; } } @@ -72112,11 +72883,13 @@ static void btreeParseCellPtr( pInfo->pPayload = pIter; testcase( nPayload==pPage->maxLocal ); testcase( nPayload==(u32)pPage->maxLocal+1 ); + assert( nPayload>=0 ); + assert( pPage->maxLocal <= BT_MAX_LOCAL ); if( nPayload<=pPage->maxLocal ){ /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - pInfo->nSize = nPayload + (u16)(pIter - pCell); + pInfo->nSize = (u16)nPayload + (u16)(pIter - pCell); if( pInfo->nSize<4 ) pInfo->nSize = 4; pInfo->nLocal = (u16)nPayload; }else{ @@ -72149,11 +72922,13 @@ static void btreeParseCellPtrIndex( pInfo->pPayload = pIter; testcase( nPayload==pPage->maxLocal ); testcase( nPayload==(u32)pPage->maxLocal+1 ); + assert( nPayload>=0 ); + assert( pPage->maxLocal <= BT_MAX_LOCAL ); if( nPayload<=pPage->maxLocal ){ /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - pInfo->nSize = nPayload + (u16)(pIter - pCell); + pInfo->nSize = (u16)nPayload + (u16)(pIter - pCell); if( pInfo->nSize<4 ) pInfo->nSize = 4; pInfo->nLocal = (u16)nPayload; }else{ @@ -72692,14 +73467,14 @@ static SQLITE_INLINE int allocateSpace(MemPage *pPage, int nByte, int *pIdx){ ** at the end of the page. So do additional corruption checks inside this ** routine and return SQLITE_CORRUPT if any problems are found. */ -static int freeSpace(MemPage *pPage, u16 iStart, u16 iSize){ - u16 iPtr; /* Address of ptr to next freeblock */ - u16 iFreeBlk; /* Address of the next freeblock */ +static int freeSpace(MemPage *pPage, int iStart, int iSize){ + int iPtr; /* Address of ptr to next freeblock */ + int iFreeBlk; /* Address of the next freeblock */ u8 hdr; /* Page header size. 0 or 100 */ - u8 nFrag = 0; /* Reduction in fragmentation */ - u16 iOrigSize = iSize; /* Original value of iSize */ - u16 x; /* Offset to cell content area */ - u32 iEnd = iStart + iSize; /* First byte past the iStart buffer */ + int nFrag = 0; /* Reduction in fragmentation */ + int iOrigSize = iSize; /* Original value of iSize */ + int x; /* Offset to cell content area */ + int iEnd = iStart + iSize; /* First byte past the iStart buffer */ unsigned char *data = pPage->aData; /* Page content */ u8 *pTmp; /* Temporary ptr into data[] */ @@ -72726,7 +73501,7 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 iSize){ } iPtr = iFreeBlk; } - if( iFreeBlk>pPage->pBt->usableSize-4 ){ /* TH3: corrupt081.100 */ + if( iFreeBlk>(int)pPage->pBt->usableSize-4 ){ /* TH3: corrupt081.100 */ return SQLITE_CORRUPT_PAGE(pPage); } assert( iFreeBlk>iPtr || iFreeBlk==0 || CORRUPT_DB ); @@ -72741,7 +73516,7 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 iSize){ nFrag = iFreeBlk - iEnd; if( iEnd>iFreeBlk ) return SQLITE_CORRUPT_PAGE(pPage); iEnd = iFreeBlk + get2byte(&data[iFreeBlk+2]); - if( iEnd > pPage->pBt->usableSize ){ + if( iEnd > (int)pPage->pBt->usableSize ){ return SQLITE_CORRUPT_PAGE(pPage); } iSize = iEnd - iStart; @@ -72762,7 +73537,7 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 iSize){ } } if( nFrag>data[hdr+7] ) return SQLITE_CORRUPT_PAGE(pPage); - data[hdr+7] -= nFrag; + data[hdr+7] -= (u8)nFrag; } pTmp = &data[hdr+5]; x = get2byte(pTmp); @@ -72783,7 +73558,8 @@ static int freeSpace(MemPage *pPage, u16 iStart, u16 iSize){ /* Insert the new freeblock into the freelist */ put2byte(&data[iPtr], iStart); put2byte(&data[iStart], iFreeBlk); - put2byte(&data[iStart+2], iSize); + assert( iSize>=0 && iSize<=0xffff ); + put2byte(&data[iStart+2], (u16)iSize); } pPage->nFree += iOrigSize; return SQLITE_OK; @@ -73009,7 +73785,7 @@ static int btreeInitPage(MemPage *pPage){ assert( pBt->pageSize>=512 && pBt->pageSize<=65536 ); pPage->maskPage = (u16)(pBt->pageSize - 1); pPage->nOverflow = 0; - pPage->cellOffset = pPage->hdrOffset + 8 + pPage->childPtrSize; + pPage->cellOffset = (u16)(pPage->hdrOffset + 8 + pPage->childPtrSize); pPage->aCellIdx = data + pPage->childPtrSize + 8; pPage->aDataEnd = pPage->aData + pBt->pageSize; pPage->aDataOfst = pPage->aData + pPage->childPtrSize; @@ -73043,8 +73819,8 @@ static int btreeInitPage(MemPage *pPage){ static void zeroPage(MemPage *pPage, int flags){ unsigned char *data = pPage->aData; BtShared *pBt = pPage->pBt; - u8 hdr = pPage->hdrOffset; - u16 first; + int hdr = pPage->hdrOffset; + int first; assert( sqlite3PagerPagenumber(pPage->pDbPage)==pPage->pgno || CORRUPT_DB ); assert( sqlite3PagerGetExtra(pPage->pDbPage) == (void*)pPage ); @@ -73061,7 +73837,7 @@ static void zeroPage(MemPage *pPage, int flags){ put2byte(&data[hdr+5], pBt->usableSize); pPage->nFree = (u16)(pBt->usableSize - first); decodeFlags(pPage, flags); - pPage->cellOffset = first; + pPage->cellOffset = (u16)first; pPage->aDataEnd = &data[pBt->pageSize]; pPage->aCellIdx = &data[first]; pPage->aDataOfst = &data[pPage->childPtrSize]; @@ -73847,7 +74623,7 @@ SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int pageSize, int nReserve, BtShared *pBt = p->pBt; assert( nReserve>=0 && nReserve<=255 ); sqlite3BtreeEnter(p); - pBt->nReserveWanted = nReserve; + pBt->nReserveWanted = (u8)nReserve; x = pBt->pageSize - pBt->usableSize; if( nReservebtsFlags & BTS_PAGESIZE_FIXED ){ @@ -73953,7 +74729,7 @@ SQLITE_PRIVATE int sqlite3BtreeSecureDelete(Btree *p, int newFlag){ assert( BTS_FAST_SECURE==(BTS_OVERWRITE|BTS_SECURE_DELETE) ); if( newFlag>=0 ){ p->pBt->btsFlags &= ~BTS_FAST_SECURE; - p->pBt->btsFlags |= BTS_SECURE_DELETE*newFlag; + p->pBt->btsFlags |= (u16)(BTS_SECURE_DELETE*newFlag); } b = (p->pBt->btsFlags & BTS_FAST_SECURE)/BTS_SECURE_DELETE; sqlite3BtreeLeave(p); @@ -74473,6 +75249,13 @@ static SQLITE_NOINLINE int btreeBeginTrans( (void)sqlite3PagerWalWriteLock(pPager, 0); unlockBtreeIfUnused(pBt); } +#if defined(SQLITE_ENABLE_SETLK_TIMEOUT) + if( rc==SQLITE_BUSY_TIMEOUT ){ + /* If a blocking lock timed out, break out of the loop here so that + ** the busy-handler is not invoked. */ + break; + } +#endif }while( (rc&0xFF)==SQLITE_BUSY && pBt->inTransaction==TRANS_NONE && btreeInvokeBusyHandler(pBt) ); sqlite3PagerWalDb(pPager, 0); @@ -76882,7 +77665,7 @@ bypass_moveto_root: rc = SQLITE_CORRUPT_PAGE(pPage); goto moveto_index_finish; } - pCellKey = sqlite3Malloc( nCell+nOverrun ); + pCellKey = sqlite3Malloc( (u64)nCell+(u64)nOverrun ); if( pCellKey==0 ){ rc = SQLITE_NOMEM_BKPT; goto moveto_index_finish; @@ -78401,7 +79184,8 @@ static int rebuildPage( } /* The pPg->nFree field is now set incorrectly. The caller will fix it. */ - pPg->nCell = nCell; + assert( nCell < 10922 ); + pPg->nCell = (u16)nCell; pPg->nOverflow = 0; put2byte(&aData[hdr+1], 0); @@ -78648,9 +79432,13 @@ static int editPage( if( pageInsertArray( pPg, pBegin, &pData, pCellptr, iNew+nCell, nNew-nCell, pCArray - ) ) goto editpage_fail; + ) + ){ + goto editpage_fail; + } - pPg->nCell = nNew; + assert( nNew < 10922 ); + pPg->nCell = (u16)nNew; pPg->nOverflow = 0; put2byte(&aData[hdr+3], pPg->nCell); @@ -78959,7 +79747,7 @@ static int balance_nonroot( int pageFlags; /* Value of pPage->aData[0] */ int iSpace1 = 0; /* First unused byte of aSpace1[] */ int iOvflSpace = 0; /* First unused byte of aOvflSpace[] */ - int szScratch; /* Size of scratch memory requested */ + u64 szScratch; /* Size of scratch memory requested */ MemPage *apOld[NB]; /* pPage and up to two siblings */ MemPage *apNew[NB+2]; /* pPage and up to NB siblings after balancing */ u8 *pRight; /* Location in parent of right-sibling pointer */ @@ -80244,7 +81032,7 @@ SQLITE_PRIVATE int sqlite3BtreeInsert( if( pCur->info.nKey==pX->nKey ){ BtreePayload x2; x2.pData = pX->pKey; - x2.nData = pX->nKey; + x2.nData = (int)pX->nKey; assert( pX->nKey<=0x7fffffff ); x2.nZero = 0; return btreeOverwriteCell(pCur, &x2); } @@ -80425,7 +81213,7 @@ SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor *pDest, BtCursor *pSrc, i64 getCellInfo(pSrc); if( pSrc->info.nPayload<0x80 ){ - *(aOut++) = pSrc->info.nPayload; + *(aOut++) = (u8)pSrc->info.nPayload; }else{ aOut += sqlite3PutVarint(aOut, pSrc->info.nPayload); } @@ -80438,7 +81226,7 @@ SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor *pDest, BtCursor *pSrc, i64 nRem = pSrc->info.nPayload; if( nIn==nRem && nInpPage->maxLocal ){ memcpy(aOut, aIn, nIn); - pBt->nPreformatSize = nIn + (aOut - pBt->pTmpSpace); + pBt->nPreformatSize = nIn + (int)(aOut - pBt->pTmpSpace); return SQLITE_OK; }else{ int rc = SQLITE_OK; @@ -80450,7 +81238,7 @@ SQLITE_PRIVATE int sqlite3BtreeTransferRow(BtCursor *pDest, BtCursor *pSrc, i64 u32 nOut; /* Size of output buffer aOut[] */ nOut = btreePayloadToLocal(pDest->pPage, pSrc->info.nPayload); - pBt->nPreformatSize = nOut + (aOut - pBt->pTmpSpace); + pBt->nPreformatSize = (int)nOut + (int)(aOut - pBt->pTmpSpace); if( nOutinfo.nPayload ){ pPgnoOut = &aOut[nOut]; pBt->nPreformatSize += 4; @@ -82071,6 +82859,7 @@ SQLITE_PRIVATE int sqlite3BtreeIsInBackup(Btree *p){ */ SQLITE_PRIVATE void *sqlite3BtreeSchema(Btree *p, int nBytes, void(*xFree)(void *)){ BtShared *pBt = p->pBt; + assert( nBytes==0 || nBytes==sizeof(Schema) ); sqlite3BtreeEnter(p); if( !pBt->pSchema && nBytes ){ pBt->pSchema = sqlite3DbMallocZero(0, nBytes); @@ -83187,7 +83976,7 @@ static void vdbeMemRenderNum(int sz, char *zBuf, Mem *p){ ** corresponding string value, then it is important that the string be ** derived from the numeric value, not the other way around, to ensure ** that the index and table are consistent. See ticket -** https://www.sqlite.org/src/info/343634942dd54ab (2018-01-31) for +** https://sqlite.org/src/info/343634942dd54ab (2018-01-31) for ** an example. ** ** This routine looks at pMem to verify that if it has both a numeric @@ -83373,7 +84162,7 @@ SQLITE_PRIVATE void sqlite3VdbeMemZeroTerminateIfAble(Mem *pMem){ return; } if( pMem->enc!=SQLITE_UTF8 ) return; - if( NEVER(pMem->z==0) ) return; + assert( pMem->z!=0 ); if( pMem->flags & MEM_Dyn ){ if( pMem->xDel==sqlite3_free && sqlite3_msize(pMem->z) >= (u64)(pMem->n+1) @@ -84486,7 +85275,7 @@ static sqlite3_value *valueNew(sqlite3 *db, struct ValueNewStat4Ctx *p){ if( pRec==0 ){ Index *pIdx = p->pIdx; /* Index being probed */ - int nByte; /* Bytes of space to allocate */ + i64 nByte; /* Bytes of space to allocate */ int i; /* Counter variable */ int nCol = pIdx->nColumn; /* Number of index columns including rowid */ @@ -84552,7 +85341,7 @@ static int valueFromFunction( ){ sqlite3_context ctx; /* Context object for function invocation */ sqlite3_value **apVal = 0; /* Function arguments */ - int nVal = 0; /* Size of apVal[] array */ + int nVal = 0; /* Number of function arguments */ FuncDef *pFunc = 0; /* Function definition */ sqlite3_value *pVal = 0; /* New value */ int rc = SQLITE_OK; /* Return code */ @@ -85550,12 +86339,10 @@ SQLITE_PRIVATE int sqlite3VdbeAddFunctionCall( int eCallCtx /* Calling context */ ){ Vdbe *v = pParse->pVdbe; - int nByte; int addr; sqlite3_context *pCtx; assert( v ); - nByte = sizeof(*pCtx) + (nArg-1)*sizeof(sqlite3_value*); - pCtx = sqlite3DbMallocRawNN(pParse->db, nByte); + pCtx = sqlite3DbMallocRawNN(pParse->db, SZ_CONTEXT(nArg)); if( pCtx==0 ){ assert( pParse->db->mallocFailed ); freeEphemeralFunction(pParse->db, (FuncDef*)pFunc); @@ -85831,7 +86618,7 @@ static Op *opIterNext(VdbeOpIter *p){ } if( pRet->p4type==P4_SUBPROGRAM ){ - int nByte = (p->nSub+1)*sizeof(SubProgram*); + i64 nByte = (1+(u64)p->nSub)*sizeof(SubProgram*); int j; for(j=0; jnSub; j++){ if( p->apSub[j]==pRet->p4.pProgram ) break; @@ -85961,8 +86748,8 @@ SQLITE_PRIVATE void sqlite3VdbeAssertAbortable(Vdbe *p){ ** (1) For each jump instruction with a negative P2 value (a label) ** resolve the P2 value to an actual address. ** -** (2) Compute the maximum number of arguments used by any SQL function -** and store that value in *pMaxFuncArgs. +** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +** methods of any virtual table and store that value in *pMaxVtabArgs. ** ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately ** indicate what the prepared statement actually does. @@ -85975,8 +86762,8 @@ SQLITE_PRIVATE void sqlite3VdbeAssertAbortable(Vdbe *p){ ** script numbers the opcodes correctly. Changes to this routine must be ** coordinated with changes to mkopcodeh.tcl. */ -static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){ - int nMaxArgs = *pMaxFuncArgs; +static void resolveP2Values(Vdbe *p, int *pMaxVtabArgs){ + int nMaxVtabArgs = *pMaxVtabArgs; Op *pOp; Parse *pParse = p->pParse; int *aLabel = pParse->aLabel; @@ -86021,15 +86808,19 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){ } #ifndef SQLITE_OMIT_VIRTUALTABLE case OP_VUpdate: { - if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2; + if( pOp->p2>nMaxVtabArgs ) nMaxVtabArgs = pOp->p2; break; } case OP_VFilter: { int n; + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ assert( (pOp - p->aOp) >= 3 ); assert( pOp[-1].opcode==OP_Integer ); + assert( pOp[-1].p2==pOp->p3+1 ); n = pOp[-1].p1; - if( n>nMaxArgs ) nMaxArgs = n; + if( n>nMaxVtabArgs ) nMaxVtabArgs = n; /* Fall through into the default case */ /* no break */ deliberate_fall_through } @@ -86070,7 +86861,7 @@ resolve_p2_values_loop_exit: pParse->aLabel = 0; } pParse->nLabel = 0; - *pMaxFuncArgs = nMaxArgs; + *pMaxVtabArgs = nMaxVtabArgs; assert( p->bIsReader!=0 || DbMaskAllZero(p->btreeMask) ); } @@ -86299,7 +87090,7 @@ SQLITE_PRIVATE void sqlite3VdbeScanStatus( const char *zName /* Name of table or index being scanned */ ){ if( IS_STMT_SCANSTATUS(p->db) ){ - sqlite3_int64 nByte = (p->nScan+1) * sizeof(ScanStatus); + i64 nByte = (1+(i64)p->nScan) * sizeof(ScanStatus); ScanStatus *aNew; aNew = (ScanStatus*)sqlite3DbRealloc(p->db, p->aScan, nByte); if( aNew ){ @@ -86409,6 +87200,9 @@ SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe *p, u16 p5){ */ SQLITE_PRIVATE void sqlite3VdbeTypeofColumn(Vdbe *p, int iDest){ VdbeOp *pOp = sqlite3VdbeGetLastOp(p); +#ifdef SQLITE_DEBUG + while( pOp->opcode==OP_ReleaseReg ) pOp--; +#endif if( pOp->p3==iDest && pOp->opcode==OP_Column ){ pOp->p5 |= OPFLAG_TYPEOFARG; } @@ -87748,7 +88542,7 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady( int nVar; /* Number of parameters */ int nMem; /* Number of VM memory registers */ int nCursor; /* Number of cursors required */ - int nArg; /* Number of arguments in subprograms */ + int nArg; /* Max number args to xFilter or xUpdate */ int n; /* Loop counter */ struct ReusableSpace x; /* Reusable bulk memory */ @@ -87820,6 +88614,9 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady( p->apCsr = allocSpace(&x, p->apCsr, nCursor*sizeof(VdbeCursor*)); } } +#ifdef SQLITE_DEBUG + p->napArg = nArg; +#endif if( db->mallocFailed ){ p->nVar = 0; @@ -89317,6 +90114,7 @@ SQLITE_PRIVATE UnpackedRecord *sqlite3VdbeAllocUnpackedRecord( ){ UnpackedRecord *p; /* Unpacked record to return */ int nByte; /* Number of bytes required for *p */ + assert( sizeof(UnpackedRecord) + sizeof(Mem)*65536 < 0x7fffffff ); nByte = ROUND8P(sizeof(UnpackedRecord)) + sizeof(Mem)*(pKeyInfo->nKeyField+1); p = (UnpackedRecord *)sqlite3DbMallocRaw(pKeyInfo->db, nByte); if( !p ) return 0; @@ -90623,10 +91421,11 @@ SQLITE_PRIVATE void sqlite3VdbePreUpdateHook( preupdate.pCsr = pCsr; preupdate.op = op; preupdate.iNewReg = iReg; - preupdate.keyinfo.db = db; - preupdate.keyinfo.enc = ENC(db); - preupdate.keyinfo.nKeyField = pTab->nCol; - preupdate.keyinfo.aSortFlags = (u8*)&fakeSortOrder; + preupdate.pKeyinfo = (KeyInfo*)&preupdate.keyinfoSpace; + preupdate.pKeyinfo->db = db; + preupdate.pKeyinfo->enc = ENC(db); + preupdate.pKeyinfo->nKeyField = pTab->nCol; + preupdate.pKeyinfo->aSortFlags = (u8*)&fakeSortOrder; preupdate.iKey1 = iKey1; preupdate.iKey2 = iKey2; preupdate.pTab = pTab; @@ -90636,8 +91435,8 @@ SQLITE_PRIVATE void sqlite3VdbePreUpdateHook( db->xPreUpdateCallback(db->pPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2); db->pPreUpdate = 0; sqlite3DbFree(db, preupdate.aRecord); - vdbeFreeUnpacked(db, preupdate.keyinfo.nKeyField+1, preupdate.pUnpacked); - vdbeFreeUnpacked(db, preupdate.keyinfo.nKeyField+1, preupdate.pNewUnpacked); + vdbeFreeUnpacked(db, preupdate.pKeyinfo->nKeyField+1,preupdate.pUnpacked); + vdbeFreeUnpacked(db, preupdate.pKeyinfo->nKeyField+1,preupdate.pNewUnpacked); sqlite3VdbeMemRelease(&preupdate.oldipk); if( preupdate.aNew ){ int i; @@ -92468,7 +93267,7 @@ SQLITE_API int sqlite3_bind_text64( assert( xDel!=SQLITE_DYNAMIC ); if( enc!=SQLITE_UTF8 ){ if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE; - nData &= ~(u16)1; + nData &= ~(u64)1; } return bindText(pStmt, i, zData, nData, xDel, enc); } @@ -92876,7 +93675,7 @@ SQLITE_API int sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppVa if( !aRec ) goto preupdate_old_out; rc = sqlite3BtreePayload(p->pCsr->uc.pCursor, 0, nRec, aRec); if( rc==SQLITE_OK ){ - p->pUnpacked = vdbeUnpackRecord(&p->keyinfo, nRec, aRec); + p->pUnpacked = vdbeUnpackRecord(p->pKeyinfo, nRec, aRec); if( !p->pUnpacked ) rc = SQLITE_NOMEM; } if( rc!=SQLITE_OK ){ @@ -92893,7 +93692,9 @@ SQLITE_API int sqlite3_preupdate_old(sqlite3 *db, int iIdx, sqlite3_value **ppVa Column *pCol = &p->pTab->aCol[iIdx]; if( pCol->iDflt>0 ){ if( p->apDflt==0 ){ - int nByte = sizeof(sqlite3_value*)*p->pTab->nCol; + int nByte; + assert( sizeof(sqlite3_value*)*UMXV(p->pTab->nCol) < 0x7fffffff ); + nByte = sizeof(sqlite3_value*)*p->pTab->nCol; p->apDflt = (sqlite3_value**)sqlite3DbMallocZero(db, nByte); if( p->apDflt==0 ) goto preupdate_old_out; } @@ -92939,7 +93740,7 @@ SQLITE_API int sqlite3_preupdate_count(sqlite3 *db){ #else p = db->pPreUpdate; #endif - return (p ? p->keyinfo.nKeyField : 0); + return (p ? p->pKeyinfo->nKeyField : 0); } #endif /* SQLITE_ENABLE_PREUPDATE_HOOK */ @@ -93022,7 +93823,7 @@ SQLITE_API int sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppVa Mem *pData = &p->v->aMem[p->iNewReg]; rc = ExpandBlob(pData); if( rc!=SQLITE_OK ) goto preupdate_new_out; - pUnpack = vdbeUnpackRecord(&p->keyinfo, pData->n, pData->z); + pUnpack = vdbeUnpackRecord(p->pKeyinfo, pData->n, pData->z); if( !pUnpack ){ rc = SQLITE_NOMEM; goto preupdate_new_out; @@ -93043,7 +93844,8 @@ SQLITE_API int sqlite3_preupdate_new(sqlite3 *db, int iIdx, sqlite3_value **ppVa */ assert( p->op==SQLITE_UPDATE ); if( !p->aNew ){ - p->aNew = (Mem *)sqlite3DbMallocZero(db, sizeof(Mem) * p->pCsr->nField); + assert( sizeof(Mem)*UMXV(p->pCsr->nField) < 0x7fffffff ); + p->aNew = (Mem *)sqlite3DbMallocZero(db, sizeof(Mem)*p->pCsr->nField); if( !p->aNew ){ rc = SQLITE_NOMEM; goto preupdate_new_out; @@ -93813,11 +94615,11 @@ static VdbeCursor *allocateCursor( */ Mem *pMem = iCur>0 ? &p->aMem[p->nMem-iCur] : p->aMem; - int nByte; + i64 nByte; VdbeCursor *pCx = 0; - nByte = - ROUND8P(sizeof(VdbeCursor)) + 2*sizeof(u32)*nField + - (eCurType==CURTYPE_BTREE?sqlite3BtreeCursorSize():0); + nByte = SZ_VDBECURSOR(nField); + assert( ROUND8(nByte)==nByte ); + if( eCurType==CURTYPE_BTREE ) nByte += sqlite3BtreeCursorSize(); assert( iCur>=0 && iCurnCursor ); if( p->apCsr[iCur] ){ /*OPTIMIZATION-IF-FALSE*/ @@ -93841,7 +94643,7 @@ static VdbeCursor *allocateCursor( pMem->szMalloc = 0; return 0; } - pMem->szMalloc = nByte; + pMem->szMalloc = (int)nByte; } p->apCsr[iCur] = pCx = (VdbeCursor*)pMem->zMalloc; @@ -93850,8 +94652,8 @@ static VdbeCursor *allocateCursor( pCx->nField = nField; pCx->aOffset = &pCx->aType[nField]; if( eCurType==CURTYPE_BTREE ){ - pCx->uc.pCursor = (BtCursor*) - &pMem->z[ROUND8P(sizeof(VdbeCursor))+2*sizeof(u32)*nField]; + assert( ROUND8(SZ_VDBECURSOR(nField))==SZ_VDBECURSOR(nField) ); + pCx->uc.pCursor = (BtCursor*)&pMem->z[SZ_VDBECURSOR(nField)]; sqlite3BtreeCursorZero(pCx->uc.pCursor); } return pCx; @@ -94855,7 +95657,7 @@ case OP_Halt: { sqlite3VdbeError(p, "%s", pOp->p4.z); } pcx = (int)(pOp - aOp); - sqlite3_log(pOp->p1, "abort at %d in [%s]: %s", pcx, p->zSql, p->zErrMsg); + sqlite3_log(pOp->p1, "abort at %d: %s; [%s]", pcx, p->zErrMsg, p->zSql); } rc = sqlite3VdbeHalt(p); assert( rc==SQLITE_BUSY || rc==SQLITE_OK || rc==SQLITE_ERROR ); @@ -96181,7 +96983,7 @@ case OP_BitNot: { /* same as TK_BITNOT, in1, out2 */ break; } -/* Opcode: Once P1 P2 * * * +/* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -96197,6 +96999,12 @@ case OP_BitNot: { /* same as TK_BITNOT, in1, out2 */ ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. +** +** The P3 operand is not used directly by this opcode. However P3 is +** used by the code generator as follows: If this opcode is the start +** of a subroutine and that subroutine uses a Bloom filter, then P3 will +** be the register that holds that Bloom filter. See tag-202407032019 +** in the source code for implementation details. */ case OP_Once: { /* jump */ u32 iAddr; /* Address of this instruction */ @@ -97242,6 +98050,7 @@ case OP_MakeRecord: { zHdr += sqlite3PutVarint(zHdr, serial_type); if( pRec->n ){ assert( pRec->z!=0 ); + assert( pRec->z!=(const char*)sqlite3CtypeMap ); memcpy(zPayload, pRec->z, pRec->n); zPayload += pRec->n; } @@ -99593,7 +100402,7 @@ case OP_RowData: { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -100862,7 +101671,7 @@ case OP_RowSetTest: { /* jump, in1, in3 */ */ case OP_Program: { /* jump0 */ int nMem; /* Number of memory registers for sub-program */ - int nByte; /* Bytes of runtime space required for sub-program */ + i64 nByte; /* Bytes of runtime space required for sub-program */ Mem *pRt; /* Register to allocate runtime space */ Mem *pMem; /* Used to iterate through memory cells */ Mem *pEnd; /* Last memory cell in new array */ @@ -100913,7 +101722,7 @@ case OP_Program: { /* jump0 */ nByte = ROUND8(sizeof(VdbeFrame)) + nMem * sizeof(Mem) + pProgram->nCsr * sizeof(VdbeCursor*) - + (pProgram->nOp + 7)/8; + + (7 + (i64)pProgram->nOp)/8; pFrame = sqlite3DbMallocZero(db, nByte); if( !pFrame ){ goto no_mem; @@ -100921,7 +101730,7 @@ case OP_Program: { /* jump0 */ sqlite3VdbeMemRelease(pRt); pRt->flags = MEM_Blob|MEM_Dyn; pRt->z = (char*)pFrame; - pRt->n = nByte; + pRt->n = (int)nByte; pRt->xDel = sqlite3VdbeFrameMemDel; pFrame->v = p; @@ -101020,12 +101829,14 @@ case OP_Param: { /* out2 */ ** statement counter is incremented (immediate foreign key constraints). */ case OP_FkCounter: { - if( db->flags & SQLITE_DeferFKs ){ - db->nDeferredImmCons += pOp->p2; - }else if( pOp->p1 ){ + if( pOp->p1 ){ db->nDeferredCons += pOp->p2; }else{ - p->nFkConstraint += pOp->p2; + if( db->flags & SQLITE_DeferFKs ){ + db->nDeferredImmCons += pOp->p2; + }else{ + p->nFkConstraint += pOp->p2; + } } break; } @@ -101240,7 +102051,7 @@ case OP_AggStep: { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = ROUND8P( sizeof(pCtx[0]) + (n-1)*sizeof(sqlite3_value*) ); + nAlloc = ROUND8P( SZ_CONTEXT(n) ); pCtx = sqlite3DbMallocRawNN(db, nAlloc + sizeof(Mem)); if( pCtx==0 ) goto no_mem; pCtx->pOut = (Mem*)((u8*)pCtx + nAlloc); @@ -101900,6 +102711,7 @@ case OP_VFilter: { /* jump, ncycle */ /* Invoke the xFilter method */ apArg = p->apArg; + assert( nArg<=p->napArg ); for(i = 0; ivtabOnConflict; apArg = p->apArg; pX = &aMem[pOp->p3]; + assert( nArg<=p->napArg ); for(i=0; irc = rc; sqlite3SystemError(db, rc); testcase( sqlite3GlobalConfig.xLog!=0 ); - sqlite3_log(rc, "statement aborts at %d: [%s] %s", - (int)(pOp - aOp), p->zSql, p->zErrMsg); + sqlite3_log(rc, "statement aborts at %d: %s; [%s]", + (int)(pOp - aOp), p->zErrMsg, p->zSql); if( p->eVdbeState==VDBE_RUN_STATE ) sqlite3VdbeHalt(p); if( rc==SQLITE_IOERR_NOMEM ) sqlite3OomFault(db); if( rc==SQLITE_CORRUPT && db->autoCommit==0 ){ @@ -102896,6 +103709,7 @@ SQLITE_API int sqlite3_blob_open( char *zErr = 0; Table *pTab; Incrblob *pBlob = 0; + int iDb; Parse sParse; #ifdef SQLITE_ENABLE_API_ARMOR @@ -102941,7 +103755,10 @@ SQLITE_API int sqlite3_blob_open( sqlite3ErrorMsg(&sParse, "cannot open view: %s", zTable); } #endif - if( !pTab ){ + if( pTab==0 + || ((iDb = sqlite3SchemaToIndex(db, pTab->pSchema))==1 && + sqlite3OpenTempDatabase(&sParse)) + ){ if( sParse.zErrMsg ){ sqlite3DbFree(db, zErr); zErr = sParse.zErrMsg; @@ -102952,15 +103769,11 @@ SQLITE_API int sqlite3_blob_open( goto blob_open_out; } pBlob->pTab = pTab; - pBlob->zDb = db->aDb[sqlite3SchemaToIndex(db, pTab->pSchema)].zDbSName; + pBlob->zDb = db->aDb[iDb].zDbSName; /* Now search pTab for the exact column. */ - for(iCol=0; iColnCol; iCol++) { - if( sqlite3StrICmp(pTab->aCol[iCol].zCnName, zColumn)==0 ){ - break; - } - } - if( iCol==pTab->nCol ){ + iCol = sqlite3ColumnIndex(pTab, zColumn); + if( iCol<0 ){ sqlite3DbFree(db, zErr); zErr = sqlite3MPrintf(db, "no such column: \"%s\"", zColumn); rc = SQLITE_ERROR; @@ -103040,7 +103853,6 @@ SQLITE_API int sqlite3_blob_open( {OP_Halt, 0, 0, 0}, /* 5 */ }; Vdbe *v = (Vdbe *)pBlob->pStmt; - int iDb = sqlite3SchemaToIndex(db, pTab->pSchema); VdbeOp *aOp; sqlite3VdbeAddOp4Int(v, OP_Transaction, iDb, wrFlag, @@ -103618,9 +104430,12 @@ struct VdbeSorter { u8 iPrev; /* Previous thread used to flush PMA */ u8 nTask; /* Size of aTask[] array */ u8 typeMask; - SortSubtask aTask[1]; /* One or more subtasks */ + SortSubtask aTask[FLEXARRAY]; /* One or more subtasks */ }; +/* Size (in bytes) of a VdbeSorter object that works with N or fewer subtasks */ +#define SZ_VDBESORTER(N) (offsetof(VdbeSorter,aTask)+(N)*sizeof(SortSubtask)) + #define SORTER_TYPE_INTEGER 0x01 #define SORTER_TYPE_TEXT 0x02 @@ -104222,7 +105037,7 @@ SQLITE_PRIVATE int sqlite3VdbeSorterInit( VdbeSorter *pSorter; /* The new sorter */ KeyInfo *pKeyInfo; /* Copy of pCsr->pKeyInfo with db==0 */ int szKeyInfo; /* Size of pCsr->pKeyInfo in bytes */ - int sz; /* Size of pSorter in bytes */ + i64 sz; /* Size of pSorter in bytes */ int rc = SQLITE_OK; #if SQLITE_MAX_WORKER_THREADS==0 # define nWorker 0 @@ -104250,8 +105065,10 @@ SQLITE_PRIVATE int sqlite3VdbeSorterInit( assert( pCsr->pKeyInfo ); assert( !pCsr->isEphemeral ); assert( pCsr->eCurType==CURTYPE_SORTER ); - szKeyInfo = sizeof(KeyInfo) + (pCsr->pKeyInfo->nKeyField-1)*sizeof(CollSeq*); - sz = sizeof(VdbeSorter) + nWorker * sizeof(SortSubtask); + assert( sizeof(KeyInfo) + UMXV(pCsr->pKeyInfo->nKeyField)*sizeof(CollSeq*) + < 0x7fffffff ); + szKeyInfo = SZ_KEYINFO(pCsr->pKeyInfo->nKeyField); + sz = SZ_VDBESORTER(nWorker+1); pSorter = (VdbeSorter*)sqlite3DbMallocZero(db, sz + szKeyInfo); pCsr->uc.pSorter = pSorter; @@ -104463,7 +105280,7 @@ static int vdbeSorterJoinAll(VdbeSorter *pSorter, int rcin){ */ static MergeEngine *vdbeMergeEngineNew(int nReader){ int N = 2; /* Smallest power of two >= nReader */ - int nByte; /* Total bytes of space to allocate */ + i64 nByte; /* Total bytes of space to allocate */ MergeEngine *pNew; /* Pointer to allocated object to return */ assert( nReader<=SORTER_MAX_MERGE_COUNT ); @@ -104715,6 +105532,10 @@ static int vdbeSorterSort(SortSubtask *pTask, SorterList *pList){ p->u.pNext = 0; for(i=0; aSlot[i]; i++){ p = vdbeSorterMerge(pTask, p, aSlot[i]); + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ + assert( iop on success */ Table *pTab = 0; /* Table holding the row */ - Column *pCol; /* A column of pTab */ ExprList *pFJMatch = 0; /* Matches for FULL JOIN .. USING */ const char *zCol = pRight->u.zToken; @@ -107557,7 +108377,6 @@ static int lookupName( if( pSrcList ){ for(i=0, pItem=pSrcList->a; inSrc; i++, pItem++){ - u8 hCol; pTab = pItem->pSTab; assert( pTab!=0 && pTab->zName!=0 ); assert( pTab->nCol>0 || pParse->nErr ); @@ -107645,43 +108464,38 @@ static int lookupName( sqlite3RenameTokenRemap(pParse, 0, (void*)&pExpr->y.pTab); } } - hCol = sqlite3StrIHash(zCol); - for(j=0, pCol=pTab->aCol; jnCol; j++, pCol++){ - if( pCol->hName==hCol - && sqlite3StrICmp(pCol->zCnName, zCol)==0 - ){ - if( cnt>0 ){ - if( pItem->fg.isUsing==0 - || sqlite3IdListIndex(pItem->u3.pUsing, zCol)<0 - ){ - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - sqlite3ExprListDelete(db, pFJMatch); - pFJMatch = 0; - }else - if( (pItem->fg.jointype & JT_RIGHT)==0 ){ - /* An INNER or LEFT JOIN. Use the left-most table */ - continue; - }else - if( (pItem->fg.jointype & JT_LEFT)==0 ){ - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0; - sqlite3ExprListDelete(db, pFJMatch); - pFJMatch = 0; - }else{ - /* For a FULL JOIN, we must construct a coalesce() func */ - extendFJMatch(pParse, &pFJMatch, pMatch, pExpr->iColumn); - } + j = sqlite3ColumnIndex(pTab, zCol); + if( j>=0 ){ + if( cnt>0 ){ + if( pItem->fg.isUsing==0 + || sqlite3IdListIndex(pItem->u3.pUsing, zCol)<0 + ){ + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + sqlite3ExprListDelete(db, pFJMatch); + pFJMatch = 0; + }else + if( (pItem->fg.jointype & JT_RIGHT)==0 ){ + /* An INNER or LEFT JOIN. Use the left-most table */ + continue; + }else + if( (pItem->fg.jointype & JT_LEFT)==0 ){ + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0; + sqlite3ExprListDelete(db, pFJMatch); + pFJMatch = 0; + }else{ + /* For a FULL JOIN, we must construct a coalesce() func */ + extendFJMatch(pParse, &pFJMatch, pMatch, pExpr->iColumn); } - cnt++; - pMatch = pItem; - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - pExpr->iColumn = j==pTab->iPKey ? -1 : (i16)j; - if( pItem->fg.isNestedFrom ){ - sqlite3SrcItemColumnUsed(pItem, j); - } - break; + } + cnt++; + pMatch = pItem; + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + pExpr->iColumn = j==pTab->iPKey ? -1 : (i16)j; + if( pItem->fg.isNestedFrom ){ + sqlite3SrcItemColumnUsed(pItem, j); } } if( 0==cnt && VisibleRowid(pTab) ){ @@ -107771,23 +108585,18 @@ static int lookupName( if( pTab ){ int iCol; - u8 hCol = sqlite3StrIHash(zCol); pSchema = pTab->pSchema; cntTab++; - for(iCol=0, pCol=pTab->aCol; iColnCol; iCol++, pCol++){ - if( pCol->hName==hCol - && sqlite3StrICmp(pCol->zCnName, zCol)==0 - ){ - if( iCol==pTab->iPKey ){ - iCol = -1; - } - break; + iCol = sqlite3ColumnIndex(pTab, zCol); + if( iCol>=0 ){ + if( pTab->iPKey==iCol ) iCol = -1; + }else{ + if( sqlite3IsRowid(zCol) && VisibleRowid(pTab) ){ + iCol = -1; + }else{ + iCol = pTab->nCol; } } - if( iCol>=pTab->nCol && sqlite3IsRowid(zCol) && VisibleRowid(pTab) ){ - /* IMP: R-51414-32910 */ - iCol = -1; - } if( iColnCol ){ cnt++; pMatch = 0; @@ -108426,13 +109235,12 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ sqlite3ResolveNotValid(pParse, pNC, "non-deterministic functions", NC_IdxExpr|NC_PartIdx|NC_GenCol, 0, pExpr); }else{ assert( (NC_SelfRef & 0xff)==NC_SelfRef ); /* Must fit in 8 bits */ pExpr->op2 = pNC->ncFlags & NC_SelfRef; - if( pNC->ncFlags & NC_FromDDL ) ExprSetProperty(pExpr, EP_FromDDL); } if( (pDef->funcFlags & SQLITE_FUNC_INTERNAL)!=0 && pParse->nested==0 @@ -108448,6 +109256,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){ if( (pDef->funcFlags & (SQLITE_FUNC_DIRECT|SQLITE_FUNC_UNSAFE))!=0 && !IN_RENAME_OBJECT ){ + if( pNC->ncFlags & NC_FromDDL ) ExprSetProperty(pExpr, EP_FromDDL); sqlite3ExprFunctionUsable(pParse, pExpr, pDef); } } @@ -109501,20 +110310,22 @@ SQLITE_PRIVATE int sqlite3ResolveSelfReference( Expr *pExpr, /* Expression to resolve. May be NULL. */ ExprList *pList /* Expression list to resolve. May be NULL. */ ){ - SrcList sSrc; /* Fake SrcList for pParse->pNewTable */ + SrcList *pSrc; /* Fake SrcList for pParse->pNewTable */ NameContext sNC; /* Name context for pParse->pNewTable */ int rc; + u8 srcSpace[SZ_SRCLIST_1]; /* Memory space for the fake SrcList */ assert( type==0 || pTab!=0 ); assert( type==NC_IsCheck || type==NC_PartIdx || type==NC_IdxExpr || type==NC_GenCol || pTab==0 ); memset(&sNC, 0, sizeof(sNC)); - memset(&sSrc, 0, sizeof(sSrc)); + pSrc = (SrcList*)srcSpace; + memset(pSrc, 0, SZ_SRCLIST_1); if( pTab ){ - sSrc.nSrc = 1; - sSrc.a[0].zName = pTab->zName; - sSrc.a[0].pSTab = pTab; - sSrc.a[0].iCursor = -1; + pSrc->nSrc = 1; + pSrc->a[0].zName = pTab->zName; + pSrc->a[0].pSTab = pTab; + pSrc->a[0].iCursor = -1; if( pTab->pSchema!=pParse->db->aDb[1].pSchema ){ /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ @@ -109522,7 +110333,7 @@ SQLITE_PRIVATE int sqlite3ResolveSelfReference( } } sNC.pParse = pParse; - sNC.pSrcList = &sSrc; + sNC.pSrcList = pSrc; sNC.ncFlags = type | NC_IsDDL; if( (rc = sqlite3ResolveExprNames(&sNC, pExpr))!=SQLITE_OK ) return rc; if( pList ) rc = sqlite3ResolveExprListNames(&sNC, pList); @@ -109606,7 +110417,9 @@ SQLITE_PRIVATE char sqlite3ExprAffinity(const Expr *pExpr){ pExpr->pLeft->x.pSelect->pEList->a[pExpr->iColumn].pExpr ); } - if( op==TK_VECTOR ){ + if( op==TK_VECTOR + || (op==TK_FUNCTION && pExpr->affExpr==SQLITE_AFF_DEFER) + ){ assert( ExprUseXList(pExpr) ); return sqlite3ExprAffinity(pExpr->x.pList->a[0].pExpr); } @@ -109799,7 +110612,9 @@ SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, const Expr *pExpr){ p = p->pLeft; continue; } - if( op==TK_VECTOR ){ + if( op==TK_VECTOR + || (op==TK_FUNCTION && p->affExpr==SQLITE_AFF_DEFER) + ){ assert( ExprUseXList(p) ); p = p->x.pList->a[0].pExpr; continue; @@ -110673,7 +111488,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprAnd(Parse *pParse, Expr *pLeft, Expr *pRight){ return pLeft; }else{ u32 f = pLeft->flags | pRight->flags; - if( (f&(EP_OuterON|EP_InnerON|EP_IsFalse))==EP_IsFalse + if( (f&(EP_OuterON|EP_InnerON|EP_IsFalse|EP_HasFunc))==EP_IsFalse && !IN_RENAME_OBJECT ){ sqlite3ExprDeferredDelete(pParse, pLeft); @@ -111271,7 +112086,7 @@ static Expr *exprDup( SQLITE_PRIVATE With *sqlite3WithDup(sqlite3 *db, With *p){ With *pRet = 0; if( p ){ - sqlite3_int64 nByte = sizeof(*p) + sizeof(p->a[0]) * (p->nCte-1); + sqlite3_int64 nByte = SZ_WITH(p->nCte); pRet = sqlite3DbMallocZero(db, nByte); if( pRet ){ int i; @@ -111382,7 +112197,6 @@ SQLITE_PRIVATE ExprList *sqlite3ExprListDup(sqlite3 *db, const ExprList *p, int } pItem->zEName = sqlite3DbStrDup(db, pOldItem->zEName); pItem->fg = pOldItem->fg; - pItem->fg.done = 0; pItem->u = pOldItem->u; } return pNew; @@ -111399,11 +112213,9 @@ SQLITE_PRIVATE ExprList *sqlite3ExprListDup(sqlite3 *db, const ExprList *p, int SQLITE_PRIVATE SrcList *sqlite3SrcListDup(sqlite3 *db, const SrcList *p, int flags){ SrcList *pNew; int i; - int nByte; assert( db!=0 ); if( p==0 ) return 0; - nByte = sizeof(*p) + (p->nSrc>0 ? sizeof(p->a[0]) * (p->nSrc-1) : 0); - pNew = sqlite3DbMallocRawNN(db, nByte ); + pNew = sqlite3DbMallocRawNN(db, SZ_SRCLIST(p->nSrc) ); if( pNew==0 ) return 0; pNew->nSrc = pNew->nAlloc = p->nSrc; for(i=0; inSrc; i++){ @@ -111465,7 +112277,7 @@ SQLITE_PRIVATE IdList *sqlite3IdListDup(sqlite3 *db, const IdList *p){ int i; assert( db!=0 ); if( p==0 ) return 0; - pNew = sqlite3DbMallocRawNN(db, sizeof(*pNew)+(p->nId-1)*sizeof(p->a[0]) ); + pNew = sqlite3DbMallocRawNN(db, SZ_IDLIST(p->nId)); if( pNew==0 ) return 0; pNew->nId = p->nId; for(i=0; inId; i++){ @@ -111497,7 +112309,7 @@ SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3 *db, const Select *pDup, int fla pNew->pLimit = sqlite3ExprDup(db, p->pLimit, flags); pNew->iLimit = 0; pNew->iOffset = 0; - pNew->selFlags = p->selFlags & ~SF_UsesEphemeral; + pNew->selFlags = p->selFlags & ~(u32)SF_UsesEphemeral; pNew->addrOpenEphm[0] = -1; pNew->addrOpenEphm[1] = -1; pNew->nSelectRow = p->nSelectRow; @@ -111549,7 +112361,7 @@ SQLITE_PRIVATE SQLITE_NOINLINE ExprList *sqlite3ExprListAppendNew( struct ExprList_item *pItem; ExprList *pList; - pList = sqlite3DbMallocRawNN(db, sizeof(ExprList)+sizeof(pList->a[0])*4 ); + pList = sqlite3DbMallocRawNN(db, SZ_EXPRLIST(4)); if( pList==0 ){ sqlite3ExprDelete(db, pExpr); return 0; @@ -111569,8 +112381,7 @@ SQLITE_PRIVATE SQLITE_NOINLINE ExprList *sqlite3ExprListAppendGrow( struct ExprList_item *pItem; ExprList *pNew; pList->nAlloc *= 2; - pNew = sqlite3DbRealloc(db, pList, - sizeof(*pList)+(pList->nAlloc-1)*sizeof(pList->a[0])); + pNew = sqlite3DbRealloc(db, pList, SZ_EXPRLIST(pList->nAlloc)); if( pNew==0 ){ sqlite3ExprListDelete(db, pList); sqlite3ExprDelete(db, pExpr); @@ -112499,13 +113310,7 @@ SQLITE_PRIVATE const char *sqlite3RowidAlias(Table *pTab){ int ii; assert( VisibleRowid(pTab) ); for(ii=0; iinCol; iCol++){ - if( sqlite3_stricmp(azOpt[ii], pTab->aCol[iCol].zCnName)==0 ) break; - } - if( iCol==pTab->nCol ){ - return azOpt[ii]; - } + if( sqlite3ColumnIndex(pTab, azOpt[ii])<0 ) return azOpt[ii]; } return 0; } @@ -112909,7 +113714,7 @@ static char *exprINAffinity(Parse *pParse, const Expr *pExpr){ char *zRet; assert( pExpr->op==TK_IN ); - zRet = sqlite3DbMallocRaw(pParse->db, nVal+1); + zRet = sqlite3DbMallocRaw(pParse->db, 1+(i64)nVal); if( zRet ){ int i; for(i=0; idb, pCopy); sqlite3DbFree(pParse->db, dest.zAffSdst); if( addrBloom ){ + /* Remember that location of the Bloom filter in the P3 operand + ** of the OP_Once that began this subroutine. tag-202407032019 */ sqlite3VdbeGetOp(v, addrOnce)->p3 = dest.iSDParm2; if( dest.iSDParm2==0 ){ - sqlite3VdbeChangeToNoop(v, addrBloom); - }else{ - sqlite3VdbeGetOp(v, addrOnce)->p3 = dest.iSDParm2; + /* If the Bloom filter won't actually be used, keep it small */ + sqlite3VdbeGetOp(v, addrBloom)->p1 = 10; } } if( rc ){ @@ -113620,7 +114426,7 @@ static void sqlite3ExprCodeIN( if( ExprHasProperty(pExpr, EP_Subrtn) ){ const VdbeOp *pOp = sqlite3VdbeGetOp(v, pExpr->y.sub.iAddr); assert( pOp->opcode==OP_Once || pParse->nErr ); - if( pOp->opcode==OP_Once && pOp->p3>0 ){ + if( pOp->opcode==OP_Once && pOp->p3>0 ){ /* tag-202407032019 */ assert( OptimizationEnabled(pParse->db, SQLITE_BloomFilter) ); sqlite3VdbeAddOp4Int(v, OP_Filter, pOp->p3, destIfFalse, rLhs, nVector); VdbeCoverage(v); @@ -114212,7 +115018,7 @@ static SQLITE_NOINLINE int sqlite3IndexedExprLookup( /* -** Expresion pExpr is guaranteed to be a TK_COLUMN or equivalent. This +** Expression pExpr is guaranteed to be a TK_COLUMN or equivalent. This ** function checks the Parse.pIdxPartExpr list to see if this column ** can be replaced with a constant value. If so, it generates code to ** put the constant value in a register (ideally, but not necessarily, @@ -115469,11 +116275,11 @@ SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int assert( TK_ISNULL==OP_IsNull ); testcase( op==TK_ISNULL ); assert( TK_NOTNULL==OP_NotNull ); testcase( op==TK_NOTNULL ); r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); - sqlite3VdbeTypeofColumn(v, r1); + assert( regFree1==0 || regFree1==r1 ); + if( regFree1 ) sqlite3VdbeTypeofColumn(v, r1); sqlite3VdbeAddOp2(v, op, r1, dest); VdbeCoverageIf(v, op==TK_ISNULL); VdbeCoverageIf(v, op==TK_NOTNULL); - testcase( regFree1==0 ); break; } case TK_BETWEEN: { @@ -115644,11 +116450,11 @@ SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int case TK_ISNULL: case TK_NOTNULL: { r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); - sqlite3VdbeTypeofColumn(v, r1); + assert( regFree1==0 || regFree1==r1 ); + if( regFree1 ) sqlite3VdbeTypeofColumn(v, r1); sqlite3VdbeAddOp2(v, op, r1, dest); testcase( op==TK_ISNULL ); VdbeCoverageIf(v, op==TK_ISNULL); testcase( op==TK_NOTNULL ); VdbeCoverageIf(v, op==TK_NOTNULL); - testcase( regFree1==0 ); break; } case TK_BETWEEN: { @@ -116548,7 +117354,9 @@ static void findOrCreateAggInfoColumn( ){ struct AggInfo_col *pCol; int k; + int mxTerm = pParse->db->aLimit[SQLITE_LIMIT_COLUMN]; + assert( mxTerm <= SMXV(i16) ); assert( pAggInfo->iFirstReg==0 ); pCol = pAggInfo->aCol; for(k=0; knColumn; k++, pCol++){ @@ -116566,6 +117374,10 @@ static void findOrCreateAggInfoColumn( assert( pParse->db->mallocFailed ); return; } + if( k>mxTerm ){ + sqlite3ErrorMsg(pParse, "more than %d aggregate terms", mxTerm); + k = mxTerm; + } pCol = &pAggInfo->aCol[k]; assert( ExprUseYTab(pExpr) ); pCol->pTab = pExpr->y.pTab; @@ -116599,6 +117411,7 @@ fix_up_expr: if( pExpr->op==TK_COLUMN ){ pExpr->op = TK_AGG_COLUMN; } + assert( k <= SMXV(pExpr->iAgg) ); pExpr->iAgg = (i16)k; } @@ -116683,13 +117496,19 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){ ** function that is already in the pAggInfo structure */ struct AggInfo_func *pItem = pAggInfo->aFunc; + int mxTerm = pParse->db->aLimit[SQLITE_LIMIT_COLUMN]; + assert( mxTerm <= SMXV(i16) ); for(i=0; inFunc; i++, pItem++){ if( NEVER(pItem->pFExpr==pExpr) ) break; if( sqlite3ExprCompare(0, pItem->pFExpr, pExpr, -1)==0 ){ break; } } - if( i>=pAggInfo->nFunc ){ + if( i>mxTerm ){ + sqlite3ErrorMsg(pParse, "more than %d aggregate terms", mxTerm); + i = mxTerm; + assert( inFunc ); + }else if( i>=pAggInfo->nFunc ){ /* pExpr is original. Make a new entry in pAggInfo->aFunc[] */ u8 enc = ENC(pParse->db); @@ -116743,6 +117562,7 @@ static int analyzeAggregate(Walker *pWalker, Expr *pExpr){ */ assert( !ExprHasProperty(pExpr, EP_TokenOnly|EP_Reduced) ); ExprSetVVAProperty(pExpr, EP_NoReduce); + assert( i <= SMXV(pExpr->iAgg) ); pExpr->iAgg = (i16)i; pExpr->pAggInfo = pAggInfo; return WRC_Prune; @@ -117453,13 +118273,13 @@ SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){ assert( pNew->nCol>0 ); nAlloc = (((pNew->nCol-1)/8)*8)+8; assert( nAlloc>=pNew->nCol && nAlloc%8==0 && nAlloc-pNew->nCol<8 ); - pNew->aCol = (Column*)sqlite3DbMallocZero(db, sizeof(Column)*nAlloc); + pNew->aCol = (Column*)sqlite3DbMallocZero(db, sizeof(Column)*(u32)nAlloc); pNew->zName = sqlite3MPrintf(db, "sqlite_altertab_%s", pTab->zName); if( !pNew->aCol || !pNew->zName ){ assert( db->mallocFailed ); goto exit_begin_add_column; } - memcpy(pNew->aCol, pTab->aCol, sizeof(Column)*pNew->nCol); + memcpy(pNew->aCol, pTab->aCol, sizeof(Column)*(size_t)pNew->nCol); for(i=0; inCol; i++){ Column *pCol = &pNew->aCol[i]; pCol->zCnName = sqlite3DbStrDup(db, pCol->zCnName); @@ -117554,10 +118374,8 @@ SQLITE_PRIVATE void sqlite3AlterRenameColumn( ** altered. Set iCol to be the index of the column being renamed */ zOld = sqlite3NameFromToken(db, pOld); if( !zOld ) goto exit_rename_column; - for(iCol=0; iColnCol; iCol++){ - if( 0==sqlite3StrICmp(pTab->aCol[iCol].zCnName, zOld) ) break; - } - if( iCol==pTab->nCol ){ + iCol = sqlite3ColumnIndex(pTab, zOld); + if( iCol<0 ){ sqlite3ErrorMsg(pParse, "no such column: \"%T\"", pOld); goto exit_rename_column; } @@ -118060,6 +118878,7 @@ static int renameParseSql( int bTemp /* True if SQL is from temp schema */ ){ int rc; + u64 flags; sqlite3ParseObjectInit(p, db); if( zSql==0 ){ @@ -118068,11 +118887,21 @@ static int renameParseSql( if( sqlite3StrNICmp(zSql,"CREATE ",7)!=0 ){ return SQLITE_CORRUPT_BKPT; } - db->init.iDb = bTemp ? 1 : sqlite3FindDbName(db, zDb); + if( bTemp ){ + db->init.iDb = 1; + }else{ + int iDb = sqlite3FindDbName(db, zDb); + assert( iDb>=0 && iDb<=0xff ); + db->init.iDb = (u8)iDb; + } p->eParseMode = PARSE_MODE_RENAME; p->db = db; p->nQueryLoop = 1; + flags = db->flags; + testcase( (db->flags & SQLITE_Comments)==0 && strstr(zSql," /* ")!=0 ); + db->flags |= SQLITE_Comments; rc = sqlite3RunParser(p, zSql); + db->flags = flags; if( db->mallocFailed ) rc = SQLITE_NOMEM; if( rc==SQLITE_OK && NEVER(p->pNewTable==0 && p->pNewIndex==0 && p->pNewTrigger==0) @@ -118135,10 +118964,11 @@ static int renameEditSql( nQuot = sqlite3Strlen30(zQuot)-1; } - assert( nQuot>=nNew ); - zOut = sqlite3DbMallocZero(db, nSql + pRename->nList*nQuot + 1); + assert( nQuot>=nNew && nSql>=0 && nNew>=0 ); + zOut = sqlite3DbMallocZero(db, (u64)nSql + pRename->nList*(u64)nQuot + 1); }else{ - zOut = (char*)sqlite3DbMallocZero(db, (nSql*2+1) * 3); + assert( nSql>0 ); + zOut = (char*)sqlite3DbMallocZero(db, (2*(u64)nSql + 1) * 3); if( zOut ){ zBuf1 = &zOut[nSql*2+1]; zBuf2 = &zOut[nSql*4+2]; @@ -118150,16 +118980,17 @@ static int renameEditSql( ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if( zOut ){ - int nOut = nSql; - memcpy(zOut, zSql, nSql); + i64 nOut = nSql; + assert( nSql>0 ); + memcpy(zOut, zSql, (size_t)nSql); while( pRename->pList ){ int iOff; /* Offset of token to replace in zOut */ - u32 nReplace; + i64 nReplace; const char *zReplace; RenameToken *pBest = renameColumnTokenNext(pRename); if( zNew ){ - if( bQuote==0 && sqlite3IsIdChar(*pBest->t.z) ){ + if( bQuote==0 && sqlite3IsIdChar(*(u8*)pBest->t.z) ){ nReplace = nNew; zReplace = zNew; }else{ @@ -118177,14 +119008,15 @@ static int renameEditSql( memcpy(zBuf1, pBest->t.z, pBest->t.n); zBuf1[pBest->t.n] = 0; sqlite3Dequote(zBuf1); - sqlite3_snprintf(nSql*2, zBuf2, "%Q%s", zBuf1, + assert( nSql < 0x15555554 /* otherwise malloc would have failed */ ); + sqlite3_snprintf((int)(nSql*2), zBuf2, "%Q%s", zBuf1, pBest->t.z[pBest->t.n]=='\'' ? " " : "" ); zReplace = zBuf2; nReplace = sqlite3Strlen30(zReplace); } - iOff = pBest->t.z - zSql; + iOff = (int)(pBest->t.z - zSql); if( pBest->t.n!=nReplace ){ memmove(&zOut[iOff + nReplace], &zOut[iOff + pBest->t.n], nOut - (iOff + pBest->t.n) @@ -118210,11 +119042,12 @@ static int renameEditSql( ** Set all pEList->a[].fg.eEName fields in the expression-list to val. */ static void renameSetENames(ExprList *pEList, int val){ + assert( val==ENAME_NAME || val==ENAME_TAB || val==ENAME_SPAN ); if( pEList ){ int i; for(i=0; inExpr; i++){ assert( val==ENAME_NAME || pEList->a[i].fg.eEName==ENAME_NAME ); - pEList->a[i].fg.eEName = val; + pEList->a[i].fg.eEName = val&0x3; } } } @@ -118471,7 +119304,7 @@ static void renameColumnFunc( if( sParse.pNewTable ){ if( IsView(sParse.pNewTable) ){ Select *pSelect = sParse.pNewTable->u.view.pSelect; - pSelect->selFlags &= ~SF_View; + pSelect->selFlags &= ~(u32)SF_View; sParse.rc = SQLITE_OK; sqlite3SelectPrep(&sParse, pSelect, 0); rc = (db->mallocFailed ? SQLITE_NOMEM : sParse.rc); @@ -118689,7 +119522,7 @@ static void renameTableFunc( sNC.pParse = &sParse; assert( pSelect->selFlags & SF_View ); - pSelect->selFlags &= ~SF_View; + pSelect->selFlags &= ~(u32)SF_View; sqlite3SelectPrep(&sParse, pTab->u.view.pSelect, &sNC); if( sParse.nErr ){ rc = sParse.rc; @@ -118862,7 +119695,7 @@ static void renameQuotefixFunc( if( sParse.pNewTable ){ if( IsView(sParse.pNewTable) ){ Select *pSelect = sParse.pNewTable->u.view.pSelect; - pSelect->selFlags &= ~SF_View; + pSelect->selFlags &= ~(u32)SF_View; sParse.rc = SQLITE_OK; sqlite3SelectPrep(&sParse, pSelect, 0); rc = (db->mallocFailed ? SQLITE_NOMEM : sParse.rc); @@ -118961,10 +119794,10 @@ static void renameTableTest( if( zDb && zInput ){ int rc; Parse sParse; - int flags = db->flags; + u64 flags = db->flags; if( bNoDQS ) db->flags &= ~(SQLITE_DqsDML|SQLITE_DqsDDL); rc = renameParseSql(&sParse, zDb, db, zInput, bTemp); - db->flags |= (flags & (SQLITE_DqsDML|SQLITE_DqsDDL)); + db->flags = flags; if( rc==SQLITE_OK ){ if( isLegacy==0 && sParse.pNewTable && IsView(sParse.pNewTable) ){ NameContext sNC; @@ -119456,7 +120289,8 @@ static void openStatTable( sqlite3NestedParse(pParse, "CREATE TABLE %Q.%s(%s)", pDb->zDbSName, zTab, aTable[i].zCols ); - aRoot[i] = (u32)pParse->regRoot; + assert( pParse->isCreate || pParse->nErr ); + aRoot[i] = (u32)pParse->u1.cr.regRoot; aCreateTbl[i] = OPFLAG_P2ISREG; } }else{ @@ -119647,7 +120481,7 @@ static void statInit( int nCol; /* Number of columns in index being sampled */ int nKeyCol; /* Number of key columns */ int nColUp; /* nCol rounded up for alignment */ - int n; /* Bytes of space to allocate */ + i64 n; /* Bytes of space to allocate */ sqlite3 *db = sqlite3_context_db_handle(context); /* Database connection */ #ifdef SQLITE_ENABLE_STAT4 /* Maximum number of samples. 0 if STAT4 data is not collected */ @@ -119683,7 +120517,7 @@ static void statInit( p->db = db; p->nEst = sqlite3_value_int64(argv[2]); p->nRow = 0; - p->nLimit = sqlite3_value_int64(argv[3]); + p->nLimit = sqlite3_value_int(argv[3]); p->nCol = nCol; p->nKeyCol = nKeyCol; p->nSkipAhead = 0; @@ -120816,16 +121650,6 @@ static void decodeIntArray( while( z[0]!=0 && z[0]!=' ' ) z++; while( z[0]==' ' ) z++; } - - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if( aLog[0] > 66 /* Index has more than 100 rows */ - && aLog[0] <= aLog[nOut-1] /* And only a single value seen */ - ){ - pIndex->bLowQual = 1; - } } } @@ -121421,7 +122245,7 @@ static void attachFunc( if( aNew==0 ) return; memcpy(aNew, db->aDb, sizeof(db->aDb[0])*2); }else{ - aNew = sqlite3DbRealloc(db, db->aDb, sizeof(db->aDb[0])*(db->nDb+1) ); + aNew = sqlite3DbRealloc(db, db->aDb, sizeof(db->aDb[0])*(1+(i64)db->nDb)); if( aNew==0 ) return; } db->aDb = aNew; @@ -121492,6 +122316,13 @@ static void attachFunc( sqlite3BtreeEnterAll(db); db->init.iDb = 0; db->mDbFlags &= ~(DBFLAG_SchemaKnownOk); +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + if( db->setlkFlags & SQLITE_SETLK_BLOCK_ON_CONNECT ){ + int val = 1; + sqlite3_file *fd = sqlite3PagerFile(sqlite3BtreePager(pNew->pBt)); + sqlite3OsFileControlHint(fd, SQLITE_FCNTL_BLOCK_ON_CONNECT, &val); + } +#endif if( !REOPEN_AS_MEMDB(db) ){ rc = sqlite3Init(db, &zErrDyn); } @@ -122214,6 +123045,7 @@ static SQLITE_NOINLINE void lockTable( } } + assert( pToplevel->nTableLock < 0x7fff0000 ); nBytes = sizeof(TableLock) * (pToplevel->nTableLock+1); pToplevel->aTableLock = sqlite3DbReallocOrFree(pToplevel->db, pToplevel->aTableLock, nBytes); @@ -122314,10 +123146,12 @@ SQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){ || sqlite3VdbeAssertMayAbort(v, pParse->mayAbort)); if( v ){ if( pParse->bReturning ){ - Returning *pReturning = pParse->u1.pReturning; + Returning *pReturning; int addrRewind; int reg; + assert( !pParse->isCreate ); + pReturning = pParse->u1.d.pReturning; if( pReturning->nRetCol ){ sqlite3VdbeAddOp0(v, OP_FkCheck); addrRewind = @@ -122393,7 +123227,9 @@ SQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){ } if( pParse->bReturning ){ - Returning *pRet = pParse->u1.pReturning; + Returning *pRet; + assert( !pParse->isCreate ); + pRet = pParse->u1.d.pReturning; if( pRet->nRetCol ){ sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pRet->iRetCur, pRet->nRetCol); } @@ -123208,10 +124044,16 @@ SQLITE_PRIVATE Index *sqlite3PrimaryKeyIndex(Table *pTab){ ** find the (first) offset of that column in index pIdx. Or return -1 ** if column iCol is not used in index pIdx. */ -SQLITE_PRIVATE i16 sqlite3TableColumnToIndex(Index *pIdx, i16 iCol){ +SQLITE_PRIVATE int sqlite3TableColumnToIndex(Index *pIdx, int iCol){ int i; + i16 iCol16; + assert( iCol>=(-1) && iCol<=SQLITE_MAX_COLUMN ); + assert( pIdx->nColumn<=SQLITE_MAX_COLUMN+1 ); + iCol16 = iCol; for(i=0; inColumn; i++){ - if( iCol==pIdx->aiColumn[i] ) return i; + if( iCol16==pIdx->aiColumn[i] ){ + return i; + } } return -1; } @@ -123465,8 +124307,9 @@ SQLITE_PRIVATE void sqlite3StartTable( /* If the file format and encoding in the database have not been set, ** set them now. */ - reg1 = pParse->regRowid = ++pParse->nMem; - reg2 = pParse->regRoot = ++pParse->nMem; + assert( pParse->isCreate ); + reg1 = pParse->u1.cr.regRowid = ++pParse->nMem; + reg2 = pParse->u1.cr.regRoot = ++pParse->nMem; reg3 = ++pParse->nMem; sqlite3VdbeAddOp3(v, OP_ReadCookie, iDb, reg3, BTREE_FILE_FORMAT); sqlite3VdbeUsesBtree(v, iDb); @@ -123481,8 +124324,8 @@ SQLITE_PRIVATE void sqlite3StartTable( ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ @@ -123493,7 +124336,7 @@ SQLITE_PRIVATE void sqlite3StartTable( #endif { assert( !pParse->bReturning ); - pParse->u1.addrCrTab = + pParse->u1.cr.addrCrTab = sqlite3VdbeAddOp3(v, OP_CreateBtree, iDb, reg2, BTREE_INTKEY); } sqlite3OpenSchemaTable(pParse, iDb); @@ -123571,7 +124414,8 @@ SQLITE_PRIVATE void sqlite3AddReturning(Parse *pParse, ExprList *pList){ sqlite3ExprListDelete(db, pList); return; } - pParse->u1.pReturning = pRet; + assert( !pParse->isCreate ); + pParse->u1.d.pReturning = pRet; pRet->pParse = pParse; pRet->pReturnEL = pList; sqlite3ParserAddCleanup(pParse, sqlite3DeleteReturning, pRet); @@ -123613,7 +124457,6 @@ SQLITE_PRIVATE void sqlite3AddColumn(Parse *pParse, Token sName, Token sType){ char *zType; Column *pCol; sqlite3 *db = pParse->db; - u8 hName; Column *aNew; u8 eType = COLTYPE_CUSTOM; u8 szEst = 1; @@ -123667,13 +124510,10 @@ SQLITE_PRIVATE void sqlite3AddColumn(Parse *pParse, Token sName, Token sType){ memcpy(z, sName.z, sName.n); z[sName.n] = 0; sqlite3Dequote(z); - hName = sqlite3StrIHash(z); - for(i=0; inCol; i++){ - if( p->aCol[i].hName==hName && sqlite3StrICmp(z, p->aCol[i].zCnName)==0 ){ - sqlite3ErrorMsg(pParse, "duplicate column name: %s", z); - sqlite3DbFree(db, z); - return; - } + if( p->nCol && sqlite3ColumnIndex(p, z)>=0 ){ + sqlite3ErrorMsg(pParse, "duplicate column name: %s", z); + sqlite3DbFree(db, z); + return; } aNew = sqlite3DbRealloc(db,p->aCol,((i64)p->nCol+1)*sizeof(p->aCol[0])); if( aNew==0 ){ @@ -123684,7 +124524,7 @@ SQLITE_PRIVATE void sqlite3AddColumn(Parse *pParse, Token sName, Token sType){ pCol = &p->aCol[p->nCol]; memset(pCol, 0, sizeof(p->aCol[0])); pCol->zCnName = z; - pCol->hName = hName; + pCol->hName = sqlite3StrIHash(z); sqlite3ColumnPropertiesFromName(p, pCol); if( sType.n==0 ){ @@ -123708,9 +124548,14 @@ SQLITE_PRIVATE void sqlite3AddColumn(Parse *pParse, Token sName, Token sType){ pCol->affinity = sqlite3AffinityType(zType, pCol); pCol->colFlags |= COLFLAG_HASTYPE; } + if( p->nCol<=0xff ){ + u8 h = pCol->hName % sizeof(p->aHx); + p->aHx[h] = p->nCol; + } p->nCol++; p->nNVCol++; - pParse->constraintName.n = 0; + assert( pParse->isCreate ); + pParse->u1.cr.constraintName.n = 0; } /* @@ -123974,15 +124819,11 @@ SQLITE_PRIVATE void sqlite3AddPrimaryKey( assert( pCExpr!=0 ); sqlite3StringToId(pCExpr); if( pCExpr->op==TK_ID ){ - const char *zCName; assert( !ExprHasProperty(pCExpr, EP_IntValue) ); - zCName = pCExpr->u.zToken; - for(iCol=0; iColnCol; iCol++){ - if( sqlite3StrICmp(zCName, pTab->aCol[iCol].zCnName)==0 ){ - pCol = &pTab->aCol[iCol]; - makeColumnPartOfPrimaryKey(pParse, pCol); - break; - } + iCol = sqlite3ColumnIndex(pTab, pCExpr->u.zToken); + if( iCol>=0 ){ + pCol = &pTab->aCol[iCol]; + makeColumnPartOfPrimaryKey(pParse, pCol); } } } @@ -124034,8 +124875,10 @@ SQLITE_PRIVATE void sqlite3AddCheckConstraint( && !sqlite3BtreeIsReadonly(db->aDb[db->init.iDb].pBt) ){ pTab->pCheck = sqlite3ExprListAppend(pParse, pTab->pCheck, pCheckExpr); - if( pParse->constraintName.n ){ - sqlite3ExprListSetName(pParse, pTab->pCheck, &pParse->constraintName, 1); + assert( pParse->isCreate ); + if( pParse->u1.cr.constraintName.n ){ + sqlite3ExprListSetName(pParse, pTab->pCheck, + &pParse->u1.cr.constraintName, 1); }else{ Token t; for(zStart++; sqlite3Isspace(zStart[0]); zStart++){} @@ -124230,7 +125073,8 @@ static void identPut(char *z, int *pIdx, char *zSignedIdent){ ** from sqliteMalloc() and must be freed by the calling function. */ static char *createTableStmt(sqlite3 *db, Table *p){ - int i, k, n; + int i, k, len; + i64 n; char *zStmt; char *zSep, *zSep2, *zEnd; Column *pCol; @@ -124254,8 +125098,9 @@ static char *createTableStmt(sqlite3 *db, Table *p){ sqlite3OomFault(db); return 0; } - sqlite3_snprintf(n, zStmt, "CREATE TABLE "); - k = sqlite3Strlen30(zStmt); + assert( n>14 && n<=0x7fffffff ); + memcpy(zStmt, "CREATE TABLE ", 13); + k = 13; identPut(zStmt, &k, p->zName); zStmt[k++] = '('; for(pCol=p->aCol, i=0; inCol; i++, pCol++){ @@ -124267,13 +125112,15 @@ static char *createTableStmt(sqlite3 *db, Table *p){ /* SQLITE_AFF_REAL */ " REAL", /* SQLITE_AFF_FLEXNUM */ " NUM", }; - int len; const char *zType; - sqlite3_snprintf(n-k, &zStmt[k], zSep); - k += sqlite3Strlen30(&zStmt[k]); + len = sqlite3Strlen30(zSep); + assert( k+lenzCnName); + assert( kaffinity-SQLITE_AFF_BLOB >= 0 ); assert( pCol->affinity-SQLITE_AFF_BLOB < ArraySize(azType) ); testcase( pCol->affinity==SQLITE_AFF_BLOB ); @@ -124288,11 +125135,14 @@ static char *createTableStmt(sqlite3 *db, Table *p){ assert( pCol->affinity==SQLITE_AFF_BLOB || pCol->affinity==SQLITE_AFF_FLEXNUM || pCol->affinity==sqlite3AffinityType(zType, 0) ); + assert( k+lennColumn>=N ) return SQLITE_OK; + db = pParse->db; + assert( N>0 ); + assert( N <= SQLITE_MAX_COLUMN*2 /* tag-20250221-1 */ ); + testcase( N==2*pParse->db->aLimit[SQLITE_LIMIT_COLUMN] ); assert( pIdx->isResized==0 ); - nByte = (sizeof(char*) + sizeof(LogEst) + sizeof(i16) + 1)*N; + nByte = (sizeof(char*) + sizeof(LogEst) + sizeof(i16) + 1)*(u64)N; zExtra = sqlite3DbMallocZero(db, nByte); if( zExtra==0 ) return SQLITE_NOMEM_BKPT; memcpy(zExtra, pIdx->azColl, sizeof(char*)*pIdx->nColumn); @@ -124319,7 +125174,7 @@ static int resizeIndexObject(sqlite3 *db, Index *pIdx, int N){ zExtra += sizeof(i16)*N; memcpy(zExtra, pIdx->aSortOrder, pIdx->nColumn); pIdx->aSortOrder = (u8*)zExtra; - pIdx->nColumn = N; + pIdx->nColumn = (u16)N; /* See tag-20250221-1 above for proof of safety */ pIdx->isResized = 1; return SQLITE_OK; } @@ -124485,9 +125340,9 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ ** into BTREE_BLOBKEY. */ assert( !pParse->bReturning ); - if( pParse->u1.addrCrTab ){ + if( pParse->u1.cr.addrCrTab ){ assert( v ); - sqlite3VdbeChangeP3(v, pParse->u1.addrCrTab, BTREE_BLOBKEY); + sqlite3VdbeChangeP3(v, pParse->u1.cr.addrCrTab, BTREE_BLOBKEY); } /* Locate the PRIMARY KEY index. Or, if this table was originally @@ -124573,14 +125428,14 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ pIdx->nColumn = pIdx->nKeyCol; continue; } - if( resizeIndexObject(db, pIdx, pIdx->nKeyCol+n) ) return; + if( resizeIndexObject(pParse, pIdx, pIdx->nKeyCol+n) ) return; for(i=0, j=pIdx->nKeyCol; inKeyCol, pPk, i) ){ testcase( hasColumn(pIdx->aiColumn, pIdx->nKeyCol, pPk->aiColumn[i]) ); pIdx->aiColumn[j] = pPk->aiColumn[i]; pIdx->azColl[j] = pPk->azColl[i]; if( pPk->aSortOrder[i] ){ - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ pIdx->bAscKeyBug = 1; } j++; @@ -124597,7 +125452,7 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){ if( !hasColumn(pPk->aiColumn, nPk, i) && (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 ) nExtra++; } - if( resizeIndexObject(db, pPk, nPk+nExtra) ) return; + if( resizeIndexObject(pParse, pPk, nPk+nExtra) ) return; for(i=0, j=nPk; inCol; i++){ if( !hasColumn(pPk->aiColumn, j, i) && (pTab->aCol[i].colFlags & COLFLAG_VIRTUAL)==0 @@ -124927,7 +125782,7 @@ SQLITE_PRIVATE void sqlite3EndTable( /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -124958,7 +125813,8 @@ SQLITE_PRIVATE void sqlite3EndTable( regRec = ++pParse->nMem; regRowid = ++pParse->nMem; sqlite3MayAbort(pParse); - sqlite3VdbeAddOp3(v, OP_OpenWrite, iCsr, pParse->regRoot, iDb); + assert( pParse->isCreate ); + sqlite3VdbeAddOp3(v, OP_OpenWrite, iCsr, pParse->u1.cr.regRoot, iDb); sqlite3VdbeChangeP5(v, OPFLAG_P2ISREG); addrTop = sqlite3VdbeCurrentAddr(v) + 1; sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, addrTop); @@ -125003,6 +125859,7 @@ SQLITE_PRIVATE void sqlite3EndTable( ** schema table. We just need to update that slot with all ** the information we've collected. */ + assert( pParse->isCreate ); sqlite3NestedParse(pParse, "UPDATE %Q." LEGACY_SCHEMA_TABLE " SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q" @@ -125011,9 +125868,9 @@ SQLITE_PRIVATE void sqlite3EndTable( zType, p->zName, p->zName, - pParse->regRoot, + pParse->u1.cr.regRoot, zStmt, - pParse->regRowid + pParse->u1.cr.regRowid ); sqlite3DbFree(db, zStmt); sqlite3ChangeCookie(pParse, iDb); @@ -125753,7 +126610,7 @@ SQLITE_PRIVATE void sqlite3CreateForeignKey( }else{ nCol = pFromCol->nExpr; } - nByte = sizeof(*pFKey) + (nCol-1)*sizeof(pFKey->aCol[0]) + pTo->n + 1; + nByte = SZ_FKEY(nCol) + pTo->n + 1; if( pToCol ){ for(i=0; inExpr; i++){ nByte += sqlite3Strlen30(pToCol->a[i].zEName) + 1; @@ -125955,7 +126812,7 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){ ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ sqlite3VdbeAddOp1(v, OP_SeekEnd, iIdx); } @@ -125979,13 +126836,14 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){ */ SQLITE_PRIVATE Index *sqlite3AllocateIndexObject( sqlite3 *db, /* Database connection */ - i16 nCol, /* Total number of columns in the index */ + int nCol, /* Total number of columns in the index */ int nExtra, /* Number of bytes of extra space to alloc */ char **ppExtra /* Pointer to the "extra" space */ ){ Index *p; /* Allocated index object */ - int nByte; /* Bytes of space for Index object + arrays */ + i64 nByte; /* Bytes of space for Index object + arrays */ + assert( nCol <= 2*db->aLimit[SQLITE_LIMIT_COLUMN] ); nByte = ROUND8(sizeof(Index)) + /* Index structure */ ROUND8(sizeof(char*)*nCol) + /* Index.azColl */ ROUND8(sizeof(LogEst)*(nCol+1) + /* Index.aiRowLogEst */ @@ -125998,8 +126856,9 @@ SQLITE_PRIVATE Index *sqlite3AllocateIndexObject( p->aiRowLogEst = (LogEst*)pExtra; pExtra += sizeof(LogEst)*(nCol+1); p->aiColumn = (i16*)pExtra; pExtra += sizeof(i16)*nCol; p->aSortOrder = (u8*)pExtra; - p->nColumn = nCol; - p->nKeyCol = nCol - 1; + assert( nCol>0 ); + p->nColumn = (u16)nCol; + p->nKeyCol = (u16)(nCol - 1); *ppExtra = ((char*)p) + nByte; } return p; @@ -126810,12 +127669,11 @@ SQLITE_PRIVATE IdList *sqlite3IdListAppend(Parse *pParse, IdList *pList, Token * sqlite3 *db = pParse->db; int i; if( pList==0 ){ - pList = sqlite3DbMallocZero(db, sizeof(IdList) ); + pList = sqlite3DbMallocZero(db, SZ_IDLIST(1)); if( pList==0 ) return 0; }else{ IdList *pNew; - pNew = sqlite3DbRealloc(db, pList, - sizeof(IdList) + pList->nId*sizeof(pList->a)); + pNew = sqlite3DbRealloc(db, pList, SZ_IDLIST(pList->nId+1)); if( pNew==0 ){ sqlite3IdListDelete(db, pList); return 0; @@ -126914,8 +127772,7 @@ SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge( return 0; } if( nAlloc>SQLITE_MAX_SRCLIST ) nAlloc = SQLITE_MAX_SRCLIST; - pNew = sqlite3DbRealloc(db, pSrc, - sizeof(*pSrc) + (nAlloc-1)*sizeof(pSrc->a[0]) ); + pNew = sqlite3DbRealloc(db, pSrc, SZ_SRCLIST(nAlloc)); if( pNew==0 ){ assert( db->mallocFailed ); return 0; @@ -126990,7 +127847,7 @@ SQLITE_PRIVATE SrcList *sqlite3SrcListAppend( assert( pParse->db!=0 ); db = pParse->db; if( pList==0 ){ - pList = sqlite3DbMallocRawNN(pParse->db, sizeof(SrcList) ); + pList = sqlite3DbMallocRawNN(pParse->db, SZ_SRCLIST(1)); if( pList==0 ) return 0; pList->nAlloc = 1; pList->nSrc = 1; @@ -127876,10 +128733,9 @@ SQLITE_PRIVATE With *sqlite3WithAdd( } if( pWith ){ - sqlite3_int64 nByte = sizeof(*pWith) + (sizeof(pWith->a[1]) * pWith->nCte); - pNew = sqlite3DbRealloc(db, pWith, nByte); + pNew = sqlite3DbRealloc(db, pWith, SZ_WITH(pWith->nCte+1)); }else{ - pNew = sqlite3DbMallocZero(db, sizeof(*pWith)); + pNew = sqlite3DbMallocZero(db, SZ_WITH(1)); } assert( (pNew!=0 && zName!=0) || db->mallocFailed ); @@ -129853,11 +130709,6 @@ static void substrFunc( i64 p1, p2; assert( argc==3 || argc==2 ); - if( sqlite3_value_type(argv[1])==SQLITE_NULL - || (argc==3 && sqlite3_value_type(argv[2])==SQLITE_NULL) - ){ - return; - } p0type = sqlite3_value_type(argv[0]); p1 = sqlite3_value_int64(argv[1]); if( p0type==SQLITE_BLOB ){ @@ -129875,19 +130726,23 @@ static void substrFunc( } } } -#ifdef SQLITE_SUBSTR_COMPATIBILITY - /* If SUBSTR_COMPATIBILITY is defined then substr(X,0,N) work the same as - ** as substr(X,1,N) - it returns the first N characters of X. This - ** is essentially a back-out of the bug-fix in check-in [5fc125d362df4b8] - ** from 2009-02-02 for compatibility of applications that exploited the - ** old buggy behavior. */ - if( p1==0 ) p1 = 1; /* */ -#endif if( argc==3 ){ p2 = sqlite3_value_int64(argv[2]); + if( p2==0 && sqlite3_value_type(argv[2])==SQLITE_NULL ) return; }else{ p2 = sqlite3_context_db_handle(context)->aLimit[SQLITE_LIMIT_LENGTH]; } + if( p1==0 ){ +#ifdef SQLITE_SUBSTR_COMPATIBILITY + /* If SUBSTR_COMPATIBILITY is defined then substr(X,0,N) work the same as + ** as substr(X,1,N) - it returns the first N characters of X. This + ** is essentially a back-out of the bug-fix in check-in [5fc125d362df4b8] + ** from 2009-02-02 for compatibility of applications that exploited the + ** old buggy behavior. */ + p1 = 1; /* */ +#endif + if( sqlite3_value_type(argv[1])==SQLITE_NULL ) return; + } if( p1<0 ){ p1 += len; if( p1<0 ){ @@ -130588,7 +131443,7 @@ static const char hexdigits[] = { ** Append to pStr text that is the SQL literal representation of the ** value contained in pValue. */ -SQLITE_PRIVATE void sqlite3QuoteValue(StrAccum *pStr, sqlite3_value *pValue){ +SQLITE_PRIVATE void sqlite3QuoteValue(StrAccum *pStr, sqlite3_value *pValue, int bEscape){ /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ @@ -130636,7 +131491,7 @@ SQLITE_PRIVATE void sqlite3QuoteValue(StrAccum *pStr, sqlite3_value *pValue){ } case SQLITE_TEXT: { const unsigned char *zArg = sqlite3_value_text(pValue); - sqlite3_str_appendf(pStr, "%Q", zArg); + sqlite3_str_appendf(pStr, bEscape ? "%#Q" : "%Q", zArg); break; } default: { @@ -130647,6 +131502,105 @@ SQLITE_PRIVATE void sqlite3QuoteValue(StrAccum *pStr, sqlite3_value *pValue){ } } +/* +** Return true if z[] begins with N hexadecimal digits, and write +** a decoding of those digits into *pVal. Or return false if any +** one of the first N characters in z[] is not a hexadecimal digit. +*/ +static int isNHex(const char *z, int N, u32 *pVal){ + int i; + int v = 0; + for(i=0; i0 ){ + memmove(&zOut[j], &zIn[i], n); + j += n; + i += n; + } + if( zIn[i+1]=='\\' ){ + i += 2; + zOut[j++] = '\\'; + }else if( sqlite3Isxdigit(zIn[i+1]) ){ + if( !isNHex(&zIn[i+1], 4, &v) ) goto unistr_error; + i += 5; + j += sqlite3AppendOneUtf8Character(&zOut[j], v); + }else if( zIn[i+1]=='+' ){ + if( !isNHex(&zIn[i+2], 6, &v) ) goto unistr_error; + i += 8; + j += sqlite3AppendOneUtf8Character(&zOut[j], v); + }else if( zIn[i+1]=='u' ){ + if( !isNHex(&zIn[i+2], 4, &v) ) goto unistr_error; + i += 6; + j += sqlite3AppendOneUtf8Character(&zOut[j], v); + }else if( zIn[i+1]=='U' ){ + if( !isNHex(&zIn[i+2], 8, &v) ) goto unistr_error; + i += 10; + j += sqlite3AppendOneUtf8Character(&zOut[j], v); + }else{ + goto unistr_error; + } + } + zOut[j] = 0; + sqlite3_result_text64(context, zOut, j, sqlite3_free, SQLITE_UTF8); + return; + +unistr_error: + sqlite3_free(zOut); + sqlite3_result_error(context, "invalid Unicode escape", -1); + return; +} + + /* ** Implementation of the QUOTE() function. ** @@ -130656,6 +131610,10 @@ SQLITE_PRIVATE void sqlite3QuoteValue(StrAccum *pStr, sqlite3_value *pValue){ ** as needed. BLOBs are encoded as hexadecimal literals. Strings with ** embedded NUL characters cannot be represented as string literals in SQL ** and hence the returned string literal is truncated prior to the first NUL. +** +** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +** implemented instead. The difference is that UNISTR_QUOTE() uses the +** UNISTR() function to escape control characters. */ static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ sqlite3_str str; @@ -130663,7 +131621,7 @@ static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ assert( argc==1 ); UNUSED_PARAMETER(argc); sqlite3StrAccumInit(&str, db, 0, 0, db->aLimit[SQLITE_LIMIT_LENGTH]); - sqlite3QuoteValue(&str,argv[0]); + sqlite3QuoteValue(&str,argv[0],SQLITE_PTR_TO_INT(sqlite3_user_data(context))); sqlite3_result_text(context, sqlite3StrAccumFinish(&str), str.nChar, SQLITE_DYNAMIC); if( str.accError!=SQLITE_OK ){ @@ -130918,7 +131876,7 @@ static void replaceFunc( assert( zRep==sqlite3_value_text(argv[2]) ); nOut = nStr + 1; assert( nOut0 ){ + if( sqlite3_value_type(argv[i])!=SQLITE_NULL ){ + int k = sqlite3_value_bytes(argv[i]); const char *v = (const char*)sqlite3_value_text(argv[i]); if( v!=0 ){ if( j>0 && nSep>0 ){ @@ -131314,7 +132272,7 @@ static void kahanBabuskaNeumaierInit( ** that it returns NULL if it sums over no inputs. TOTAL returns ** 0.0 in that case. In addition, TOTAL always returns a float where ** SUM might return an integer if it never encounters a floating point -** value. TOTAL never fails, but SUM might through an exception if +** value. TOTAL never fails, but SUM might throw an exception if ** it overflows an integer. */ static void sumStep(sqlite3_context *context, int argc, sqlite3_value **argv){ @@ -132234,7 +133192,9 @@ SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void){ DFUNCTION(sqlite_version, 0, 0, 0, versionFunc ), DFUNCTION(sqlite_source_id, 0, 0, 0, sourceidFunc ), FUNCTION(sqlite_log, 2, 0, 0, errlogFunc ), + FUNCTION(unistr, 1, 0, 0, unistrFunc ), FUNCTION(quote, 1, 0, 0, quoteFunc ), + FUNCTION(unistr_quote, 1, 1, 0, quoteFunc ), VFUNCTION(last_insert_rowid, 0, 0, 0, last_insert_rowid), VFUNCTION(changes, 0, 0, 0, changes ), VFUNCTION(total_changes, 0, 0, 0, total_changes ), @@ -134521,7 +135481,7 @@ SQLITE_PRIVATE Select *sqlite3MultiValues(Parse *pParse, Select *pLeft, ExprList f = (f & pLeft->selFlags); } pSelect = sqlite3SelectNew(pParse, pRow, 0, 0, 0, 0, 0, f, 0); - pLeft->selFlags &= ~SF_MultiValue; + pLeft->selFlags &= ~(u32)SF_MultiValue; if( pSelect ){ pSelect->op = TK_ALL; pSelect->pPrior = pLeft; @@ -134903,28 +135863,22 @@ SQLITE_PRIVATE void sqlite3Insert( aTabColMap = sqlite3DbMallocZero(db, pTab->nCol*sizeof(int)); if( aTabColMap==0 ) goto insert_cleanup; for(i=0; inId; i++){ - const char *zCName = pColumn->a[i].zName; - u8 hName = sqlite3StrIHash(zCName); - for(j=0; jnCol; j++){ - if( pTab->aCol[j].hName!=hName ) continue; - if( sqlite3StrICmp(zCName, pTab->aCol[j].zCnName)==0 ){ - if( aTabColMap[j]==0 ) aTabColMap[j] = i+1; - if( i!=j ) bIdListInOrder = 0; - if( j==pTab->iPKey ){ - ipkColumn = i; assert( !withoutRowid ); - } -#ifndef SQLITE_OMIT_GENERATED_COLUMNS - if( pTab->aCol[j].colFlags & (COLFLAG_STORED|COLFLAG_VIRTUAL) ){ - sqlite3ErrorMsg(pParse, - "cannot INSERT into generated column \"%s\"", - pTab->aCol[j].zCnName); - goto insert_cleanup; - } -#endif - break; + j = sqlite3ColumnIndex(pTab, pColumn->a[i].zName); + if( j>=0 ){ + if( aTabColMap[j]==0 ) aTabColMap[j] = i+1; + if( i!=j ) bIdListInOrder = 0; + if( j==pTab->iPKey ){ + ipkColumn = i; assert( !withoutRowid ); } - } - if( j>=pTab->nCol ){ +#ifndef SQLITE_OMIT_GENERATED_COLUMNS + if( pTab->aCol[j].colFlags & (COLFLAG_STORED|COLFLAG_VIRTUAL) ){ + sqlite3ErrorMsg(pParse, + "cannot INSERT into generated column \"%s\"", + pTab->aCol[j].zCnName); + goto insert_cleanup; + } +#endif + }else{ if( sqlite3IsRowid(pColumn->a[i].zName) && !withoutRowid ){ ipkColumn = i; bIdListInOrder = 0; @@ -135222,7 +136176,7 @@ SQLITE_PRIVATE void sqlite3Insert( continue; }else if( pColumn==0 ){ /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ sqlite3ExprCodeFactorable(pParse, sqlite3ColumnExpr(pTab, &pTab->aCol[i]), iRegStore); @@ -135947,7 +136901,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks( ** could happen in any order, but they are grouped up front for ** convenience. ** - ** 2018-08-14: Ticket https://www.sqlite.org/src/info/908f001483982c43 + ** 2018-08-14: Ticket https://sqlite.org/src/info/908f001483982c43 ** The order of constraints used to have OE_Update as (2) and OE_Abort ** and so forth as (1). But apparently PostgreSQL checks the OE_Update ** constraint before any others, so it had to be moved. @@ -137757,6 +138711,8 @@ struct sqlite3_api_routines { /* Version 3.44.0 and later */ void *(*get_clientdata)(sqlite3*,const char*); int (*set_clientdata)(sqlite3*, const char*, void*, void(*)(void*)); + /* Version 3.50.0 and later */ + int (*setlk_timeout)(sqlite3*,int,int); }; /* @@ -138090,6 +139046,8 @@ typedef int (*sqlite3_loadext_entry)( /* Version 3.44.0 and later */ #define sqlite3_get_clientdata sqlite3_api->get_clientdata #define sqlite3_set_clientdata sqlite3_api->set_clientdata +/* Version 3.50.0 and later */ +#define sqlite3_setlk_timeout sqlite3_api->setlk_timeout #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */ #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) @@ -138611,7 +139569,9 @@ static const sqlite3_api_routines sqlite3Apis = { sqlite3_stmt_explain, /* Version 3.44.0 and later */ sqlite3_get_clientdata, - sqlite3_set_clientdata + sqlite3_set_clientdata, + /* Version 3.50.0 and later */ + sqlite3_setlk_timeout }; /* True if x is the directory separator character @@ -139133,48 +140093,48 @@ static const char *const pragCName[] = { /* 13 */ "pk", /* 14 */ "hidden", /* table_info reuses 8 */ - /* 15 */ "schema", /* Used by: table_list */ - /* 16 */ "name", + /* 15 */ "name", /* Used by: function_list */ + /* 16 */ "builtin", /* 17 */ "type", - /* 18 */ "ncol", - /* 19 */ "wr", - /* 20 */ "strict", - /* 21 */ "seqno", /* Used by: index_xinfo */ - /* 22 */ "cid", - /* 23 */ "name", - /* 24 */ "desc", - /* 25 */ "coll", - /* 26 */ "key", - /* 27 */ "name", /* Used by: function_list */ - /* 28 */ "builtin", - /* 29 */ "type", - /* 30 */ "enc", - /* 31 */ "narg", - /* 32 */ "flags", - /* 33 */ "tbl", /* Used by: stats */ - /* 34 */ "idx", - /* 35 */ "wdth", - /* 36 */ "hght", - /* 37 */ "flgs", - /* 38 */ "seq", /* Used by: index_list */ - /* 39 */ "name", - /* 40 */ "unique", - /* 41 */ "origin", - /* 42 */ "partial", + /* 18 */ "enc", + /* 19 */ "narg", + /* 20 */ "flags", + /* 21 */ "schema", /* Used by: table_list */ + /* 22 */ "name", + /* 23 */ "type", + /* 24 */ "ncol", + /* 25 */ "wr", + /* 26 */ "strict", + /* 27 */ "seqno", /* Used by: index_xinfo */ + /* 28 */ "cid", + /* 29 */ "name", + /* 30 */ "desc", + /* 31 */ "coll", + /* 32 */ "key", + /* 33 */ "seq", /* Used by: index_list */ + /* 34 */ "name", + /* 35 */ "unique", + /* 36 */ "origin", + /* 37 */ "partial", + /* 38 */ "tbl", /* Used by: stats */ + /* 39 */ "idx", + /* 40 */ "wdth", + /* 41 */ "hght", + /* 42 */ "flgs", /* 43 */ "table", /* Used by: foreign_key_check */ /* 44 */ "rowid", /* 45 */ "parent", /* 46 */ "fkid", - /* index_info reuses 21 */ - /* 47 */ "seq", /* Used by: database_list */ - /* 48 */ "name", - /* 49 */ "file", - /* 50 */ "busy", /* Used by: wal_checkpoint */ - /* 51 */ "log", - /* 52 */ "checkpointed", - /* collation_list reuses 38 */ + /* 47 */ "busy", /* Used by: wal_checkpoint */ + /* 48 */ "log", + /* 49 */ "checkpointed", + /* 50 */ "seq", /* Used by: database_list */ + /* 51 */ "name", + /* 52 */ "file", + /* index_info reuses 27 */ /* 53 */ "database", /* Used by: lock_status */ /* 54 */ "status", + /* collation_list reuses 33 */ /* 55 */ "cache_size", /* Used by: default_cache_size */ /* module_list pragma_list reuses 9 */ /* 56 */ "timeout", /* Used by: busy_timeout */ @@ -139267,7 +140227,7 @@ static const PragmaName aPragmaName[] = { {/* zName: */ "collation_list", /* ePragTyp: */ PragTyp_COLLATION_LIST, /* ePragFlg: */ PragFlg_Result0, - /* ColNames: */ 38, 2, + /* ColNames: */ 33, 2, /* iArg: */ 0 }, #endif #if !defined(SQLITE_OMIT_COMPILEOPTION_DIAGS) @@ -139302,7 +140262,7 @@ static const PragmaName aPragmaName[] = { {/* zName: */ "database_list", /* ePragTyp: */ PragTyp_DATABASE_LIST, /* ePragFlg: */ PragFlg_Result0, - /* ColNames: */ 47, 3, + /* ColNames: */ 50, 3, /* iArg: */ 0 }, #endif #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED) @@ -139382,7 +140342,7 @@ static const PragmaName aPragmaName[] = { {/* zName: */ "function_list", /* ePragTyp: */ PragTyp_FUNCTION_LIST, /* ePragFlg: */ PragFlg_Result0, - /* ColNames: */ 27, 6, + /* ColNames: */ 15, 6, /* iArg: */ 0 }, #endif #endif @@ -139411,17 +140371,17 @@ static const PragmaName aPragmaName[] = { {/* zName: */ "index_info", /* ePragTyp: */ PragTyp_INDEX_INFO, /* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result1|PragFlg_SchemaOpt, - /* ColNames: */ 21, 3, + /* ColNames: */ 27, 3, /* iArg: */ 0 }, {/* zName: */ "index_list", /* ePragTyp: */ PragTyp_INDEX_LIST, /* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result1|PragFlg_SchemaOpt, - /* ColNames: */ 38, 5, + /* ColNames: */ 33, 5, /* iArg: */ 0 }, {/* zName: */ "index_xinfo", /* ePragTyp: */ PragTyp_INDEX_INFO, /* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result1|PragFlg_SchemaOpt, - /* ColNames: */ 21, 6, + /* ColNames: */ 27, 6, /* iArg: */ 1 }, #endif #if !defined(SQLITE_OMIT_INTEGRITY_CHECK) @@ -139600,7 +140560,7 @@ static const PragmaName aPragmaName[] = { {/* zName: */ "stats", /* ePragTyp: */ PragTyp_STATS, /* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq, - /* ColNames: */ 33, 5, + /* ColNames: */ 38, 5, /* iArg: */ 0 }, #endif #if !defined(SQLITE_OMIT_PAGER_PRAGMAS) @@ -139619,7 +140579,7 @@ static const PragmaName aPragmaName[] = { {/* zName: */ "table_list", /* ePragTyp: */ PragTyp_TABLE_LIST, /* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result1, - /* ColNames: */ 15, 6, + /* ColNames: */ 21, 6, /* iArg: */ 0 }, {/* zName: */ "table_xinfo", /* ePragTyp: */ PragTyp_TABLE_INFO, @@ -139696,7 +140656,7 @@ static const PragmaName aPragmaName[] = { {/* zName: */ "wal_checkpoint", /* ePragTyp: */ PragTyp_WAL_CHECKPOINT, /* ePragFlg: */ PragFlg_NeedSchema, - /* ColNames: */ 50, 3, + /* ColNames: */ 47, 3, /* iArg: */ 0 }, #endif #if !defined(SQLITE_OMIT_FLAG_PRAGMAS) @@ -139718,7 +140678,7 @@ static const PragmaName aPragmaName[] = { ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -140835,7 +141795,10 @@ SQLITE_PRIVATE void sqlite3Pragma( } }else{ db->flags &= ~mask; - if( mask==SQLITE_DeferFKs ) db->nDeferredImmCons = 0; + if( mask==SQLITE_DeferFKs ){ + db->nDeferredImmCons = 0; + db->nDeferredCons = 0; + } if( (mask & SQLITE_WriteSchema)!=0 && sqlite3_stricmp(zRight, "reset")==0 ){ @@ -144004,7 +144967,7 @@ SQLITE_PRIVATE Select *sqlite3SelectNew( pNew->addrOpenEphm[0] = -1; pNew->addrOpenEphm[1] = -1; pNew->nSelectRow = 0; - if( pSrc==0 ) pSrc = sqlite3DbMallocZero(pParse->db, sizeof(*pSrc)); + if( pSrc==0 ) pSrc = sqlite3DbMallocZero(pParse->db, SZ_SRCLIST_1); pNew->pSrc = pSrc; pNew->pWhere = pWhere; pNew->pGroupBy = pGroupBy; @@ -144169,10 +145132,33 @@ SQLITE_PRIVATE int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *p */ SQLITE_PRIVATE int sqlite3ColumnIndex(Table *pTab, const char *zCol){ int i; - u8 h = sqlite3StrIHash(zCol); - Column *pCol; - for(pCol=pTab->aCol, i=0; inCol; pCol++, i++){ - if( pCol->hName==h && sqlite3StrICmp(pCol->zCnName, zCol)==0 ) return i; + u8 h; + const Column *aCol; + int nCol; + + h = sqlite3StrIHash(zCol); + aCol = pTab->aCol; + nCol = pTab->nCol; + + /* See if the aHx gives us a lucky match */ + i = pTab->aHx[h % sizeof(pTab->aHx)]; + assert( i=nCol ) break; } return -1; } @@ -144423,7 +145409,7 @@ static int sqlite3ProcessJoin(Parse *pParse, Select *p){ } pE1 = sqlite3CreateColumnExpr(db, pSrc, iLeft, iLeftCol); sqlite3SrcItemColumnUsed(&pSrc->a[iLeft], iLeftCol); - if( (pSrc->a[0].fg.jointype & JT_LTORJ)!=0 ){ + if( (pSrc->a[0].fg.jointype & JT_LTORJ)!=0 && pParse->nErr==0 ){ /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -144439,6 +145425,8 @@ static int sqlite3ProcessJoin(Parse *pParse, Select *p){ */ ExprList *pFuncArgs = 0; /* Arguments to the coalesce() */ static const Token tkCoalesce = { "coalesce", 8 }; + assert( pE1!=0 ); + ExprSetProperty(pE1, EP_CanBeNull); while( tableAndColumnIndex(pSrc, iLeft+1, i, zName, &iLeft, &iLeftCol, pRight->fg.isSynthUsing)!=0 ){ if( pSrc->a[iLeft].fg.isUsing==0 @@ -144455,7 +145443,13 @@ static int sqlite3ProcessJoin(Parse *pParse, Select *p){ if( pFuncArgs ){ pFuncArgs = sqlite3ExprListAppend(pParse, pFuncArgs, pE1); pE1 = sqlite3ExprFunction(pParse, pFuncArgs, &tkCoalesce, 0); + if( pE1 ){ + pE1->affExpr = SQLITE_AFF_DEFER; + } } + }else if( (pSrc->a[i+1].fg.jointype & JT_LEFT)!=0 && pParse->nErr==0 ){ + assert( pE1!=0 ); + ExprSetProperty(pE1, EP_CanBeNull); } pE2 = sqlite3CreateColumnExpr(db, pSrc, i+1, iRightCol); sqlite3SrcItemColumnUsed(pRight, iRightCol); @@ -145364,8 +146358,8 @@ static void selectInnerLoop( ** X extra columns. */ SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoAlloc(sqlite3 *db, int N, int X){ - int nExtra = (N+X)*(sizeof(CollSeq*)+1) - sizeof(CollSeq*); - KeyInfo *p = sqlite3DbMallocRawNN(db, sizeof(KeyInfo) + nExtra); + int nExtra = (N+X)*(sizeof(CollSeq*)+1); + KeyInfo *p = sqlite3DbMallocRawNN(db, SZ_KEYINFO(0) + nExtra); if( p ){ p->aSortFlags = (u8*)&p->aColl[N+X]; p->nKeyField = (u16)N; @@ -145373,7 +146367,7 @@ SQLITE_PRIVATE KeyInfo *sqlite3KeyInfoAlloc(sqlite3 *db, int N, int X){ p->enc = ENC(db); p->db = db; p->nRef = 1; - memset(&p[1], 0, nExtra); + memset(p->aColl, 0, nExtra); }else{ return (KeyInfo*)sqlite3OomFault(db); } @@ -147074,6 +148068,7 @@ static int multiSelect( multi_select_end: pDest->iSdst = dest.iSdst; pDest->nSdst = dest.nSdst; + pDest->iSDParm2 = dest.iSDParm2; if( pDelete ){ sqlite3ParserAddCleanup(pParse, sqlite3SelectDeleteGeneric, pDelete); } @@ -148062,9 +149057,9 @@ static int compoundHasDifferentAffinities(Select *p){ ** from 2015-02-09.) ** ** (3) If the subquery is the right operand of a LEFT JOIN then -** (3a) the subquery may not be a join and -** (3b) the FROM clause of the subquery may not contain a virtual -** table and +** (3a) the subquery may not be a join +** (**) Was (3b): "the FROM clause of the subquery may not contain +** a virtual table" ** (**) Was: "The outer query may not have a GROUP BY." This case ** is now managed correctly ** (3d) the outer query may not be DISTINCT. @@ -148280,7 +149275,7 @@ static int flattenSubquery( */ if( (pSubitem->fg.jointype & (JT_OUTER|JT_LTORJ))!=0 ){ if( pSubSrc->nSrc>1 /* (3a) */ - || IsVirtual(pSubSrc->a[0].pSTab) /* (3b) */ + /**** || IsVirtual(pSubSrc->a[0].pSTab) (3b)-omitted */ || (p->selFlags & SF_Distinct)!=0 /* (3d) */ || (pSubitem->fg.jointype & JT_RIGHT)!=0 /* (26) */ ){ @@ -148684,7 +149679,8 @@ static void constInsert( return; /* Already present. Return without doing anything. */ } } - if( sqlite3ExprAffinity(pColumn)==SQLITE_AFF_BLOB ){ + assert( SQLITE_AFF_NONEbHasAffBlob = 1; } @@ -148759,7 +149755,8 @@ static int propagateConstantExprRewriteOne( if( pColumn==pExpr ) continue; if( pColumn->iTable!=pExpr->iTable ) continue; if( pColumn->iColumn!=pExpr->iColumn ) continue; - if( bIgnoreAffBlob && sqlite3ExprAffinity(pColumn)==SQLITE_AFF_BLOB ){ + assert( SQLITE_AFF_NONEpWinDefn = 0; #endif - p->selFlags &= ~SF_Compound; + p->selFlags &= ~(u32)SF_Compound; assert( (p->selFlags & SF_Converted)==0 ); p->selFlags |= SF_Converted; assert( pNew->pPrior!=0 ); @@ -149889,7 +150886,7 @@ static int selectExpander(Walker *pWalker, Select *p){ pEList = p->pEList; if( pParse->pWith && (p->selFlags & SF_View) ){ if( p->pWith==0 ){ - p->pWith = (With*)sqlite3DbMallocZero(db, sizeof(With)); + p->pWith = (With*)sqlite3DbMallocZero(db, SZ_WITH(1) ); if( p->pWith==0 ){ return WRC_Abort; } @@ -151028,6 +152025,7 @@ static void agginfoFree(sqlite3 *db, void *pArg){ ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries ** * The outer query is a simple count(*) with no WHERE clause or other ** extraneous syntax. +** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) ** ** Return TRUE if the optimization is undertaken. */ @@ -151060,7 +152058,11 @@ static int countOfViewOptimization(Parse *pParse, Select *p){ if( pSub->op!=TK_ALL && pSub->pPrior ) return 0; /* Must be UNION ALL */ if( pSub->pWhere ) return 0; /* No WHERE clause */ if( pSub->pLimit ) return 0; /* No LIMIT clause */ - if( pSub->selFlags & SF_Aggregate ) return 0; /* Not an aggregate */ + if( pSub->selFlags & (SF_Aggregate|SF_Distinct) ){ + testcase( pSub->selFlags & SF_Aggregate ); + testcase( pSub->selFlags & SF_Distinct ); + return 0; /* Not an aggregate nor DISTINCT */ + } assert( pSub->pHaving==0 ); /* Due to the previous */ pSub = pSub->pPrior; /* Repeat over compound */ }while( pSub ); @@ -151072,14 +152074,14 @@ static int countOfViewOptimization(Parse *pParse, Select *p){ pExpr = 0; pSub = sqlite3SubqueryDetach(db, pFrom); sqlite3SrcListDelete(db, p->pSrc); - p->pSrc = sqlite3DbMallocZero(pParse->db, sizeof(*p->pSrc)); + p->pSrc = sqlite3DbMallocZero(pParse->db, SZ_SRCLIST_1); while( pSub ){ Expr *pTerm; pPrior = pSub->pPrior; pSub->pPrior = 0; pSub->pNext = 0; pSub->selFlags |= SF_Aggregate; - pSub->selFlags &= ~SF_Compound; + pSub->selFlags &= ~(u32)SF_Compound; pSub->nSelectRow = 0; sqlite3ParserAddCleanup(pParse, sqlite3ExprListDeleteGeneric, pSub->pEList); pTerm = pPrior ? sqlite3ExprDup(db, pCount, 0) : pCount; @@ -151094,7 +152096,7 @@ static int countOfViewOptimization(Parse *pParse, Select *p){ pSub = pPrior; } p->pEList->a[0].pExpr = pExpr; - p->selFlags &= ~SF_Aggregate; + p->selFlags &= ~(u32)SF_Aggregate; #if TREETRACE_ENABLED if( sqlite3TreeTrace & 0x200 ){ @@ -151301,7 +152303,7 @@ SQLITE_PRIVATE int sqlite3Select( testcase( pParse->earlyCleanup ); p->pOrderBy = 0; } - p->selFlags &= ~SF_Distinct; + p->selFlags &= ~(u32)SF_Distinct; p->selFlags |= SF_NoopOrderBy; } sqlite3SelectPrep(pParse, p, 0); @@ -151340,7 +152342,7 @@ SQLITE_PRIVATE int sqlite3Select( ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - p->selFlags &= ~SF_UFSrcCheck; + p->selFlags &= ~(u32)SF_UFSrcCheck; } if( pDest->eDest==SRT_Output ){ @@ -151829,7 +152831,7 @@ SQLITE_PRIVATE int sqlite3Select( && p->pWin==0 #endif ){ - p->selFlags &= ~SF_Distinct; + p->selFlags &= ~(u32)SF_Distinct; pGroupBy = p->pGroupBy = sqlite3ExprListDup(db, pEList, 0); if( pGroupBy ){ for(i=0; inExpr; i++){ @@ -151938,6 +152940,12 @@ SQLITE_PRIVATE int sqlite3Select( if( pWInfo==0 ) goto select_end; if( sqlite3WhereOutputRowCount(pWInfo) < p->nSelectRow ){ p->nSelectRow = sqlite3WhereOutputRowCount(pWInfo); + if( pDest->eDest<=SRT_DistQueue && pDest->eDest>=SRT_DistFifo ){ + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p->nSelectRow -= 30; + } } if( sDistinct.isTnct && sqlite3WhereIsDistinct(pWInfo) ){ sDistinct.eTnctType = sqlite3WhereIsDistinct(pWInfo); @@ -152311,6 +153319,10 @@ SQLITE_PRIVATE int sqlite3Select( if( iOrderByCol ){ Expr *pX = p->pEList->a[iOrderByCol-1].pExpr; Expr *pBase = sqlite3ExprSkipCollateAndLikely(pX); + while( ALWAYS(pBase!=0) && pBase->op==TK_IF_NULL_ROW ){ + pX = pBase->pLeft; + pBase = sqlite3ExprSkipCollateAndLikely(pX); + } if( ALWAYS(pBase!=0) && pBase->op!=TK_AGG_COLUMN && pBase->op!=TK_REGISTER @@ -152894,7 +153906,8 @@ SQLITE_PRIVATE Trigger *sqlite3TriggerList(Parse *pParse, Table *pTab){ assert( pParse->db->pVtabCtx==0 ); #endif assert( pParse->bReturning ); - assert( &(pParse->u1.pReturning->retTrig) == pTrig ); + assert( !pParse->isCreate ); + assert( &(pParse->u1.d.pReturning->retTrig) == pTrig ); pTrig->table = pTab->zName; pTrig->pTabSchema = pTab->pSchema; pTrig->pNext = pList; @@ -153862,7 +154875,8 @@ static void codeReturningTrigger( ExprList *pNew; Returning *pReturning; Select sSelect; - SrcList sFrom; + SrcList *pFrom; + u8 fromSpace[SZ_SRCLIST_1]; assert( v!=0 ); if( !pParse->bReturning ){ @@ -153871,19 +154885,21 @@ static void codeReturningTrigger( return; } assert( db->pParse==pParse ); - pReturning = pParse->u1.pReturning; + assert( !pParse->isCreate ); + pReturning = pParse->u1.d.pReturning; if( pTrigger != &(pReturning->retTrig) ){ /* This RETURNING trigger is for a different statement */ return; } memset(&sSelect, 0, sizeof(sSelect)); - memset(&sFrom, 0, sizeof(sFrom)); + pFrom = (SrcList*)fromSpace; + memset(pFrom, 0, SZ_SRCLIST_1); sSelect.pEList = sqlite3ExprListDup(db, pReturning->pReturnEL, 0); - sSelect.pSrc = &sFrom; - sFrom.nSrc = 1; - sFrom.a[0].pSTab = pTab; - sFrom.a[0].zName = pTab->zName; /* tag-20240424-1 */ - sFrom.a[0].iCursor = -1; + sSelect.pSrc = pFrom; + pFrom->nSrc = 1; + pFrom->a[0].pSTab = pTab; + pFrom->a[0].zName = pTab->zName; /* tag-20240424-1 */ + pFrom->a[0].iCursor = -1; sqlite3SelectPrep(pParse, &sSelect, 0); if( pParse->nErr==0 ){ assert( db->mallocFailed==0 ); @@ -154101,6 +155117,8 @@ static TriggerPrg *codeRowTrigger( sSubParse.eTriggerOp = pTrigger->op; sSubParse.nQueryLoop = pParse->nQueryLoop; sSubParse.prepFlags = pParse->prepFlags; + sSubParse.oldmask = 0; + sSubParse.newmask = 0; v = sqlite3GetVdbe(&sSubParse); if( v ){ @@ -154855,38 +155873,32 @@ SQLITE_PRIVATE void sqlite3Update( */ chngRowid = chngPk = 0; for(i=0; inExpr; i++){ - u8 hCol = sqlite3StrIHash(pChanges->a[i].zEName); /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if( nChangeFrom==0 && sqlite3ResolveExprNames(&sNC, pChanges->a[i].pExpr) ){ goto update_cleanup; } - for(j=0; jnCol; j++){ - if( pTab->aCol[j].hName==hCol - && sqlite3StrICmp(pTab->aCol[j].zCnName, pChanges->a[i].zEName)==0 - ){ - if( j==pTab->iPKey ){ - chngRowid = 1; - pRowidExpr = pChanges->a[i].pExpr; - iRowidExpr = i; - }else if( pPk && (pTab->aCol[j].colFlags & COLFLAG_PRIMKEY)!=0 ){ - chngPk = 1; - } -#ifndef SQLITE_OMIT_GENERATED_COLUMNS - else if( pTab->aCol[j].colFlags & COLFLAG_GENERATED ){ - testcase( pTab->aCol[j].colFlags & COLFLAG_VIRTUAL ); - testcase( pTab->aCol[j].colFlags & COLFLAG_STORED ); - sqlite3ErrorMsg(pParse, - "cannot UPDATE generated column \"%s\"", - pTab->aCol[j].zCnName); - goto update_cleanup; - } -#endif - aXRef[j] = i; - break; + j = sqlite3ColumnIndex(pTab, pChanges->a[i].zEName); + if( j>=0 ){ + if( j==pTab->iPKey ){ + chngRowid = 1; + pRowidExpr = pChanges->a[i].pExpr; + iRowidExpr = i; + }else if( pPk && (pTab->aCol[j].colFlags & COLFLAG_PRIMKEY)!=0 ){ + chngPk = 1; } - } - if( j>=pTab->nCol ){ +#ifndef SQLITE_OMIT_GENERATED_COLUMNS + else if( pTab->aCol[j].colFlags & COLFLAG_GENERATED ){ + testcase( pTab->aCol[j].colFlags & COLFLAG_VIRTUAL ); + testcase( pTab->aCol[j].colFlags & COLFLAG_STORED ); + sqlite3ErrorMsg(pParse, + "cannot UPDATE generated column \"%s\"", + pTab->aCol[j].zCnName); + goto update_cleanup; + } +#endif + aXRef[j] = i; + }else{ if( pPk==0 && sqlite3IsRowid(pChanges->a[i].zEName) ){ j = -1; chngRowid = 1; @@ -156209,7 +157221,7 @@ SQLITE_PRIVATE void sqlite3Vacuum(Parse *pParse, Token *pNm, Expr *pInto){ #else /* When SQLITE_BUG_COMPATIBLE_20160819 is defined, unrecognized arguments ** to VACUUM are silently ignored. This is a back-out of a bug fix that - ** occurred on 2016-08-19 (https://www.sqlite.org/src/info/083f9e6270). + ** occurred on 2016-08-19 (https://sqlite.org/src/info/083f9e6270). ** The buggy behavior is required for binary compatibility with some ** legacy applications. */ iDb = sqlite3FindDb(pParse->db, pNm); @@ -156288,7 +157300,7 @@ SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3RunVacuum( saved_nChange = db->nChange; saved_nTotalChange = db->nTotalChange; saved_mTrace = db->mTrace; - db->flags |= SQLITE_WriteSchema | SQLITE_IgnoreChecks; + db->flags |= SQLITE_WriteSchema | SQLITE_IgnoreChecks | SQLITE_Comments; db->mDbFlags |= DBFLAG_PreferBuiltin | DBFLAG_Vacuum; db->flags &= ~(u64)(SQLITE_ForeignKeys | SQLITE_ReverseOrder | SQLITE_Defensive | SQLITE_CountRows); @@ -156993,11 +158005,12 @@ SQLITE_PRIVATE void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){ ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = sqlite3SchemaToIndex(db, pTab->pSchema); + assert( pParse->isCreate ); sqlite3NestedParse(pParse, "UPDATE %Q." LEGACY_SCHEMA_TABLE " " "SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q " @@ -157006,7 +158019,7 @@ SQLITE_PRIVATE void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){ pTab->zName, pTab->zName, zStmt, - pParse->regRowid + pParse->u1.cr.regRowid ); v = sqlite3GetVdbe(pParse); sqlite3ChangeCookie(pParse, iDb); @@ -158416,9 +159429,14 @@ struct WhereInfo { Bitmask revMask; /* Mask of ORDER BY terms that need reversing */ WhereClause sWC; /* Decomposition of the WHERE clause */ WhereMaskSet sMaskSet; /* Map cursor numbers to bitmasks */ - WhereLevel a[1]; /* Information about each nest loop in WHERE */ + WhereLevel a[FLEXARRAY]; /* Information about each nest loop in WHERE */ }; +/* +** The size (in bytes) of a WhereInfo object that holds N WhereLevels. +*/ +#define SZ_WHEREINFO(N) ROUND8(offsetof(WhereInfo,a)+(N)*sizeof(WhereLevel)) + /* ** Private interfaces - callable only by other where.c routines. ** @@ -159098,7 +160116,7 @@ static void adjustOrderByCol(ExprList *pOrderBy, ExprList *pEList){ /* ** pX is an expression of the form: (vector) IN (SELECT ...) ** In other words, it is a vector IN operator with a SELECT clause on the -** LHS. But not all terms in the vector are indexable and the terms might +** RHS. But not all terms in the vector are indexable and the terms might ** not be in the correct order for indexing. ** ** This routine makes a copy of the input pX expression and then adjusts @@ -159154,7 +160172,9 @@ static Expr *removeUnindexableInClauseTerms( int iField; assert( (pLoop->aLTerm[i]->eOperator & (WO_OR|WO_AND))==0 ); iField = pLoop->aLTerm[i]->u.x.iField - 1; - if( pOrigRhs->a[iField].pExpr==0 ) continue; /* Duplicate PK column */ + if( NEVER(pOrigRhs->a[iField].pExpr==0) ){ + continue; /* Duplicate PK column */ + } pRhs = sqlite3ExprListAppend(pParse, pRhs, pOrigRhs->a[iField].pExpr); pOrigRhs->a[iField].pExpr = 0; if( pRhs ) pRhs->a[pRhs->nExpr-1].u.x.iOrderByCol = iField+1; @@ -159251,7 +160271,7 @@ static SQLITE_NOINLINE void codeINTerm( return; } } - for(i=iEq;inLTerm; i++){ + for(i=iEq; inLTerm; i++){ assert( pLoop->aLTerm[i]!=0 ); if( pLoop->aLTerm[i]->pExpr==pX ) nEq++; } @@ -159260,22 +160280,13 @@ static SQLITE_NOINLINE void codeINTerm( if( !ExprUseXSelect(pX) || pX->x.pSelect->pEList->nExpr==1 ){ eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0, &iTab); }else{ - Expr *pExpr = pTerm->pExpr; - if( pExpr->iTable==0 || !ExprHasProperty(pExpr, EP_Subrtn) ){ - sqlite3 *db = pParse->db; - pX = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX); - if( !db->mallocFailed ){ - aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq); - eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap,&iTab); - pExpr->iTable = iTab; - } - sqlite3ExprDelete(db, pX); - }else{ - int n = sqlite3ExprVectorSize(pX->pLeft); - aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*MAX(nEq,n)); - eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab); + sqlite3 *db = pParse->db; + Expr *pXMod = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX); + if( !db->mallocFailed ){ + aiMap = (int*)sqlite3DbMallocZero(db, sizeof(int)*nEq); + eType = sqlite3FindInIndex(pParse, pXMod, IN_INDEX_LOOP, 0, aiMap, &iTab); } - pX = pExpr; + sqlite3ExprDelete(db, pXMod); } if( eType==IN_INDEX_INDEX_DESC ){ @@ -159305,7 +160316,7 @@ static SQLITE_NOINLINE void codeINTerm( if( pIn ){ int iMap = 0; /* Index in aiMap[] */ pIn += i; - for(i=iEq;inLTerm; i++){ + for(i=iEq; inLTerm; i++){ if( pLoop->aLTerm[i]->pExpr==pX ){ int iOut = iTarget + i - iEq; if( eType==IN_INDEX_ROWID ){ @@ -160164,6 +161175,9 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( } sqlite3VdbeAddOp2(v, OP_Integer, pLoop->u.vtab.idxNum, iReg); sqlite3VdbeAddOp2(v, OP_Integer, nConstraint, iReg+1); + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ sqlite3VdbeAddOp4(v, OP_VFilter, iCur, addrNotFound, iReg, pLoop->u.vtab.idxStr, pLoop->u.vtab.needFree ? P4_DYNAMIC : P4_STATIC); @@ -160754,12 +161768,13 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( if( pLevel->iLeftJoin==0 ){ /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if( pIdx->pPartIdxWhere ){ + if( pIdx->pPartIdxWhere && pLevel->pRJ==0 ){ whereApplyPartialIndexConstraints(pIdx->pPartIdxWhere, iCur, pWC); } }else{ @@ -160866,8 +161881,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( int nNotReady; /* The number of notReady tables */ SrcItem *origSrc; /* Original list of tables */ nNotReady = pWInfo->nLevel - iLevel - 1; - pOrTab = sqlite3DbMallocRawNN(db, - sizeof(*pOrTab)+ nNotReady*sizeof(pOrTab->a[0])); + pOrTab = sqlite3DbMallocRawNN(db, SZ_SRCLIST(nNotReady+1)); if( pOrTab==0 ) return notReady; pOrTab->nAlloc = (u8)(nNotReady + 1); pOrTab->nSrc = pOrTab->nAlloc; @@ -160918,7 +161932,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart( ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -161410,7 +162424,8 @@ SQLITE_PRIVATE SQLITE_NOINLINE void sqlite3WhereRightJoinLoop( WhereInfo *pSubWInfo; WhereLoop *pLoop = pLevel->pWLoop; SrcItem *pTabItem = &pWInfo->pTabList->a[pLevel->iFrom]; - SrcList sFrom; + SrcList *pFrom; + u8 fromSpace[SZ_SRCLIST_1]; Bitmask mAll = 0; int k; @@ -161454,13 +162469,14 @@ SQLITE_PRIVATE SQLITE_NOINLINE void sqlite3WhereRightJoinLoop( sqlite3ExprDup(pParse->db, pTerm->pExpr, 0)); } } - sFrom.nSrc = 1; - sFrom.nAlloc = 1; - memcpy(&sFrom.a[0], pTabItem, sizeof(SrcItem)); - sFrom.a[0].fg.jointype = 0; + pFrom = (SrcList*)fromSpace; + pFrom->nSrc = 1; + pFrom->nAlloc = 1; + memcpy(&pFrom->a[0], pTabItem, sizeof(SrcItem)); + pFrom->a[0].fg.jointype = 0; assert( pParse->withinRJSubrtn < 100 ); pParse->withinRJSubrtn++; - pSubWInfo = sqlite3WhereBegin(pParse, &sFrom, pSubWhere, 0, 0, 0, + pSubWInfo = sqlite3WhereBegin(pParse, pFrom, pSubWhere, 0, 0, 0, WHERE_RIGHT_JOIN, 0); if( pSubWInfo ){ int iCur = pLevel->iTabCur; @@ -162431,30 +163447,42 @@ static void exprAnalyzeOrTerm( ** 1. The SQLITE_Transitive optimization must be enabled ** 2. Must be either an == or an IS operator ** 3. Not originating in the ON clause of an OUTER JOIN -** 4. The affinities of A and B must be compatible -** 5a. Both operands use the same collating sequence OR -** 5b. The overall collating sequence is BINARY +** 4. The operator is not IS or else the query does not contain RIGHT JOIN +** 5. The affinities of A and B must be compatible +** 6a. Both operands use the same collating sequence OR +** 6b. The overall collating sequence is BINARY ** If this routine returns TRUE, that means that the RHS can be substituted ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. ** This is an optimization. No harm comes from returning 0. But if 1 is ** returned when it should not be, then incorrect answers might result. */ -static int termIsEquivalence(Parse *pParse, Expr *pExpr){ +static int termIsEquivalence(Parse *pParse, Expr *pExpr, SrcList *pSrc){ char aff1, aff2; CollSeq *pColl; - if( !OptimizationEnabled(pParse->db, SQLITE_Transitive) ) return 0; - if( pExpr->op!=TK_EQ && pExpr->op!=TK_IS ) return 0; - if( ExprHasProperty(pExpr, EP_OuterON) ) return 0; + if( !OptimizationEnabled(pParse->db, SQLITE_Transitive) ) return 0; /* (1) */ + if( pExpr->op!=TK_EQ && pExpr->op!=TK_IS ) return 0; /* (2) */ + if( ExprHasProperty(pExpr, EP_OuterON) ) return 0; /* (3) */ + assert( pSrc!=0 ); + if( pExpr->op==TK_IS + && pSrc->nSrc + && (pSrc->a[0].fg.jointype & JT_LTORJ)!=0 + ){ + return 0; /* (4) */ + } aff1 = sqlite3ExprAffinity(pExpr->pLeft); aff2 = sqlite3ExprAffinity(pExpr->pRight); if( aff1!=aff2 && (!sqlite3IsNumericAffinity(aff1) || !sqlite3IsNumericAffinity(aff2)) ){ - return 0; + return 0; /* (5) */ } pColl = sqlite3ExprCompareCollSeq(pParse, pExpr); - if( sqlite3IsBinary(pColl) ) return 1; - return sqlite3ExprCollSeqMatch(pParse, pExpr->pLeft, pExpr->pRight); + if( !sqlite3IsBinary(pColl) + && !sqlite3ExprCollSeqMatch(pParse, pExpr->pLeft, pExpr->pRight) + ){ + return 0; /* (6) */ + } + return 1; } /* @@ -162719,8 +163747,8 @@ static void exprAnalyze( if( op==TK_IS ) pNew->wtFlags |= TERM_IS; pTerm = &pWC->a[idxTerm]; pTerm->wtFlags |= TERM_COPIED; - - if( termIsEquivalence(pParse, pDup) ){ + assert( pWInfo->pTabList!=0 ); + if( termIsEquivalence(pParse, pDup, pWInfo->pTabList) ){ pTerm->eOperator |= WO_EQUIV; eExtraOp = WO_EQUIV; } @@ -163448,11 +164476,16 @@ struct HiddenIndexInfo { int eDistinct; /* Value to return from sqlite3_vtab_distinct() */ u32 mIn; /* Mask of terms that are IN (...) */ u32 mHandleIn; /* Terms that vtab will handle as IN (...) */ - sqlite3_value *aRhs[1]; /* RHS values for constraints. MUST BE LAST - ** because extra space is allocated to hold up - ** to nTerm such values */ + sqlite3_value *aRhs[FLEXARRAY]; /* RHS values for constraints. MUST BE LAST + ** Extra space is allocated to hold up + ** to nTerm such values */ }; +/* Size (in bytes) of a HiddenIndeInfo object sufficient to hold as +** many as N constraints */ +#define SZ_HIDDENINDEXINFO(N) \ + (offsetof(HiddenIndexInfo,aRhs) + (N)*sizeof(sqlite3_value*)) + /* Forward declaration of methods */ static int whereLoopResize(sqlite3*, WhereLoop*, int); @@ -164517,6 +165550,8 @@ static SQLITE_NOINLINE void constructAutomaticIndex( } /* Construct the Index object to describe this index */ + assert( nKeyCol <= pTable->nCol + MAX(0, pTable->nCol - BMS + 1) ); + /* ^-- This guarantees that the number of index columns will fit in the u16 */ pIdx = sqlite3AllocateIndexObject(pParse->db, nKeyCol+HasRowid(pTable), 0, &zNotUsed); if( pIdx==0 ) goto end_auto_index_create; @@ -164928,8 +165963,8 @@ static sqlite3_index_info *allocateIndexInfo( */ pIdxInfo = sqlite3DbMallocZero(pParse->db, sizeof(*pIdxInfo) + (sizeof(*pIdxCons) + sizeof(*pUsage))*nTerm - + sizeof(*pIdxOrderBy)*nOrderBy + sizeof(*pHidden) - + sizeof(sqlite3_value*)*nTerm ); + + sizeof(*pIdxOrderBy)*nOrderBy + + SZ_HIDDENINDEXINFO(nTerm) ); if( pIdxInfo==0 ){ sqlite3ErrorMsg(pParse, "out of memory"); return 0; @@ -166565,11 +167600,8 @@ static int whereLoopAddBtreeIndex( assert( pNew->u.btree.nBtm==0 ); opMask = WO_EQ|WO_IN|WO_GT|WO_GE|WO_LT|WO_LE|WO_ISNULL|WO_IS; } - if( pProbe->bUnordered || pProbe->bLowQual ){ - if( pProbe->bUnordered ) opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE); - if( pProbe->bLowQual && pSrc->fg.isIndexedBy==0 ){ - opMask &= ~(WO_EQ|WO_IN|WO_IS); - } + if( pProbe->bUnordered ){ + opMask &= ~(WO_GT|WO_GE|WO_LT|WO_LE); } assert( pNew->u.btree.nEqnColumn ); @@ -166642,6 +167674,7 @@ static int whereLoopAddBtreeIndex( if( ExprUseXSelect(pExpr) ){ /* "x IN (SELECT ...)": TUNING: the SELECT returns 25 rows */ int i; + int bRedundant = 0; nIn = 46; assert( 46==sqlite3LogEst(25) ); /* The expression may actually be of the form (x, y) IN (SELECT...). @@ -166650,7 +167683,20 @@ static int whereLoopAddBtreeIndex( ** for each such term. The following loop checks that pTerm is the ** first such term in use, and sets nIn back to 0 if it is not. */ for(i=0; inLTerm-1; i++){ - if( pNew->aLTerm[i] && pNew->aLTerm[i]->pExpr==pExpr ) nIn = 0; + if( pNew->aLTerm[i] && pNew->aLTerm[i]->pExpr==pExpr ){ + nIn = 0; + if( pNew->aLTerm[i]->u.x.iField == pTerm->u.x.iField ){ + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = 1; + } + } + } + if( bRedundant ){ + pNew->nLTerm--; + continue; } }else if( ALWAYS(pExpr->x.pList && pExpr->x.pList->nExpr) ){ /* "x IN (value, value, ...)" */ @@ -166882,7 +167928,7 @@ static int whereLoopAddBtreeIndex( if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 && pNew->u.btree.nEqnColumn && (pNew->u.btree.nEqnKeyCol || - pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY) + pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY) ){ if( pNew->u.btree.nEq>3 ){ sqlite3ProgressCheck(pParse); @@ -167011,6 +168057,7 @@ static int whereUsablePartialIndex( if( (!ExprHasProperty(pExpr, EP_OuterON) || pExpr->w.iJoin==iTab) && ((jointype & JT_OUTER)==0 || ExprHasProperty(pExpr, EP_OuterON)) && sqlite3ExprImpliesExpr(pParse, pExpr, pWhere, iTab) + && !sqlite3ExprImpliesExpr(pParse, pExpr, pWhere, -1) && (pTerm->wtFlags & TERM_VNULL)==0 ){ return 1; @@ -167506,7 +168553,7 @@ static int whereLoopAddBtree( && (HasRowid(pTab) || pWInfo->pSelect!=0 || sqlite3FaultSim(700)) ){ WHERETRACE(0x200, - ("-> %s a covering index according to bitmasks\n", + ("-> %s is a covering index according to bitmasks\n", pProbe->zName, m==0 ? "is" : "is not")); pNew->wsFlags = WHERE_IDX_ONLY | WHERE_INDEXED; } @@ -170123,10 +171170,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = ROUND8P(sizeof(WhereInfo)); - if( nTabList>1 ){ - nByteWInfo = ROUND8P(nByteWInfo + (nTabList-1)*sizeof(WhereLevel)); - } + nByteWInfo = SZ_WHEREINFO(nTabList); pWInfo = sqlite3DbMallocRawNN(db, nByteWInfo + sizeof(WhereLoop)); if( db->mallocFailed ){ sqlite3DbFree(db, pWInfo); @@ -170343,7 +171387,8 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if( (pWInfo->wctrlFlags & WHERE_WANT_DISTINCT)!=0 ){ WHERETRACE(0x0080,("nRowOut reduced from %d to %d due to DISTINCT\n", @@ -172078,7 +173123,7 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, Select *p){ p->pWhere = 0; p->pGroupBy = 0; p->pHaving = 0; - p->selFlags &= ~SF_Aggregate; + p->selFlags &= ~(u32)SF_Aggregate; p->selFlags |= SF_WinRewrite; /* Create the ORDER BY clause for the sub-select. This is the concatenation @@ -174218,6 +175263,11 @@ SQLITE_PRIVATE void sqlite3WindowCodeStep( /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set +*/ +#define ASSERT_IS_CREATE assert(pParse->isCreate) + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -174281,6 +175331,10 @@ static void parserSyntaxError(Parse *pParse, Token *p){ static void disableLookaside(Parse *pParse){ sqlite3 *db = pParse->db; pParse->disableLookaside++; +#ifdef SQLITE_DEBUG + pParse->isCreate = 1; +#endif + memset(&pParse->u1.cr, 0, sizeof(pParse->u1.cr)); DisableLookaside; } @@ -177917,7 +178971,9 @@ static YYACTIONTYPE yy_reduce( } break; case 14: /* createkw ::= CREATE */ -{disableLookaside(pParse);} +{ + disableLookaside(pParse); +} break; case 15: /* ifnotexists ::= */ case 18: /* temp ::= */ yytestcase(yyruleno==18); @@ -178009,7 +179065,7 @@ static YYACTIONTYPE yy_reduce( break; case 32: /* ccons ::= CONSTRAINT nm */ case 67: /* tcons ::= CONSTRAINT nm */ yytestcase(yyruleno==67); -{pParse->constraintName = yymsp[0].minor.yy0;} +{ASSERT_IS_CREATE; pParse->u1.cr.constraintName = yymsp[0].minor.yy0;} break; case 33: /* ccons ::= DEFAULT scantok term */ {sqlite3AddDefaultValue(pParse,yymsp[0].minor.yy590,yymsp[-1].minor.yy0.z,&yymsp[-1].minor.yy0.z[yymsp[-1].minor.yy0.n]);} @@ -178119,7 +179175,7 @@ static YYACTIONTYPE yy_reduce( {yymsp[-1].minor.yy502 = 0;} break; case 66: /* tconscomma ::= COMMA */ -{pParse->constraintName.n = 0;} +{ASSERT_IS_CREATE; pParse->u1.cr.constraintName.n = 0;} break; case 68: /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ {sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy402,yymsp[0].minor.yy502,yymsp[-2].minor.yy502,0);} @@ -178206,8 +179262,8 @@ static YYACTIONTYPE yy_reduce( if( pRhs ){ pRhs->op = (u8)yymsp[-1].minor.yy502; pRhs->pPrior = pLhs; - if( ALWAYS(pLhs) ) pLhs->selFlags &= ~SF_MultiValue; - pRhs->selFlags &= ~SF_MultiValue; + if( ALWAYS(pLhs) ) pLhs->selFlags &= ~(u32)SF_MultiValue; + pRhs->selFlags &= ~(u32)SF_MultiValue; if( yymsp[-1].minor.yy502!=TK_ALL ) pParse->hasCompound = 1; }else{ sqlite3SelectDelete(pParse->db, pLhs); @@ -178847,12 +179903,21 @@ static YYACTIONTYPE yy_reduce( ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy590); - yymsp[-4].minor.yy590 = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy502 ? "true" : "false"); - if( yymsp[-4].minor.yy590 ) sqlite3ExprIdToTrueFalse(yymsp[-4].minor.yy590); + Expr *pB = sqlite3Expr(pParse->db, TK_STRING, yymsp[-3].minor.yy502 ? "true" : "false"); + if( pB ) sqlite3ExprIdToTrueFalse(pB); + if( !ExprHasProperty(yymsp[-4].minor.yy590, EP_HasFunc) ){ + sqlite3ExprUnmapAndDelete(pParse, yymsp[-4].minor.yy590); + yymsp[-4].minor.yy590 = pB; + }else{ + yymsp[-4].minor.yy590 = sqlite3PExpr(pParse, yymsp[-3].minor.yy502 ? TK_OR : TK_AND, pB, yymsp[-4].minor.yy590); + } }else{ Expr *pRHS = yymsp[-1].minor.yy402->a[0].pExpr; if( yymsp[-1].minor.yy402->nExpr==1 && sqlite3ExprIsConstant(pParse,pRHS) && yymsp[-4].minor.yy590->op!=TK_VECTOR ){ @@ -179012,6 +180077,10 @@ static YYACTIONTYPE yy_reduce( { sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy502, yymsp[-4].minor.yy28.a, yymsp[-4].minor.yy28.b, yymsp[-2].minor.yy563, yymsp[0].minor.yy590, yymsp[-10].minor.yy502, yymsp[-8].minor.yy502); yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/ +#ifdef SQLITE_DEBUG + assert( pParse->isCreate ); /* Set by createkw reduce action */ + pParse->isCreate = 0; /* But, should not be set for CREATE TRIGGER */ +#endif } break; case 262: /* trigger_time ::= BEFORE|AFTER */ @@ -180454,7 +181523,7 @@ static int getToken(const unsigned char **pz){ int t; /* Token type to return */ do { z += sqlite3GetToken(z, &t); - }while( t==TK_SPACE ); + }while( t==TK_SPACE || t==TK_COMMENT ); if( t==TK_ID || t==TK_STRING || t==TK_JOIN_KW @@ -180947,7 +182016,11 @@ SQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql){ assert( n==6 ); tokenType = analyzeFilterKeyword((const u8*)&zSql[6], lastTokenParsed); #endif /* SQLITE_OMIT_WINDOWFUNC */ - }else if( tokenType==TK_COMMENT && (db->flags & SQLITE_Comments)!=0 ){ + }else if( tokenType==TK_COMMENT + && (db->init.busy || (db->flags & SQLITE_Comments)!=0) + ){ + /* Ignore SQL comments if either (1) we are reparsing the schema or + ** (2) SQLITE_DBCONFIG_ENABLE_COMMENTS is turned on (the default). */ zSql += n; continue; }else if( tokenType!=TK_QNUMBER ){ @@ -181842,6 +182915,14 @@ SQLITE_API int sqlite3_initialize(void){ if( rc==SQLITE_OK ){ sqlite3PCacheBufferSetup( sqlite3GlobalConfig.pPage, sqlite3GlobalConfig.szPage, sqlite3GlobalConfig.nPage); +#ifdef SQLITE_EXTRA_INIT_MUTEXED + { + int SQLITE_EXTRA_INIT_MUTEXED(const char*); + rc = SQLITE_EXTRA_INIT_MUTEXED(0); + } +#endif + } + if( rc==SQLITE_OK ){ sqlite3MemoryBarrier(); sqlite3GlobalConfig.isInit = 1; #ifdef SQLITE_EXTRA_INIT @@ -182298,17 +183379,22 @@ SQLITE_API int sqlite3_config(int op, ...){ ** If lookaside is already active, return SQLITE_BUSY. ** ** The sz parameter is the number of bytes in each lookaside slot. -** The cnt parameter is the number of slots. If pStart is NULL the -** space for the lookaside memory is obtained from sqlite3_malloc(). -** If pStart is not NULL then it is sz*cnt bytes of memory to use for -** the lookaside memory. +** The cnt parameter is the number of slots. If pBuf is NULL the +** space for the lookaside memory is obtained from sqlite3_malloc() +** or similar. If pBuf is not NULL then it is sz*cnt bytes of memory +** to use for the lookaside memory. */ -static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){ +static int setupLookaside( + sqlite3 *db, /* Database connection being configured */ + void *pBuf, /* Memory to use for lookaside. May be NULL */ + int sz, /* Desired size of each lookaside memory slot */ + int cnt /* Number of slots to allocate */ +){ #ifndef SQLITE_OMIT_LOOKASIDE - void *pStart; - sqlite3_int64 szAlloc; - int nBig; /* Number of full-size slots */ - int nSm; /* Number smaller LOOKASIDE_SMALL-byte slots */ + void *pStart; /* Start of the lookaside buffer */ + sqlite3_int64 szAlloc; /* Total space set aside for lookaside memory */ + int nBig; /* Number of full-size slots */ + int nSm; /* Number smaller LOOKASIDE_SMALL-byte slots */ if( sqlite3LookasideUsed(db,0)>0 ){ return SQLITE_BUSY; @@ -182321,19 +183407,22 @@ static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){ sqlite3_free(db->lookaside.pStart); } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = ROUNDDOWN8(sz); /* IMP: R-33038-09382 */ + sz = ROUNDDOWN8(sz); if( sz<=(int)sizeof(LookasideSlot*) ) sz = 0; if( sz>65528 ) sz = 65528; - if( cnt<0 ) cnt = 0; + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if( cnt<1 ) cnt = 0; + if( sz>0 && cnt>(0x7fff0000/sz) ) cnt = 0x7fff0000/sz; szAlloc = (i64)sz*(i64)cnt; - if( sz==0 || cnt==0 ){ + if( szAlloc==0 ){ sz = 0; pStart = 0; }else if( pBuf==0 ){ sqlite3BeginBenignMalloc(); - pStart = sqlite3Malloc( szAlloc ); /* IMP: R-61949-35727 */ + pStart = sqlite3Malloc( szAlloc ); sqlite3EndBenignMalloc(); if( pStart ) szAlloc = sqlite3MallocSize(pStart); }else{ @@ -183310,6 +184399,9 @@ SQLITE_API int sqlite3_busy_handler( db->busyHandler.pBusyArg = pArg; db->busyHandler.nBusy = 0; db->busyTimeout = 0; +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + db->setlkTimeout = 0; +#endif sqlite3_mutex_leave(db->mutex); return SQLITE_OK; } @@ -183359,12 +184451,49 @@ SQLITE_API int sqlite3_busy_timeout(sqlite3 *db, int ms){ sqlite3_busy_handler(db, (int(*)(void*,int))sqliteDefaultBusyCallback, (void*)db); db->busyTimeout = ms; +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + db->setlkTimeout = ms; +#endif }else{ sqlite3_busy_handler(db, 0, 0); } return SQLITE_OK; } +/* +** Set the setlk timeout value. +*/ +SQLITE_API int sqlite3_setlk_timeout(sqlite3 *db, int ms, int flags){ +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + int iDb; + int bBOC = ((flags & SQLITE_SETLK_BLOCK_ON_CONNECT) ? 1 : 0); +#endif +#ifdef SQLITE_ENABLE_API_ARMOR + if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; +#endif + if( ms<-1 ) return SQLITE_RANGE; +#ifdef SQLITE_ENABLE_SETLK_TIMEOUT + sqlite3_mutex_enter(db->mutex); + db->setlkTimeout = ms; + db->setlkFlags = flags; + sqlite3BtreeEnterAll(db); + for(iDb=0; iDbnDb; iDb++){ + Btree *pBt = db->aDb[iDb].pBt; + if( pBt ){ + sqlite3_file *fd = sqlite3PagerFile(sqlite3BtreePager(pBt)); + sqlite3OsFileControlHint(fd, SQLITE_FCNTL_BLOCK_ON_CONNECT, (void*)&bBOC); + } + } + sqlite3BtreeLeaveAll(db); + sqlite3_mutex_leave(db->mutex); +#endif +#if !defined(SQLITE_ENABLE_API_ARMOR) && !defined(SQLITE_ENABLE_SETLK_TIMEOUT) + UNUSED_PARAMETER(db); + UNUSED_PARAMETER(flags); +#endif + return SQLITE_OK; +} + /* ** Cause any pending operation to stop at its earliest opportunity. */ @@ -185330,7 +186459,7 @@ SQLITE_API int sqlite3_set_clientdata( return SQLITE_OK; }else{ size_t n = strlen(zName); - p = sqlite3_malloc64( sizeof(DbClientData)+n+1 ); + p = sqlite3_malloc64( SZ_DBCLIENTDATA(n+1) ); if( p==0 ){ if( xDestructor ) xDestructor(pData); sqlite3_mutex_leave(db->mutex); @@ -185484,13 +186613,10 @@ SQLITE_API int sqlite3_table_column_metadata( if( zColumnName==0 ){ /* Query for existence of table only */ }else{ - for(iCol=0; iColnCol; iCol++){ + iCol = sqlite3ColumnIndex(pTab, zColumnName); + if( iCol>=0 ){ pCol = &pTab->aCol[iCol]; - if( 0==sqlite3StrICmp(pCol->zCnName, zColumnName) ){ - break; - } - } - if( iCol==pTab->nCol ){ + }else{ if( HasRowid(pTab) && sqlite3IsRowid(zColumnName) ){ iCol = pTab->iPKey; pCol = iCol>=0 ? &pTab->aCol[iCol] : 0; @@ -185699,8 +186825,8 @@ SQLITE_API int sqlite3_test_control(int op, ...){ /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -187047,7 +188173,7 @@ SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db){ ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -187266,6 +188392,13 @@ SQLITE_PRIVATE void sqlite3ConnectionClosed(sqlite3 *db){ #ifndef _FTSINT_H #define _FTSINT_H +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + #if !defined(NDEBUG) && !defined(SQLITE_DEBUG) # define NDEBUG 1 #endif @@ -187735,6 +188868,19 @@ typedef sqlite3_int64 i64; /* 8-byte signed integer */ #define deliberate_fall_through +/* +** Macros needed to provide flexible arrays in a portable way +*/ +#ifndef offsetof +# define offsetof(STRUCTURE,FIELD) ((size_t)((char*)&((STRUCTURE*)0)->FIELD)) +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define FLEXARRAY +#else +# define FLEXARRAY 1 +#endif + + #endif /* SQLITE_AMALGAMATION */ #ifdef SQLITE_DEBUG @@ -187839,7 +188985,7 @@ struct Fts3Table { #endif #if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) - /* True to disable the incremental doclist optimization. This is controled + /* True to disable the incremental doclist optimization. This is controlled ** by special insert command 'test-no-incr-doclist'. */ int bNoIncrDoclist; @@ -187891,7 +189037,7 @@ struct Fts3Cursor { /* ** The Fts3Cursor.eSearch member is always set to one of the following. -** Actualy, Fts3Cursor.eSearch can be greater than or equal to +** Actually, Fts3Cursor.eSearch can be greater than or equal to ** FTS3_FULLTEXT_SEARCH. If so, then Fts3Cursor.eSearch - 2 is the index ** of the column to be searched. For example, in ** @@ -187964,9 +189110,13 @@ struct Fts3Phrase { */ int nToken; /* Number of tokens in the phrase */ int iColumn; /* Index of column this phrase must match */ - Fts3PhraseToken aToken[1]; /* One entry for each token in the phrase */ + Fts3PhraseToken aToken[FLEXARRAY]; /* One for each token in the phrase */ }; +/* Size (in bytes) of an Fts3Phrase object large enough to hold N tokens */ +#define SZ_FTS3PHRASE(N) \ + (offsetof(Fts3Phrase,aToken)+(N)*sizeof(Fts3PhraseToken)) + /* ** A tree of these objects forms the RHS of a MATCH operator. ** @@ -188200,12 +189350,6 @@ SQLITE_PRIVATE int sqlite3Fts3IntegrityCheck(Fts3Table *p, int *pbOk); # define SQLITE_CORE 1 #endif -/* #include */ -/* #include */ -/* #include */ -/* #include */ -/* #include */ -/* #include */ /* #include "fts3.h" */ #ifndef SQLITE_CORE @@ -190544,7 +191688,7 @@ static int fts3DoclistOrMerge( ** sizes of the two inputs, plus enough space for exactly one of the input ** docids to grow. ** - ** A symetric argument may be made if the doclists are in descending + ** A symmetric argument may be made if the doclists are in descending ** order. */ aOut = sqlite3_malloc64((i64)n1+n2+FTS3_VARINT_MAX-1+FTS3_BUFFER_PADDING); @@ -192343,7 +193487,7 @@ static int fts3EvalDeferredPhrase(Fts3Cursor *pCsr, Fts3Phrase *pPhrase){ nDistance = iPrev - nMaxUndeferred; } - aOut = (char *)sqlite3Fts3MallocZero(nPoslist+FTS3_BUFFER_PADDING); + aOut = (char *)sqlite3Fts3MallocZero(((i64)nPoslist)+FTS3_BUFFER_PADDING); if( !aOut ){ sqlite3_free(aPoslist); return SQLITE_NOMEM; @@ -192642,7 +193786,7 @@ static int incrPhraseTokenNext( ** ** * does not contain any deferred tokens. ** -** Advance it to the next matching documnent in the database and populate +** Advance it to the next matching document in the database and populate ** the Fts3Doclist.pList and nList fields. ** ** If there is no "next" entry and no error occurs, then *pbEof is set to @@ -193649,7 +194793,7 @@ static int fts3EvalNext(Fts3Cursor *pCsr){ } /* -** Restart interation for expression pExpr so that the next call to +** Restart iteration for expression pExpr so that the next call to ** fts3EvalNext() visits the first row. Do not allow incremental ** loading or merging of phrase doclists for this iteration. ** @@ -194841,6 +195985,23 @@ SQLITE_PRIVATE int sqlite3Fts3OpenTokenizer( */ static int fts3ExprParse(ParseContext *, const char *, int, Fts3Expr **, int *); +/* +** Search buffer z[], size n, for a '"' character. Or, if enable_parenthesis +** is defined, search for '(' and ')' as well. Return the index of the first +** such character in the buffer. If there is no such character, return -1. +*/ +static int findBarredChar(const char *z, int n){ + int ii; + for(ii=0; iiiLangid, z, i, &pCursor); + *pnConsumed = n; + rc = sqlite3Fts3OpenTokenizer(pTokenizer, pParse->iLangid, z, n, &pCursor); if( rc==SQLITE_OK ){ const char *zToken; int nToken = 0, iStart = 0, iEnd = 0, iPosition = 0; @@ -194882,7 +196036,18 @@ static int getNextToken( rc = pModule->xNext(pCursor, &zToken, &nToken, &iStart, &iEnd, &iPosition); if( rc==SQLITE_OK ){ - nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase) + nToken; + /* Check that this tokenization did not gobble up any " characters. Or, + ** if enable_parenthesis is true, that it did not gobble up any + ** open or close parenthesis characters either. If it did, call + ** getNextToken() again, but pass only that part of the input buffer + ** up to the first such character. */ + int iBarred = findBarredChar(z, iEnd); + if( iBarred>=0 ){ + pModule->xClose(pCursor); + return getNextToken(pParse, iCol, z, iBarred, ppExpr, pnConsumed); + } + + nByte = sizeof(Fts3Expr) + SZ_FTS3PHRASE(1) + nToken; pRet = (Fts3Expr *)sqlite3Fts3MallocZero(nByte); if( !pRet ){ rc = SQLITE_NOMEM; @@ -194892,7 +196057,7 @@ static int getNextToken( pRet->pPhrase->nToken = 1; pRet->pPhrase->iColumn = iCol; pRet->pPhrase->aToken[0].n = nToken; - pRet->pPhrase->aToken[0].z = (char *)&pRet->pPhrase[1]; + pRet->pPhrase->aToken[0].z = (char*)&pRet->pPhrase->aToken[1]; memcpy(pRet->pPhrase->aToken[0].z, zToken, nToken); if( iEnd=0 ){ + *pnConsumed = iBarred; + } rc = SQLITE_OK; } @@ -194963,9 +196132,9 @@ static int getNextString( Fts3Expr *p = 0; sqlite3_tokenizer_cursor *pCursor = 0; char *zTemp = 0; - int nTemp = 0; + i64 nTemp = 0; - const int nSpace = sizeof(Fts3Expr) + sizeof(Fts3Phrase); + const int nSpace = sizeof(Fts3Expr) + SZ_FTS3PHRASE(1); int nToken = 0; /* The final Fts3Expr data structure, including the Fts3Phrase, @@ -195337,7 +196506,7 @@ static int fts3ExprParse( /* The isRequirePhrase variable is set to true if a phrase or ** an expression contained in parenthesis is required. If a - ** binary operator (AND, OR, NOT or NEAR) is encounted when + ** binary operator (AND, OR, NOT or NEAR) is encountered when ** isRequirePhrase is set, this is a syntax error. */ if( !isPhrase && isRequirePhrase ){ @@ -195919,7 +197088,6 @@ static void fts3ExprTestCommon( } if( rc!=SQLITE_OK && rc!=SQLITE_NOMEM ){ - sqlite3Fts3ExprFree(pExpr); sqlite3_result_error(context, "Error parsing expression", -1); }else if( rc==SQLITE_NOMEM || !(zBuf = exprToString(pExpr, 0)) ){ sqlite3_result_error_nomem(context); @@ -196162,7 +197330,7 @@ static void fts3HashInsertElement( } -/* Resize the hash table so that it cantains "new_size" buckets. +/* Resize the hash table so that it contains "new_size" buckets. ** "new_size" must be a power of 2. The hash table might fail ** to resize if sqliteMalloc() fails. ** @@ -196617,7 +197785,7 @@ static int star_oh(const char *z){ /* ** If the word ends with zFrom and xCond() is true for the stem -** of the word that preceeds the zFrom ending, then change the +** of the word that precedes the zFrom ending, then change the ** ending to zTo. ** ** The input word *pz and zFrom are both in reverse order. zTo @@ -198128,7 +199296,7 @@ static int fts3tokFilterMethod( fts3tokResetCursor(pCsr); if( idxNum==1 ){ const char *zByte = (const char *)sqlite3_value_text(apVal[0]); - int nByte = sqlite3_value_bytes(apVal[0]); + sqlite3_int64 nByte = sqlite3_value_bytes(apVal[0]); pCsr->zInput = sqlite3_malloc64(nByte+1); if( pCsr->zInput==0 ){ rc = SQLITE_NOMEM; @@ -202200,7 +203368,7 @@ static int fts3IncrmergePush( ** ** It is assumed that the buffer associated with pNode is already large ** enough to accommodate the new entry. The buffer associated with pPrev -** is extended by this function if requrired. +** is extended by this function if required. ** ** If an error (i.e. OOM condition) occurs, an SQLite error code is ** returned. Otherwise, SQLITE_OK. @@ -203863,7 +205031,7 @@ SQLITE_PRIVATE int sqlite3Fts3DeferToken( /* ** SQLite value pRowid contains the rowid of a row that may or may not be ** present in the FTS3 table. If it is, delete it and adjust the contents -** of subsiduary data structures accordingly. +** of subsidiary data structures accordingly. */ static int fts3DeleteByRowid( Fts3Table *p, @@ -204189,9 +205357,13 @@ struct MatchinfoBuffer { int nElem; int bGlobal; /* Set if global data is loaded */ char *zMatchinfo; - u32 aMatchinfo[1]; + u32 aMI[FLEXARRAY]; }; +/* Size (in bytes) of a MatchinfoBuffer sufficient for N elements */ +#define SZ_MATCHINFOBUFFER(N) \ + (offsetof(MatchinfoBuffer,aMI)+(((N)+1)/2)*sizeof(u64)) + /* ** The snippet() and offsets() functions both return text values. An instance @@ -204216,13 +205388,13 @@ struct StrBuffer { static MatchinfoBuffer *fts3MIBufferNew(size_t nElem, const char *zMatchinfo){ MatchinfoBuffer *pRet; sqlite3_int64 nByte = sizeof(u32) * (2*(sqlite3_int64)nElem + 1) - + sizeof(MatchinfoBuffer); + + SZ_MATCHINFOBUFFER(1); sqlite3_int64 nStr = strlen(zMatchinfo); pRet = sqlite3Fts3MallocZero(nByte + nStr+1); if( pRet ){ - pRet->aMatchinfo[0] = (u8*)(&pRet->aMatchinfo[1]) - (u8*)pRet; - pRet->aMatchinfo[1+nElem] = pRet->aMatchinfo[0] + pRet->aMI[0] = (u8*)(&pRet->aMI[1]) - (u8*)pRet; + pRet->aMI[1+nElem] = pRet->aMI[0] + sizeof(u32)*((int)nElem+1); pRet->nElem = (int)nElem; pRet->zMatchinfo = ((char*)pRet) + nByte; @@ -204236,10 +205408,10 @@ static MatchinfoBuffer *fts3MIBufferNew(size_t nElem, const char *zMatchinfo){ static void fts3MIBufferFree(void *p){ MatchinfoBuffer *pBuf = (MatchinfoBuffer*)((u8*)p - ((u32*)p)[-1]); - assert( (u32*)p==&pBuf->aMatchinfo[1] - || (u32*)p==&pBuf->aMatchinfo[pBuf->nElem+2] + assert( (u32*)p==&pBuf->aMI[1] + || (u32*)p==&pBuf->aMI[pBuf->nElem+2] ); - if( (u32*)p==&pBuf->aMatchinfo[1] ){ + if( (u32*)p==&pBuf->aMI[1] ){ pBuf->aRef[1] = 0; }else{ pBuf->aRef[2] = 0; @@ -204256,18 +205428,18 @@ static void (*fts3MIBufferAlloc(MatchinfoBuffer *p, u32 **paOut))(void*){ if( p->aRef[1]==0 ){ p->aRef[1] = 1; - aOut = &p->aMatchinfo[1]; + aOut = &p->aMI[1]; xRet = fts3MIBufferFree; } else if( p->aRef[2]==0 ){ p->aRef[2] = 1; - aOut = &p->aMatchinfo[p->nElem+2]; + aOut = &p->aMI[p->nElem+2]; xRet = fts3MIBufferFree; }else{ aOut = (u32*)sqlite3_malloc64(p->nElem * sizeof(u32)); if( aOut ){ xRet = sqlite3_free; - if( p->bGlobal ) memcpy(aOut, &p->aMatchinfo[1], p->nElem*sizeof(u32)); + if( p->bGlobal ) memcpy(aOut, &p->aMI[1], p->nElem*sizeof(u32)); } } @@ -204277,7 +205449,7 @@ static void (*fts3MIBufferAlloc(MatchinfoBuffer *p, u32 **paOut))(void*){ static void fts3MIBufferSetGlobal(MatchinfoBuffer *p){ p->bGlobal = 1; - memcpy(&p->aMatchinfo[2+p->nElem], &p->aMatchinfo[1], p->nElem*sizeof(u32)); + memcpy(&p->aMI[2+p->nElem], &p->aMI[1], p->nElem*sizeof(u32)); } /* @@ -204692,7 +205864,7 @@ static int fts3StringAppend( } /* If there is insufficient space allocated at StrBuffer.z, use realloc() - ** to grow the buffer until so that it is big enough to accomadate the + ** to grow the buffer until so that it is big enough to accommodate the ** appended data. */ if( pStr->n+nAppend+1>=pStr->nAlloc ){ @@ -205104,16 +206276,16 @@ static size_t fts3MatchinfoSize(MatchInfo *pInfo, char cArg){ break; case FTS3_MATCHINFO_LHITS: - nVal = pInfo->nCol * pInfo->nPhrase; + nVal = (size_t)pInfo->nCol * pInfo->nPhrase; break; case FTS3_MATCHINFO_LHITS_BM: - nVal = pInfo->nPhrase * ((pInfo->nCol + 31) / 32); + nVal = (size_t)pInfo->nPhrase * ((pInfo->nCol + 31) / 32); break; default: assert( cArg==FTS3_MATCHINFO_HITS ); - nVal = pInfo->nCol * pInfo->nPhrase * 3; + nVal = (size_t)pInfo->nCol * pInfo->nPhrase * 3; break; } @@ -206671,8 +207843,8 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeFold(int c, int eRemoveDiacritic){ ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -206729,7 +207901,7 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeFold(int c, int eRemoveDiacritic){ ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -206739,7 +207911,7 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeFold(int c, int eRemoveDiacritic){ ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -206799,23 +207971,47 @@ static const char * const jsonbType[] = { ** increase for the text-JSON parser. (Ubuntu14.10 gcc 4.8.4 x64 with -Os). */ static const char jsonIsSpace[] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +#ifdef SQLITE_ASCII +/*0 1 2 3 4 5 6 7 8 9 a b c d e f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, /* 0 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 1 */ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 3 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 4 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 5 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 6 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 7 */ + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 8 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* a */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* b */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* c */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* d */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* e */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* f */ +#endif +#ifdef SQLITE_EBCDIC +/*0 1 2 3 4 5 6 7 8 9 a b c d e f */ + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, /* 0 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 1 */ + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 3 */ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 4 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 5 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 6 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 7 */ + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 8 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* a */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* b */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* c */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* d */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* e */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* f */ +#endif - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; #define jsonIsspace(x) (jsonIsSpace[(unsigned char)x]) @@ -206823,7 +208019,13 @@ static const char jsonIsSpace[] = { ** The set of all space characters recognized by jsonIsspace(). ** Useful as the second argument to strspn(). */ +#ifdef SQLITE_ASCII static const char jsonSpaces[] = "\011\012\015\040"; +#endif +#ifdef SQLITE_EBCDIC +static const char jsonSpaces[] = "\005\045\015\100"; +#endif + /* ** Characters that are special to JSON. Control characters, @@ -206832,23 +208034,46 @@ static const char jsonSpaces[] = "\011\012\015\040"; ** it in the set of special characters. */ static const char jsonIsOk[256] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +#ifdef SQLITE_ASCII +/*0 1 2 3 4 5 6 7 8 9 a b c d e f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 1 */ + 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, /* 2 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 3 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, /* 5 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 7 */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 8 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 9 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* a */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* b */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 /* f */ +#endif +#ifdef SQLITE_EBCDIC +/*0 1 2 3 4 5 6 7 8 9 a b c d e f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 1 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 2 */ + 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, /* 3 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 5 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, /* 7 */ + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 8 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 9 */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* a */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* b */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* c */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* d */ + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* e */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 /* f */ +#endif }; /* Objects */ @@ -206993,7 +208218,7 @@ struct JsonParse { ** Forward references **************************************************************************/ static void jsonReturnStringAsBlob(JsonString*); -static int jsonFuncArgMightBeBinary(sqlite3_value *pJson); +static int jsonArgIsJsonb(sqlite3_value *pJson, JsonParse *p); static u32 jsonTranslateBlobToText(const JsonParse*,u32,JsonString*); static void jsonReturnParse(sqlite3_context*,JsonParse*); static JsonParse *jsonParseFuncArg(sqlite3_context*,sqlite3_value*,u32); @@ -207067,7 +208292,7 @@ static int jsonCacheInsert( ** most-recently used entry if it isn't so already. ** ** The JsonParse object returned still belongs to the Cache and might -** be deleted at any moment. If the caller whants the JsonParse to +** be deleted at any moment. If the caller wants the JsonParse to ** linger, it needs to increment the nPJRef reference counter. */ static JsonParse *jsonCacheSearch( @@ -207411,11 +208636,9 @@ static void jsonAppendSqlValue( break; } default: { - if( jsonFuncArgMightBeBinary(pValue) ){ - JsonParse px; - memset(&px, 0, sizeof(px)); - px.aBlob = (u8*)sqlite3_value_blob(pValue); - px.nBlob = sqlite3_value_bytes(pValue); + JsonParse px; + memset(&px, 0, sizeof(px)); + if( jsonArgIsJsonb(pValue, &px) ){ jsonTranslateBlobToText(&px, 0, p); }else if( p->eErr==0 ){ sqlite3_result_error(p->pCtx, "JSON cannot hold BLOB values", -1); @@ -207734,7 +208957,7 @@ static void jsonWrongNumArgs( */ static int jsonBlobExpand(JsonParse *pParse, u32 N){ u8 *aNew; - u32 t; + u64 t; assert( N>pParse->nBlobAlloc ); if( pParse->nBlobAlloc==0 ){ t = 100; @@ -207744,8 +208967,9 @@ static int jsonBlobExpand(JsonParse *pParse, u32 N){ if( tdb, pParse->aBlob, t); if( aNew==0 ){ pParse->oom = 1; return 1; } + assert( t<0x7fffffff ); pParse->aBlob = aNew; - pParse->nBlobAlloc = t; + pParse->nBlobAlloc = (u32)t; return 0; } @@ -207812,7 +209036,7 @@ static SQLITE_NOINLINE void jsonBlobExpandAndAppendNode( } -/* Append an node type byte together with the payload size and +/* Append a node type byte together with the payload size and ** possibly also the payload. ** ** If aPayload is not NULL, then it is a pointer to the payload which @@ -207881,8 +209105,10 @@ static int jsonBlobChangePayloadSize( nExtra = 1; }else if( szType==13 ){ nExtra = 2; - }else{ + }else if( szType==14 ){ nExtra = 4; + }else{ + nExtra = 8; } if( szPayload<=11 ){ nNeeded = 0; @@ -208352,7 +209578,12 @@ json_parse_restart: || c=='n' || c=='r' || c=='t' || (c=='u' && jsonIs4Hex(&z[j+1])) ){ if( opcode==JSONB_TEXT ) opcode = JSONB_TEXTJ; - }else if( c=='\'' || c=='0' || c=='v' || c=='\n' + }else if( c=='\'' || c=='v' || c=='\n' +#ifdef SQLITE_BUG_COMPATIBLE_20250510 + || (c=='0') /* Legacy bug compatible */ +#else + || (c=='0' && !sqlite3Isdigit(z[j+1])) /* Correct implementation */ +#endif || (0xe2==(u8)c && 0x80==(u8)z[j+1] && (0xa8==(u8)z[j+2] || 0xa9==(u8)z[j+2])) || (c=='x' && jsonIs2Hex(&z[j+1])) ){ @@ -208702,10 +209933,7 @@ static u32 jsonbPayloadSize(const JsonParse *pParse, u32 i, u32 *pSz){ u8 x; u32 sz; u32 n; - if( NEVER(i>pParse->nBlob) ){ - *pSz = 0; - return 0; - } + assert( i<=pParse->nBlob ); x = pParse->aBlob[i]>>4; if( x<=11 ){ sz = x; @@ -208742,15 +209970,15 @@ static u32 jsonbPayloadSize(const JsonParse *pParse, u32 i, u32 *pSz){ *pSz = 0; return 0; } - sz = (pParse->aBlob[i+5]<<24) + (pParse->aBlob[i+6]<<16) + + sz = ((u32)pParse->aBlob[i+5]<<24) + (pParse->aBlob[i+6]<<16) + (pParse->aBlob[i+7]<<8) + pParse->aBlob[i+8]; n = 9; } if( (i64)i+sz+n > pParse->nBlob && (i64)i+sz+n > pParse->nBlob-pParse->delta ){ - sz = 0; - n = 0; + *pSz = 0; + return 0; } *pSz = sz; return n; @@ -208847,9 +210075,12 @@ static u32 jsonTranslateBlobToText( } case JSONB_TEXT: case JSONB_TEXTJ: { - jsonAppendChar(pOut, '"'); - jsonAppendRaw(pOut, (const char*)&pParse->aBlob[i+n], sz); - jsonAppendChar(pOut, '"'); + if( pOut->nUsed+sz+2<=pOut->nAlloc || jsonStringGrow(pOut, sz+2)==0 ){ + pOut->zBuf[pOut->nUsed] = '"'; + memcpy(pOut->zBuf+pOut->nUsed+1,(const char*)&pParse->aBlob[i+n],sz); + pOut->zBuf[pOut->nUsed+sz+1] = '"'; + pOut->nUsed += sz+2; + } break; } case JSONB_TEXT5: { @@ -209088,33 +210319,6 @@ static u32 jsonTranslateBlobToPrettyText( return i; } - -/* Return true if the input pJson -** -** For performance reasons, this routine does not do a detailed check of the -** input BLOB to ensure that it is well-formed. Hence, false positives are -** possible. False negatives should never occur, however. -*/ -static int jsonFuncArgMightBeBinary(sqlite3_value *pJson){ - u32 sz, n; - const u8 *aBlob; - int nBlob; - JsonParse s; - if( sqlite3_value_type(pJson)!=SQLITE_BLOB ) return 0; - aBlob = sqlite3_value_blob(pJson); - nBlob = sqlite3_value_bytes(pJson); - if( nBlob<1 ) return 0; - if( NEVER(aBlob==0) || (aBlob[0] & 0x0f)>JSONB_OBJECT ) return 0; - memset(&s, 0, sizeof(s)); - s.aBlob = (u8*)aBlob; - s.nBlob = nBlob; - n = jsonbPayloadSize(&s, 0, &sz); - if( n==0 ) return 0; - if( sz+n!=(u32)nBlob ) return 0; - if( (aBlob[0] & 0x0f)<=JSONB_FALSE && sz>0 ) return 0; - return sz+n==(u32)nBlob; -} - /* ** Given that a JSONB_ARRAY object starts at offset i, return ** the number of entries in that array. @@ -209147,6 +210351,82 @@ static void jsonAfterEditSizeAdjust(JsonParse *pParse, u32 iRoot){ pParse->delta += jsonBlobChangePayloadSize(pParse, iRoot, sz); } +/* +** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +** size field) by d bytes, then write the expansion into aOut[] and +** return true. In this way, an overwrite happens without changing the +** size of the JSONB, which reduces memcpy() operations and also make it +** faster and easier to update the B-Tree entry that contains the JSONB +** in the database. +** +** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +** then return false. +** +** The d parameter is guaranteed to be between 1 and 8. +** +** This routine is an optimization. A correct answer is obtained if it +** always leaves the output unchanged and returns false. +*/ +static int jsonBlobOverwrite( + u8 *aOut, /* Overwrite here */ + const u8 *aIns, /* New content */ + u32 nIns, /* Bytes of new content */ + u32 d /* Need to expand new content by this much */ +){ + u32 szPayload; /* Bytes of payload */ + u32 i; /* New header size, after expansion & a loop counter */ + u8 szHdr; /* Size of header before expansion */ + + /* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ + static const u8 aType[] = { 0xc0, 0xd0, 0, 0xe0, 0, 0, 0, 0xf0 }; + + if( (aIns[0]&0x0f)<=2 ) return 0; /* Cannot enlarge NULL, true, false */ + switch( aIns[0]>>4 ){ + default: { /* aIns[] header size 1 */ + if( ((1<=2 && i<=9 && aType[i-2]!=0 ); + aOut[0] = (aIns[0] & 0x0f) | aType[i-2]; + memcpy(&aOut[i], &aIns[szHdr], nIns-szHdr); + szPayload = nIns - szHdr; + while( 1/*edit-by-break*/ ){ + i--; + aOut[i] = szPayload & 0xff; + if( i==1 ) break; + szPayload >>= 8; + } + assert( (szPayload>>8)==0 ); + return 1; +} + /* ** Modify the JSONB blob at pParse->aBlob by removing nDel bytes of ** content beginning at iDel, and replacing them with nIns bytes of @@ -209168,6 +210448,11 @@ static void jsonBlobEdit( u32 nIns /* Bytes of content to insert */ ){ i64 d = (i64)nIns - (i64)nDel; + if( d<0 && d>=(-8) && aIns!=0 + && jsonBlobOverwrite(&pParse->aBlob[iDel], aIns, nIns, (int)-d) + ){ + return; + } if( d!=0 ){ if( pParse->nBlob + d > pParse->nBlobAlloc ){ jsonBlobExpand(pParse, pParse->nBlob+d); @@ -209179,7 +210464,9 @@ static void jsonBlobEdit( pParse->nBlob += d; pParse->delta += d; } - if( nIns && aIns ) memcpy(&pParse->aBlob[iDel], aIns, nIns); + if( nIns && aIns ){ + memcpy(&pParse->aBlob[iDel], aIns, nIns); + } } /* @@ -209264,7 +210551,21 @@ static u32 jsonUnescapeOneChar(const char *z, u32 n, u32 *piOut){ case 'r': { *piOut = '\r'; return 2; } case 't': { *piOut = '\t'; return 2; } case 'v': { *piOut = '\v'; return 2; } - case '0': { *piOut = 0; return 2; } + case '0': { + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ +#ifdef SQLITE_BUG_COMPATIBLE_20250510 + /* Legacy bug-compatible behavior */ + *piOut = 0; +#else + /* Correct behavior */ + *piOut = (n>2 && sqlite3Isdigit(z[2])) ? JSON_INVALID_CHAR : 0; +#endif + return 2; + } case '\'': case '"': case '/': @@ -209764,7 +211065,7 @@ static void jsonReturnFromBlob( char *zOut; u32 nOut = sz; z = (const char*)&pParse->aBlob[i+n]; - zOut = sqlite3DbMallocRaw(db, nOut+1); + zOut = sqlite3DbMallocRaw(db, ((u64)nOut)+1); if( zOut==0 ) goto returnfromblob_oom; for(iIn=iOut=0; iInaBlob = (u8*)sqlite3_value_blob(pArg); - pParse->nBlob = sqlite3_value_bytes(pArg); - }else{ + if( !jsonArgIsJsonb(pArg, pParse) ){ sqlite3_result_error(ctx, "JSON cannot hold BLOB values", -1); return 1; } @@ -209942,7 +211240,7 @@ static char *jsonBadPathError( } /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -** arguments come in parse where each pair contains a JSON path and +** arguments come in pairs where each pair contains a JSON path and ** content to insert or set at that patch. Do the updates ** and return the result. ** @@ -210013,27 +211311,46 @@ jsonInsertIntoBlob_patherror: /* ** If pArg is a blob that seems like a JSONB blob, then initialize ** p to point to that JSONB and return TRUE. If pArg does not seem like -** a JSONB blob, then return FALSE; +** a JSONB blob, then return FALSE. ** -** This routine is only called if it is already known that pArg is a -** blob. The only open question is whether or not the blob appears -** to be a JSONB blob. +** For small BLOBs (having no more than 7 bytes of payload) a full +** validity check is done. So for small BLOBs this routine only returns +** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +** (8 byte or more of payload) only the size of the outermost element is +** checked to verify that the BLOB is superficially valid JSONB. +** +** A full JSONB validation is done on smaller BLOBs because those BLOBs might +** also be text JSON that has been incorrectly cast into a BLOB. +** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +** If the BLOB is 9 bytes are larger, then it is not possible for the +** superficial size check done here to pass if the input is really text +** JSON so we do not need to look deeper in that case. +** +** Why we only need to do full JSONB validation for smaller BLOBs: +** +** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +** can also be the first byte of JSONB: '{', '[', and digits '3' +** through '9'. In every one of those cases, the payload size is 7 bytes +** or less. So if we do full JSONB validation for every BLOB where the +** payload is less than 7 bytes, we will never get a false positive for +** JSONB on an input that is really text JSON. */ static int jsonArgIsJsonb(sqlite3_value *pArg, JsonParse *p){ u32 n, sz = 0; + u8 c; + if( sqlite3_value_type(pArg)!=SQLITE_BLOB ) return 0; p->aBlob = (u8*)sqlite3_value_blob(pArg); p->nBlob = (u32)sqlite3_value_bytes(pArg); - if( p->nBlob==0 ){ - p->aBlob = 0; - return 0; - } - if( NEVER(p->aBlob==0) ){ - return 0; - } - if( (p->aBlob[0] & 0x0f)<=JSONB_OBJECT + if( p->nBlob>0 + && ALWAYS(p->aBlob!=0) + && ((c = p->aBlob[0]) & 0x0f)<=JSONB_OBJECT && (n = jsonbPayloadSize(p, 0, &sz))>0 && sz+n==p->nBlob - && ((p->aBlob[0] & 0x0f)>JSONB_FALSE || sz==0) + && ((c & 0x0f)>JSONB_FALSE || sz==0) + && (sz>7 + || (c!=0x7b && c!=0x5b && !sqlite3Isdigit(c)) + || jsonbValidityCheck(p, 0, p->nBlob, 1)==0) ){ return 1; } @@ -210111,7 +211428,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -211126,21 +212443,17 @@ static void jsonValidFunc( return; } case SQLITE_BLOB: { - if( jsonFuncArgMightBeBinary(argv[0]) ){ + JsonParse py; + memset(&py, 0, sizeof(py)); + if( jsonArgIsJsonb(argv[0], &py) ){ if( flags & 0x04 ){ /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = 1; }else if( flags & 0x08 ){ /* Strict checking. Check by translating BLOB->TEXT->BLOB. If ** no errors occur, call that a "strict check". */ - JsonParse px; - u32 iErr; - memset(&px, 0, sizeof(px)); - px.aBlob = (u8*)sqlite3_value_blob(argv[0]); - px.nBlob = sqlite3_value_bytes(argv[0]); - iErr = jsonbValidityCheck(&px, 0, px.nBlob, 1); - res = iErr==0; + res = 0==jsonbValidityCheck(&py, 0, py.nBlob, 1); } break; } @@ -211198,9 +212511,7 @@ static void jsonErrorFunc( UNUSED_PARAMETER(argc); memset(&s, 0, sizeof(s)); s.db = sqlite3_context_db_handle(ctx); - if( jsonFuncArgMightBeBinary(argv[0]) ){ - s.aBlob = (u8*)sqlite3_value_blob(argv[0]); - s.nBlob = sqlite3_value_bytes(argv[0]); + if( jsonArgIsJsonb(argv[0], &s) ){ iErrPos = (i64)jsonbValidityCheck(&s, 0, s.nBlob, 1); }else{ s.zJson = (char*)sqlite3_value_text(argv[0]); @@ -211361,18 +212672,20 @@ static void jsonObjectStep( UNUSED_PARAMETER(argc); pStr = (JsonString*)sqlite3_aggregate_context(ctx, sizeof(*pStr)); if( pStr ){ + z = (const char*)sqlite3_value_text(argv[0]); + n = sqlite3Strlen30(z); if( pStr->zBuf==0 ){ jsonStringInit(pStr, ctx); jsonAppendChar(pStr, '{'); - }else if( pStr->nUsed>1 ){ + }else if( pStr->nUsed>1 && z!=0 ){ jsonAppendChar(pStr, ','); } pStr->pCtx = ctx; - z = (const char*)sqlite3_value_text(argv[0]); - n = sqlite3Strlen30(z); - jsonAppendString(pStr, z, n); - jsonAppendChar(pStr, ':'); - jsonAppendSqlValue(pStr, argv[1]); + if( z!=0 ){ + jsonAppendString(pStr, z, n); + jsonAppendChar(pStr, ':'); + jsonAppendSqlValue(pStr, argv[1]); + } } } static void jsonObjectCompute(sqlite3_context *ctx, int isFinal){ @@ -211885,9 +213198,8 @@ static int jsonEachFilter( memset(&p->sParse, 0, sizeof(p->sParse)); p->sParse.nJPRef = 1; p->sParse.db = p->db; - if( jsonFuncArgMightBeBinary(argv[0]) ){ - p->sParse.nBlob = sqlite3_value_bytes(argv[0]); - p->sParse.aBlob = (u8*)sqlite3_value_blob(argv[0]); + if( jsonArgIsJsonb(argv[0], &p->sParse) ){ + /* We have JSONB */ }else{ p->sParse.zJson = (char*)sqlite3_value_text(argv[0]); p->sParse.nJson = sqlite3_value_bytes(argv[0]); @@ -212181,6 +213493,8 @@ SQLITE_PRIVATE int sqlite3JsonTableFunctions(sqlite3 *db){ #endif SQLITE_PRIVATE int sqlite3GetToken(const unsigned char*,int*); /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -212211,6 +213525,14 @@ typedef unsigned int u32; # define ALWAYS(X) (X) # define NEVER(X) (X) #endif +#ifndef offsetof +#define offsetof(STRUCTURE,FIELD) ((size_t)((char*)&((STRUCTURE*)0)->FIELD)) +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define FLEXARRAY +#else +# define FLEXARRAY 1 +#endif #endif /* !defined(SQLITE_AMALGAMATION) */ /* Macro to check for 4-byte alignment. Only used inside of assert() */ @@ -212531,9 +213853,13 @@ struct RtreeMatchArg { RtreeGeomCallback cb; /* Info about the callback functions */ int nParam; /* Number of parameters to the SQL function */ sqlite3_value **apSqlParam; /* Original SQL parameter values */ - RtreeDValue aParam[1]; /* Values for parameters to the SQL function */ + RtreeDValue aParam[FLEXARRAY]; /* Values for parameters to the SQL function */ }; +/* Size of an RtreeMatchArg object with N parameters */ +#define SZ_RTREEMATCHARG(N) \ + (offsetof(RtreeMatchArg,aParam)+(N)*sizeof(RtreeDValue)) + #ifndef MAX # define MAX(x,y) ((x) < (y) ? (y) : (x)) #endif @@ -214222,7 +215548,7 @@ static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){ } /* -** Return the N-dimensional volumn of the cell stored in *p. +** Return the N-dimensional volume of the cell stored in *p. */ static RtreeDValue cellArea(Rtree *pRtree, RtreeCell *p){ RtreeDValue area = (RtreeDValue)1; @@ -215988,7 +217314,7 @@ static sqlite3_stmt *rtreeCheckPrepare( /* ** The second and subsequent arguments to this function are a printf() ** style format string and arguments. This function formats the string and -** appends it to the report being accumuated in pCheck. +** appends it to the report being accumulated in pCheck. */ static void rtreeCheckAppendMsg(RtreeCheck *pCheck, const char *zFmt, ...){ va_list ap; @@ -217176,7 +218502,7 @@ static void geopolyBBoxFinal( ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). ** Returns: ** -** +2 x0,y0 is on the line segement +** +2 x0,y0 is on the line segment ** ** +1 x0,y0 is beneath line segment ** @@ -217282,7 +218608,7 @@ static void geopolyWithinFunc( sqlite3_free(p2); } -/* Objects used by the overlap algorihm. */ +/* Objects used by the overlap algorithm. */ typedef struct GeoEvent GeoEvent; typedef struct GeoSegment GeoSegment; typedef struct GeoOverlap GeoOverlap; @@ -218329,8 +219655,7 @@ static void geomCallback(sqlite3_context *ctx, int nArg, sqlite3_value **aArg){ sqlite3_int64 nBlob; int memErr = 0; - nBlob = sizeof(RtreeMatchArg) + (nArg-1)*sizeof(RtreeDValue) - + nArg*sizeof(sqlite3_value*); + nBlob = SZ_RTREEMATCHARG(nArg) + nArg*sizeof(sqlite3_value*); pBlob = (RtreeMatchArg *)sqlite3_malloc64(nBlob); if( !pBlob ){ sqlite3_result_error_nomem(ctx); @@ -219425,7 +220750,7 @@ SQLITE_PRIVATE void sqlite3Fts3IcuTokenizerModule( ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -219722,7 +221047,7 @@ SQLITE_API sqlite3rbu *sqlite3rbu_open( ** the next call to sqlite3rbu_vacuum() opens a handle that starts a ** new RBU vacuum operation. ** -** As with sqlite3rbu_open(), Zipvfs users should rever to the comment +** As with sqlite3rbu_open(), Zipvfs users should refer to the comment ** describing the sqlite3rbu_create_vfs() API function below for ** a description of the complications associated with using RBU with ** zipvfs databases. @@ -219818,7 +221143,7 @@ SQLITE_API int sqlite3rbu_savestate(sqlite3rbu *pRbu); ** ** If the RBU update has been completely applied, mark the RBU database ** as fully applied. Otherwise, assuming no error has occurred, save the -** current state of the RBU update appliation to the RBU database. +** current state of the RBU update application to the RBU database. ** ** If an error has already occurred as part of an sqlite3rbu_step() ** or sqlite3rbu_open() call, or if one occurs within this function, an @@ -224744,7 +226069,7 @@ static int rbuVfsFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){ /* If this is an RBU vacuum operation and this is the target database, ** pretend that it has at least one page. Otherwise, SQLite will not - ** check for the existance of a *-wal file. rbuVfsRead() contains + ** check for the existence of a *-wal file. rbuVfsRead() contains ** similar logic. */ if( rc==SQLITE_OK && *pSize==0 && p->pRbu && rbuIsVacuum(p->pRbu) @@ -226676,8 +228001,8 @@ static int dbpageUpdate( /* "INSERT INTO dbpage($PGNO,NULL)" causes page number $PGNO and ** all subsequent pages to be deleted. */ pTab->iDbTrunc = iDb; - pgno--; - pTab->pgnoTrunc = pgno; + pTab->pgnoTrunc = pgno-1; + pgno = 1; }else{ zErr = "bad page value"; goto update_fail; @@ -227974,7 +229299,7 @@ static int sessionTableInfo( /* ** This function is called to initialize the SessionTable.nCol, azCol[] ** abPK[] and azDflt[] members of SessionTable object pTab. If these -** fields are already initilialized, this function is a no-op. +** fields are already initialized, this function is a no-op. ** ** If an error occurs, an error code is stored in sqlite3_session.rc and ** non-zero returned. Or, if no error occurs but the table has no primary @@ -227993,6 +229318,8 @@ static int sessionInitTable( if( pTab->nCol==0 ){ u8 *abPK; assert( pTab->azCol==0 || pTab->abPK==0 ); + sqlite3_free(pTab->azCol); + pTab->abPK = 0; rc = sessionTableInfo(pSession, db, zDb, pTab->zName, &pTab->nCol, &pTab->nTotalCol, 0, &pTab->azCol, &pTab->azDflt, &pTab->aiIdx, &abPK, @@ -229000,7 +230327,9 @@ SQLITE_API int sqlite3session_diff( SessionTable *pTo; /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + pSession->bAutoAttach++; rc = sessionFindTable(pSession, zTbl, &pTo); + pSession->bAutoAttach--; if( pTo==0 ) goto diff_out; if( sessionInitTable(pSession, pTo, pSession->db, pSession->zDb) ){ rc = pSession->rc; @@ -229011,17 +230340,43 @@ SQLITE_API int sqlite3session_diff( if( rc==SQLITE_OK ){ int bHasPk = 0; int bMismatch = 0; - int nCol; /* Columns in zFrom.zTbl */ + int nCol = 0; /* Columns in zFrom.zTbl */ int bRowid = 0; - u8 *abPK; + u8 *abPK = 0; const char **azCol = 0; - rc = sessionTableInfo(0, db, zFrom, zTbl, - &nCol, 0, 0, &azCol, 0, 0, &abPK, - pSession->bImplicitPK ? &bRowid : 0 - ); + char *zDbExists = 0; + + /* Check that database zFrom is attached. */ + zDbExists = sqlite3_mprintf("SELECT * FROM %Q.sqlite_schema", zFrom); + if( zDbExists==0 ){ + rc = SQLITE_NOMEM; + }else{ + sqlite3_stmt *pDbExists = 0; + rc = sqlite3_prepare_v2(db, zDbExists, -1, &pDbExists, 0); + if( rc==SQLITE_ERROR ){ + rc = SQLITE_OK; + nCol = -1; + } + sqlite3_finalize(pDbExists); + sqlite3_free(zDbExists); + } + + if( rc==SQLITE_OK && nCol==0 ){ + rc = sessionTableInfo(0, db, zFrom, zTbl, + &nCol, 0, 0, &azCol, 0, 0, &abPK, + pSession->bImplicitPK ? &bRowid : 0 + ); + } if( rc==SQLITE_OK ){ if( pTo->nCol!=nCol ){ - bMismatch = 1; + if( nCol<=0 ){ + rc = SQLITE_SCHEMA; + if( pzErrMsg ){ + *pzErrMsg = sqlite3_mprintf("no such table: %s.%s", zFrom, zTbl); + } + }else{ + bMismatch = 1; + } }else{ int i; for(i=0; idb; /* Source database handle */ SessionTable *pTab; /* Used to iterate through attached tables */ - SessionBuffer buf = {0,0,0}; /* Buffer in which to accumlate changeset */ + SessionBuffer buf = {0,0,0}; /* Buffer in which to accumulate changeset */ int rc; /* Return code */ assert( xOutput==0 || (pnChangeset==0 && ppChangeset==0) ); @@ -230150,14 +231505,15 @@ SQLITE_API int sqlite3changeset_start_v2_strm( ** object and the buffer is full, discard some data to free up space. */ static void sessionDiscardData(SessionInput *pIn){ - if( pIn->xInput && pIn->iNext>=sessions_strm_chunk_size ){ - int nMove = pIn->buf.nBuf - pIn->iNext; + if( pIn->xInput && pIn->iCurrent>=sessions_strm_chunk_size ){ + int nMove = pIn->buf.nBuf - pIn->iCurrent; assert( nMove>=0 ); if( nMove>0 ){ - memmove(pIn->buf.aBuf, &pIn->buf.aBuf[pIn->iNext], nMove); + memmove(pIn->buf.aBuf, &pIn->buf.aBuf[pIn->iCurrent], nMove); } - pIn->buf.nBuf -= pIn->iNext; - pIn->iNext = 0; + pIn->buf.nBuf -= pIn->iCurrent; + pIn->iNext -= pIn->iCurrent; + pIn->iCurrent = 0; pIn->nData = pIn->buf.nBuf; } } @@ -230511,8 +231867,8 @@ static int sessionChangesetNextOne( p->rc = sessionInputBuffer(&p->in, 2); if( p->rc!=SQLITE_OK ) return p->rc; - sessionDiscardData(&p->in); p->in.iCurrent = p->in.iNext; + sessionDiscardData(&p->in); /* If the iterator is already at the end of the changeset, return DONE. */ if( p->in.iNext>=p->in.nData ){ @@ -232871,14 +234227,19 @@ SQLITE_API int sqlite3changegroup_add_change( sqlite3_changegroup *pGrp, sqlite3_changeset_iter *pIter ){ + int rc = SQLITE_OK; + if( pIter->in.iCurrent==pIter->in.iNext || pIter->rc!=SQLITE_OK || pIter->bInvert ){ /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return SQLITE_ERROR; + rc = SQLITE_ERROR; + }else{ + pIter->in.bNoDiscard = 1; + rc = sessionOneChangeToHash(pGrp, pIter, 0); } - return sessionOneChangeToHash(pGrp, pIter, 0); + return rc; } /* @@ -234176,6 +235537,7 @@ SQLITE_EXTENSION_INIT1 /* #include */ /* #include */ +/* #include */ #ifndef SQLITE_AMALGAMATION @@ -234231,6 +235593,18 @@ typedef sqlite3_uint64 u64; # define EIGHT_BYTE_ALIGNMENT(X) ((((uptr)(X) - (uptr)0)&7)==0) #endif +/* +** Macros needed to provide flexible arrays in a portable way +*/ +#ifndef offsetof +# define offsetof(STRUCTURE,FIELD) ((size_t)((char*)&((STRUCTURE*)0)->FIELD)) +#endif +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define FLEXARRAY +#else +# define FLEXARRAY 1 +#endif + #endif /* Truncate very long tokens to this many bytes. Hard limit is @@ -234303,10 +235677,11 @@ typedef struct Fts5Colset Fts5Colset; */ struct Fts5Colset { int nCol; - int aiCol[1]; + int aiCol[FLEXARRAY]; }; - +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ +#define SZ_FTS5COLSET(N) (sizeof(i64)*((N+2)/2)) /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -235135,7 +236510,7 @@ static void sqlite3Fts5UnicodeAscii(u8*, u8*); ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -237289,7 +238664,7 @@ static int fts5Bm25GetData( ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ double idf = log( (nRow - nHit + 0.5) / (nHit + 0.5) ); @@ -237752,7 +239127,7 @@ static char *sqlite3Fts5Strndup(int *pRc, const char *pIn, int nIn){ ** * The 52 upper and lower case ASCII characters, and ** * The 10 integer ASCII characters. ** * The underscore character "_" (0x5F). -** * The unicode "subsitute" character (0x1A). +** * The unicode "substitute" character (0x1A). */ static int sqlite3Fts5IsBareword(char t){ u8 aBareword[128] = { @@ -239070,9 +240445,13 @@ struct Fts5ExprNode { /* Child nodes. For a NOT node, this array always contains 2 entries. For ** AND or OR nodes, it contains 2 or more entries. */ int nChild; /* Number of child nodes */ - Fts5ExprNode *apChild[1]; /* Array of child nodes */ + Fts5ExprNode *apChild[FLEXARRAY]; /* Array of child nodes */ }; +/* Size (in bytes) of an Fts5ExprNode object that holds up to N children */ +#define SZ_FTS5EXPRNODE(N) \ + (offsetof(Fts5ExprNode,apChild) + (N)*sizeof(Fts5ExprNode*)) + #define Fts5NodeIsString(p) ((p)->eType==FTS5_TERM || (p)->eType==FTS5_STRING) /* @@ -239103,9 +240482,13 @@ struct Fts5ExprPhrase { Fts5ExprNode *pNode; /* FTS5_STRING node this phrase is part of */ Fts5Buffer poslist; /* Current position list */ int nTerm; /* Number of entries in aTerm[] */ - Fts5ExprTerm aTerm[1]; /* Terms that make up this phrase */ + Fts5ExprTerm aTerm[FLEXARRAY]; /* Terms that make up this phrase */ }; +/* Size (in bytes) of an Fts5ExprPhrase object that holds up to N terms */ +#define SZ_FTS5EXPRPHRASE(N) \ + (offsetof(Fts5ExprPhrase,aTerm) + (N)*sizeof(Fts5ExprTerm)) + /* ** One or more phrases that must appear within a certain token distance of ** each other within each matching document. @@ -239114,9 +240497,12 @@ struct Fts5ExprNearset { int nNear; /* NEAR parameter */ Fts5Colset *pColset; /* Columns to search (NULL -> all columns) */ int nPhrase; /* Number of entries in aPhrase[] array */ - Fts5ExprPhrase *apPhrase[1]; /* Array of phrase pointers */ + Fts5ExprPhrase *apPhrase[FLEXARRAY]; /* Array of phrase pointers */ }; +/* Size (in bytes) of an Fts5ExprNearset object covering up to N phrases */ +#define SZ_FTS5EXPRNEARSET(N) \ + (offsetof(Fts5ExprNearset,apPhrase)+(N)*sizeof(Fts5ExprPhrase*)) /* ** Parse context. @@ -239276,7 +240662,7 @@ static int sqlite3Fts5ExprNew( /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if( sParse.rc==SQLITE_OK && iColnCol ){ - int n = sizeof(Fts5Colset); + int n = SZ_FTS5COLSET(1); Fts5Colset *pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&sParse.rc, n); if( pColset ){ pColset->nCol = 1; @@ -240634,7 +242020,7 @@ static Fts5ExprNearset *sqlite3Fts5ParseNearset( if( pParse->rc==SQLITE_OK ){ if( pNear==0 ){ sqlite3_int64 nByte; - nByte = sizeof(Fts5ExprNearset) + SZALLOC * sizeof(Fts5ExprPhrase*); + nByte = SZ_FTS5EXPRNEARSET(SZALLOC+1); pRet = sqlite3_malloc64(nByte); if( pRet==0 ){ pParse->rc = SQLITE_NOMEM; @@ -240645,7 +242031,7 @@ static Fts5ExprNearset *sqlite3Fts5ParseNearset( int nNew = pNear->nPhrase + SZALLOC; sqlite3_int64 nByte; - nByte = sizeof(Fts5ExprNearset) + nNew * sizeof(Fts5ExprPhrase*); + nByte = SZ_FTS5EXPRNEARSET(nNew+1); pRet = (Fts5ExprNearset*)sqlite3_realloc64(pNear, nByte); if( pRet==0 ){ pParse->rc = SQLITE_NOMEM; @@ -240736,12 +242122,12 @@ static int fts5ParseTokenize( int nNew = SZALLOC + (pPhrase ? pPhrase->nTerm : 0); pNew = (Fts5ExprPhrase*)sqlite3_realloc64(pPhrase, - sizeof(Fts5ExprPhrase) + sizeof(Fts5ExprTerm) * nNew + SZ_FTS5EXPRPHRASE(nNew+1) ); if( pNew==0 ){ rc = SQLITE_NOMEM; }else{ - if( pPhrase==0 ) memset(pNew, 0, sizeof(Fts5ExprPhrase)); + if( pPhrase==0 ) memset(pNew, 0, SZ_FTS5EXPRPHRASE(1)); pCtx->pPhrase = pPhrase = pNew; pNew->nTerm = nNew - SZALLOC; } @@ -240849,7 +242235,7 @@ static Fts5ExprPhrase *sqlite3Fts5ParseTerm( if( sCtx.pPhrase==0 ){ /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - sCtx.pPhrase = sqlite3Fts5MallocZero(&pParse->rc, sizeof(Fts5ExprPhrase)); + sCtx.pPhrase = sqlite3Fts5MallocZero(&pParse->rc, SZ_FTS5EXPRPHRASE(1)); }else if( sCtx.pPhrase->nTerm ){ sCtx.pPhrase->aTerm[sCtx.pPhrase->nTerm-1].bPrefix = (u8)bPrefix; } @@ -240884,19 +242270,18 @@ static int sqlite3Fts5ExprClonePhrase( sizeof(Fts5ExprPhrase*)); } if( rc==SQLITE_OK ){ - pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc, - sizeof(Fts5ExprNode)); + pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc, SZ_FTS5EXPRNODE(1)); } if( rc==SQLITE_OK ){ pNew->pRoot->pNear = (Fts5ExprNearset*)sqlite3Fts5MallocZero(&rc, - sizeof(Fts5ExprNearset) + sizeof(Fts5ExprPhrase*)); + SZ_FTS5EXPRNEARSET(2)); } if( rc==SQLITE_OK && ALWAYS(pOrig!=0) ){ Fts5Colset *pColsetOrig = pOrig->pNode->pNear->pColset; if( pColsetOrig ){ sqlite3_int64 nByte; Fts5Colset *pColset; - nByte = sizeof(Fts5Colset) + (pColsetOrig->nCol-1) * sizeof(int); + nByte = SZ_FTS5COLSET(pColsetOrig->nCol); pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&rc, nByte); if( pColset ){ memcpy(pColset, pColsetOrig, (size_t)nByte); @@ -240924,7 +242309,7 @@ static int sqlite3Fts5ExprClonePhrase( }else{ /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - sCtx.pPhrase = sqlite3Fts5MallocZero(&rc, sizeof(Fts5ExprPhrase)); + sCtx.pPhrase = sqlite3Fts5MallocZero(&rc, SZ_FTS5EXPRPHRASE(1)); } } @@ -240989,7 +242374,8 @@ static void sqlite3Fts5ParseSetDistance( ); return; } - nNear = nNear * 10 + (p->p[i] - '0'); + if( nNear<214748363 ) nNear = nNear * 10 + (p->p[i] - '0'); + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ } }else{ nNear = FTS5_DEFAULT_NEARDIST; @@ -241018,7 +242404,7 @@ static Fts5Colset *fts5ParseColset( assert( pParse->rc==SQLITE_OK ); assert( iCol>=0 && iColpConfig->nCol ); - pNew = sqlite3_realloc64(p, sizeof(Fts5Colset) + sizeof(int)*nCol); + pNew = sqlite3_realloc64(p, SZ_FTS5COLSET(nCol+1)); if( pNew==0 ){ pParse->rc = SQLITE_NOMEM; }else{ @@ -241053,7 +242439,7 @@ static Fts5Colset *sqlite3Fts5ParseColsetInvert(Fts5Parse *pParse, Fts5Colset *p int nCol = pParse->pConfig->nCol; pRet = (Fts5Colset*)sqlite3Fts5MallocZero(&pParse->rc, - sizeof(Fts5Colset) + sizeof(int)*nCol + SZ_FTS5COLSET(nCol+1) ); if( pRet ){ int i; @@ -241114,7 +242500,7 @@ static Fts5Colset *sqlite3Fts5ParseColset( static Fts5Colset *fts5CloneColset(int *pRc, Fts5Colset *pOrig){ Fts5Colset *pRet; if( pOrig ){ - sqlite3_int64 nByte = sizeof(Fts5Colset) + (pOrig->nCol-1) * sizeof(int); + sqlite3_int64 nByte = SZ_FTS5COLSET(pOrig->nCol); pRet = (Fts5Colset*)sqlite3Fts5MallocZero(pRc, nByte); if( pRet ){ memcpy(pRet, pOrig, (size_t)nByte); @@ -241282,7 +242668,7 @@ static Fts5ExprNode *fts5ParsePhraseToAnd( assert( pNear->nPhrase==1 ); assert( pParse->bPhraseToAnd ); - nByte = sizeof(Fts5ExprNode) + nTerm*sizeof(Fts5ExprNode*); + nByte = SZ_FTS5EXPRNODE(nTerm+1); pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte); if( pRet ){ pRet->eType = FTS5_AND; @@ -241292,7 +242678,7 @@ static Fts5ExprNode *fts5ParsePhraseToAnd( pParse->nPhrase--; for(ii=0; iirc, sizeof(Fts5ExprPhrase) + &pParse->rc, SZ_FTS5EXPRPHRASE(1) ); if( pPhrase ){ if( parseGrowPhraseArray(pParse) ){ @@ -241361,7 +242747,7 @@ static Fts5ExprNode *sqlite3Fts5ParseNode( if( pRight->eType==eType ) nChild += pRight->nChild-1; } - nByte = sizeof(Fts5ExprNode) + sizeof(Fts5ExprNode*)*(nChild-1); + nByte = SZ_FTS5EXPRNODE(nChild); pRet = (Fts5ExprNode*)sqlite3Fts5MallocZero(&pParse->rc, nByte); if( pRet ){ @@ -242236,7 +243622,7 @@ static int sqlite3Fts5ExprInstToken( } /* -** Clear the token mappings for all Fts5IndexIter objects mannaged by +** Clear the token mappings for all Fts5IndexIter objects managed by ** the expression passed as the only argument. */ static void sqlite3Fts5ExprClearTokens(Fts5Expr *pExpr){ @@ -242271,7 +243657,7 @@ typedef struct Fts5HashEntry Fts5HashEntry; /* ** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 +** to accumulate "term -> doclist" content before it is flushed to a level-0 ** segment. */ @@ -242328,7 +243714,7 @@ struct Fts5HashEntry { }; /* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -243264,9 +244650,13 @@ struct Fts5Structure { u64 nOriginCntr; /* Origin value for next top-level segment */ int nSegment; /* Total segments in this structure */ int nLevel; /* Number of levels in this index */ - Fts5StructureLevel aLevel[1]; /* Array of nLevel level objects */ + Fts5StructureLevel aLevel[FLEXARRAY]; /* Array of nLevel level objects */ }; +/* Size (in bytes) of an Fts5Structure object holding up to N levels */ +#define SZ_FTS5STRUCTURE(N) \ + (offsetof(Fts5Structure,aLevel) + (N)*sizeof(Fts5StructureLevel)) + /* ** An object of type Fts5SegWriter is used to write to segments. */ @@ -243396,11 +244786,15 @@ struct Fts5SegIter { ** Array of tombstone pages. Reference counted. */ struct Fts5TombstoneArray { - int nRef; /* Number of pointers to this object */ + int nRef; /* Number of pointers to this object */ int nTombstone; - Fts5Data *apTombstone[1]; /* Array of tombstone pages */ + Fts5Data *apTombstone[FLEXARRAY]; /* Array of tombstone pages */ }; +/* Size (in bytes) of an Fts5TombstoneArray holding up to N tombstones */ +#define SZ_FTS5TOMBSTONEARRAY(N) \ + (offsetof(Fts5TombstoneArray,apTombstone)+(N)*sizeof(Fts5Data*)) + /* ** Argument is a pointer to an Fts5Data structure that contains a ** leaf page. @@ -243469,9 +244863,12 @@ struct Fts5Iter { i64 iSwitchRowid; /* Firstest rowid of other than aFirst[1] */ Fts5CResult *aFirst; /* Current merge state (see above) */ - Fts5SegIter aSeg[1]; /* Array of segment iterators */ + Fts5SegIter aSeg[FLEXARRAY]; /* Array of segment iterators */ }; +/* Size (in bytes) of an Fts5Iter object holding up to N segment iterators */ +#define SZ_FTS5ITER(N) (offsetof(Fts5Iter,aSeg)+(N)*sizeof(Fts5SegIter)) + /* ** An instance of the following type is used to iterate through the contents ** of a doclist-index record. @@ -243498,9 +244895,13 @@ struct Fts5DlidxLvl { struct Fts5DlidxIter { int nLvl; int iSegid; - Fts5DlidxLvl aLvl[1]; + Fts5DlidxLvl aLvl[FLEXARRAY]; }; +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ +#define SZ_FTS5DLIDXITER(N) \ + (offsetof(Fts5DlidxIter,aLvl)+(N)*sizeof(Fts5DlidxLvl)) + static void fts5PutU16(u8 *aOut, u16 iVal){ aOut[0] = (iVal>>8); aOut[1] = (iVal&0xFF); @@ -243868,7 +245269,7 @@ static int sqlite3Fts5StructureTest(Fts5Index *p, void *pStruct){ static void fts5StructureMakeWritable(int *pRc, Fts5Structure **pp){ Fts5Structure *p = *pp; if( *pRc==SQLITE_OK && p->nRef>1 ){ - i64 nByte = sizeof(Fts5Structure)+(p->nLevel-1)*sizeof(Fts5StructureLevel); + i64 nByte = SZ_FTS5STRUCTURE(p->nLevel); Fts5Structure *pNew; pNew = (Fts5Structure*)sqlite3Fts5MallocZero(pRc, nByte); if( pNew ){ @@ -243942,10 +245343,7 @@ static int fts5StructureDecode( ){ return FTS5_CORRUPT; } - nByte = ( - sizeof(Fts5Structure) + /* Main structure */ - sizeof(Fts5StructureLevel) * (nLevel-1) /* aLevel[] array */ - ); + nByte = SZ_FTS5STRUCTURE(nLevel); pRet = (Fts5Structure*)sqlite3Fts5MallocZero(&rc, nByte); if( pRet ){ @@ -244025,10 +245423,7 @@ static void fts5StructureAddLevel(int *pRc, Fts5Structure **ppStruct){ if( *pRc==SQLITE_OK ){ Fts5Structure *pStruct = *ppStruct; int nLevel = pStruct->nLevel; - sqlite3_int64 nByte = ( - sizeof(Fts5Structure) + /* Main structure */ - sizeof(Fts5StructureLevel) * (nLevel+1) /* aLevel[] array */ - ); + sqlite3_int64 nByte = SZ_FTS5STRUCTURE(nLevel+2); pStruct = sqlite3_realloc64(pStruct, nByte); if( pStruct ){ @@ -244567,7 +245962,7 @@ static Fts5DlidxIter *fts5DlidxIterInit( int bDone = 0; for(i=0; p->rc==SQLITE_OK && bDone==0; i++){ - sqlite3_int64 nByte = sizeof(Fts5DlidxIter) + i * sizeof(Fts5DlidxLvl); + sqlite3_int64 nByte = SZ_FTS5DLIDXITER(i+1); Fts5DlidxIter *pNew; pNew = (Fts5DlidxIter*)sqlite3_realloc64(pIter, nByte); @@ -244783,9 +246178,9 @@ static void fts5SegIterSetNext(Fts5Index *p, Fts5SegIter *pIter){ ** leave an error in the Fts5Index object. */ static void fts5SegIterAllocTombstone(Fts5Index *p, Fts5SegIter *pIter){ - const int nTomb = pIter->pSeg->nPgTombstone; + const i64 nTomb = (i64)pIter->pSeg->nPgTombstone; if( nTomb>0 ){ - int nByte = nTomb * sizeof(Fts5Data*) + sizeof(Fts5TombstoneArray); + i64 nByte = SZ_FTS5TOMBSTONEARRAY(nTomb+1); Fts5TombstoneArray *pNew; pNew = (Fts5TombstoneArray*)sqlite3Fts5MallocZero(&p->rc, nByte); if( pNew ){ @@ -246246,8 +247641,7 @@ static Fts5Iter *fts5MultiIterAlloc( for(nSlot=2; nSlotaSeg[] */ + SZ_FTS5ITER(nSlot) + /* pNew + pNew->aSeg[] */ sizeof(Fts5CResult) * nSlot /* pNew->aFirst[] */ ); if( pNew ){ @@ -248048,7 +249442,7 @@ static void fts5DoSecureDelete( int iDelKeyOff = 0; /* Offset of deleted key, if any */ nIdx = nPg-iPgIdx; - aIdx = sqlite3Fts5MallocZero(&p->rc, nIdx+16); + aIdx = sqlite3Fts5MallocZero(&p->rc, ((i64)nIdx)+16); if( p->rc ) return; memcpy(aIdx, &aPg[iPgIdx], nIdx); @@ -248613,7 +250007,7 @@ static Fts5Structure *fts5IndexOptimizeStruct( Fts5Structure *pStruct ){ Fts5Structure *pNew = 0; - sqlite3_int64 nByte = sizeof(Fts5Structure); + sqlite3_int64 nByte = SZ_FTS5STRUCTURE(1); int nSeg = pStruct->nSegment; int i; @@ -248642,7 +250036,8 @@ static Fts5Structure *fts5IndexOptimizeStruct( assert( pStruct->aLevel[i].nMerge<=nThis ); } - nByte += (pStruct->nLevel+1) * sizeof(Fts5StructureLevel); + nByte += (((i64)pStruct->nLevel)+1) * sizeof(Fts5StructureLevel); + assert( nByte==SZ_FTS5STRUCTURE(pStruct->nLevel+2) ); pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte); if( pNew ){ @@ -249219,9 +250614,13 @@ struct Fts5TokenDataIter { int nIterAlloc; Fts5PoslistReader *aPoslistReader; int *aPoslistToIter; - Fts5Iter *apIter[1]; + Fts5Iter *apIter[FLEXARRAY]; }; +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ +#define SZ_FTS5TOKENDATAITER(N) \ + (offsetof(Fts5TokenDataIter,apIter) + (N)*sizeof(Fts5Iter)) + /* ** The two input arrays - a1[] and a2[] - are in sorted order. This function ** merges the two arrays together and writes the result to output array @@ -249293,7 +250692,7 @@ static void fts5TokendataIterAppendMap( /* ** Sort the contents of the pT->aMap[] array. ** -** The sorting algorithm requries a malloc(). If this fails, an error code +** The sorting algorithm requires a malloc(). If this fails, an error code ** is left in Fts5Index.rc before returning. */ static void fts5TokendataIterSortMap(Fts5Index *p, Fts5TokenDataIter *pT){ @@ -249484,7 +250883,7 @@ static void fts5SetupPrefixIter( && p->pConfig->bPrefixInsttoken ){ s.pTokendata = &s2; - s2.pT = (Fts5TokenDataIter*)fts5IdxMalloc(p, sizeof(*s2.pT)); + s2.pT = (Fts5TokenDataIter*)fts5IdxMalloc(p, SZ_FTS5TOKENDATAITER(1)); } if( p->pConfig->eDetail==FTS5_DETAIL_NONE ){ @@ -249530,7 +250929,8 @@ static void fts5SetupPrefixIter( } } - pData = fts5IdxMalloc(p, sizeof(*pData)+s.doclist.n+FTS5_DATA_ZERO_PADDING); + pData = fts5IdxMalloc(p, sizeof(*pData) + + ((i64)s.doclist.n)+FTS5_DATA_ZERO_PADDING); assert( pData!=0 || p->rc!=SQLITE_OK ); if( pData ){ pData->p = (u8*)&pData[1]; @@ -249611,15 +251011,17 @@ static int sqlite3Fts5IndexRollback(Fts5Index *p){ ** and the initial version of the "averages" record (a zero-byte blob). */ static int sqlite3Fts5IndexReinit(Fts5Index *p){ - Fts5Structure s; + Fts5Structure *pTmp; + u8 tmpSpace[SZ_FTS5STRUCTURE(1)]; fts5StructureInvalidate(p); fts5IndexDiscardData(p); - memset(&s, 0, sizeof(Fts5Structure)); + pTmp = (Fts5Structure*)tmpSpace; + memset(pTmp, 0, SZ_FTS5STRUCTURE(1)); if( p->pConfig->bContentlessDelete ){ - s.nOriginCntr = 1; + pTmp->nOriginCntr = 1; } fts5DataWrite(p, FTS5_AVERAGES_ROWID, (const u8*)"", 0); - fts5StructureWrite(p, &s); + fts5StructureWrite(p, pTmp); return fts5IndexReturn(p); } @@ -249827,7 +251229,7 @@ static Fts5TokenDataIter *fts5AppendTokendataIter( if( p->rc==SQLITE_OK ){ if( pIn==0 || pIn->nIter==pIn->nIterAlloc ){ int nAlloc = pIn ? pIn->nIterAlloc*2 : 16; - int nByte = nAlloc * sizeof(Fts5Iter*) + sizeof(Fts5TokenDataIter); + int nByte = SZ_FTS5TOKENDATAITER(nAlloc+1); Fts5TokenDataIter *pNew = (Fts5TokenDataIter*)sqlite3_realloc(pIn, nByte); if( pNew==0 ){ @@ -250343,7 +251745,8 @@ static int fts5SetupPrefixIterTokendata( fts5BufferGrow(&p->rc, &token, nToken+1); assert( token.p!=0 || p->rc!=SQLITE_OK ); - ctx.pT = (Fts5TokenDataIter*)sqlite3Fts5MallocZero(&p->rc, sizeof(*ctx.pT)); + ctx.pT = (Fts5TokenDataIter*)sqlite3Fts5MallocZero(&p->rc, + SZ_FTS5TOKENDATAITER(1)); if( p->rc==SQLITE_OK ){ @@ -250474,7 +251877,8 @@ static int sqlite3Fts5IndexIterWriteTokendata( if( pIter->nSeg>0 ){ /* This is a prefix term iterator. */ if( pT==0 ){ - pT = (Fts5TokenDataIter*)sqlite3Fts5MallocZero(&p->rc, sizeof(*pT)); + pT = (Fts5TokenDataIter*)sqlite3Fts5MallocZero(&p->rc, + SZ_FTS5TOKENDATAITER(1)); pIter->pTokenDataIter = pT; } if( pT ){ @@ -251508,7 +252912,7 @@ static void fts5DecodeRowid( #if defined(SQLITE_TEST) || defined(SQLITE_FTS5_DEBUG) static void fts5DebugRowid(int *pRc, Fts5Buffer *pBuf, i64 iKey){ - int iSegid, iHeight, iPgno, bDlidx, bTomb; /* Rowid compenents */ + int iSegid, iHeight, iPgno, bDlidx, bTomb; /* Rowid components */ fts5DecodeRowid(iKey, &bTomb, &iSegid, &bDlidx, &iHeight, &iPgno); if( iSegid==0 ){ @@ -251754,7 +253158,7 @@ static void fts5DecodeFunction( ** buffer overreads even if the record is corrupt. */ n = sqlite3_value_bytes(apVal[1]); aBlob = sqlite3_value_blob(apVal[1]); - nSpace = n + FTS5_DATA_ZERO_PADDING; + nSpace = ((i64)n) + FTS5_DATA_ZERO_PADDING; a = (u8*)sqlite3Fts5MallocZero(&rc, nSpace); if( a==0 ) goto decode_out; if( n>0 ) memcpy(a, aBlob, n); @@ -252469,9 +253873,11 @@ struct Fts5Sorter { i64 iRowid; /* Current rowid */ const u8 *aPoslist; /* Position lists for current row */ int nIdx; /* Number of entries in aIdx[] */ - int aIdx[1]; /* Offsets into aPoslist for current row */ + int aIdx[FLEXARRAY]; /* Offsets into aPoslist for current row */ }; +/* Size (int bytes) of an Fts5Sorter object with N indexes */ +#define SZ_FTS5SORTER(N) (offsetof(Fts5Sorter,nIdx)+((N+2)/2)*sizeof(i64)) /* ** Virtual-table cursor object. @@ -253349,7 +254755,7 @@ static int fts5CursorFirstSorted( const char *zRankArgs = pCsr->zRankArgs; nPhrase = sqlite3Fts5ExprPhraseCount(pCsr->pExpr); - nByte = sizeof(Fts5Sorter) + sizeof(int) * (nPhrase-1); + nByte = SZ_FTS5SORTER(nPhrase); pSorter = (Fts5Sorter*)sqlite3_malloc64(nByte); if( pSorter==0 ) return SQLITE_NOMEM; memset(pSorter, 0, (size_t)nByte); @@ -255875,7 +257281,7 @@ static void fts5SourceIdFunc( ){ assert( nArg==0 ); UNUSED_PARAM2(nArg, apUnused); - sqlite3_result_text(pCtx, "fts5: 2025-02-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70", -1, SQLITE_TRANSIENT); + sqlite3_result_text(pCtx, "fts5: 2025-07-17 13:25:10 3ce993b8657d6d9deda380a93cdd6404a8c8ba1b185b2bc423703e41ae5f2543", -1, SQLITE_TRANSIENT); } /* @@ -256100,8 +257506,8 @@ static int fts5Init(sqlite3 *db){ ** its entry point to enable the matchinfo() demo. */ #ifdef SQLITE_FTS5_ENABLE_TEST_MI if( rc==SQLITE_OK ){ - extern int sqlite3Fts5TestRegisterMatchinfo(sqlite3*); - rc = sqlite3Fts5TestRegisterMatchinfo(db); + extern int sqlite3Fts5TestRegisterMatchinfoAPI(fts5_api*); + rc = sqlite3Fts5TestRegisterMatchinfoAPI(&pGlobal->api); } #endif @@ -256690,6 +258096,7 @@ static int fts5StorageDeleteFromIndex( for(iCol=1; rc==SQLITE_OK && iCol<=pConfig->nCol; iCol++){ if( pConfig->abUnindexed[iCol-1]==0 ){ sqlite3_value *pVal = 0; + sqlite3_value *pFree = 0; const char *pText = 0; int nText = 0; const char *pLoc = 0; @@ -256706,11 +258113,22 @@ static int fts5StorageDeleteFromIndex( if( pConfig->bLocale && sqlite3Fts5IsLocaleValue(pConfig, pVal) ){ rc = sqlite3Fts5DecodeLocaleValue(pVal, &pText, &nText, &pLoc, &nLoc); }else{ - pText = (const char*)sqlite3_value_text(pVal); - nText = sqlite3_value_bytes(pVal); - if( pConfig->bLocale && pSeek ){ - pLoc = (const char*)sqlite3_column_text(pSeek, iCol + pConfig->nCol); - nLoc = sqlite3_column_bytes(pSeek, iCol + pConfig->nCol); + if( sqlite3_value_type(pVal)!=SQLITE_TEXT ){ + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + pFree = pVal = sqlite3_value_dup(pVal); + if( pVal==0 ){ + rc = SQLITE_NOMEM; + } + } + if( rc==SQLITE_OK ){ + pText = (const char*)sqlite3_value_text(pVal); + nText = sqlite3_value_bytes(pVal); + if( pConfig->bLocale && pSeek ){ + pLoc = (const char*)sqlite3_column_text(pSeek, iCol+pConfig->nCol); + nLoc = sqlite3_column_bytes(pSeek, iCol + pConfig->nCol); + } } } @@ -256726,6 +258144,7 @@ static int fts5StorageDeleteFromIndex( } sqlite3Fts5ClearLocale(pConfig); } + sqlite3_value_free(pFree); } } if( rc==SQLITE_OK && p->nTotalRow<1 ){ @@ -259939,7 +261358,6 @@ static void sqlite3Fts5UnicodeAscii(u8 *aArray, u8 *aAscii){ aAscii[0] = 0; /* 0x00 is never a token character */ } - /* ** 2015 May 30 ** @@ -260480,12 +261898,12 @@ static int fts5VocabInitVtab( *pzErr = sqlite3_mprintf("wrong number of vtable arguments"); rc = SQLITE_ERROR; }else{ - int nByte; /* Bytes of space to allocate */ + i64 nByte; /* Bytes of space to allocate */ const char *zDb = bDb ? argv[3] : argv[1]; const char *zTab = bDb ? argv[4] : argv[3]; const char *zType = bDb ? argv[5] : argv[4]; - int nDb = (int)strlen(zDb)+1; - int nTab = (int)strlen(zTab)+1; + i64 nDb = strlen(zDb)+1; + i64 nTab = strlen(zTab)+1; int eType = 0; rc = fts5VocabTableType(zType, pzErr, &eType); diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h b/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h index 5e07ce68..d65d949a 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h @@ -134,7 +134,7 @@ extern "C" { ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -147,9 +147,9 @@ extern "C" { ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION "3.49.1" -#define SQLITE_VERSION_NUMBER 3049001 -#define SQLITE_SOURCE_ID "2025-02-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70" +#define SQLITE_VERSION "3.50.3" +#define SQLITE_VERSION_NUMBER 3050003 +#define SQLITE_SOURCE_ID "2025-07-17 13:25:10 3ce993b8657d6d9deda380a93cdd6404a8c8ba1b185b2bc423703e41ae5f2543" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -1164,6 +1164,12 @@ struct sqlite3_io_methods { ** the value that M is to be set to. Before returning, the 32-bit signed ** integer is overwritten with the previous value of M. ** +**
        • [[SQLITE_FCNTL_BLOCK_ON_CONNECT]] +** The [SQLITE_FCNTL_BLOCK_ON_CONNECT] opcode is used to configure the +** VFS to block when taking a SHARED lock to connect to a wal mode database. +** This is used to implement the functionality associated with +** SQLITE_SETLK_BLOCK_ON_CONNECT. +** **
        • [[SQLITE_FCNTL_DATA_VERSION]] ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to ** a database file. The argument is a pointer to a 32-bit unsigned integer. @@ -1260,6 +1266,7 @@ struct sqlite3_io_methods { #define SQLITE_FCNTL_CKSM_FILE 41 #define SQLITE_FCNTL_RESET_CACHE 42 #define SQLITE_FCNTL_NULL_IO 43 +#define SQLITE_FCNTL_BLOCK_ON_CONNECT 44 /* deprecated names */ #define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE @@ -1990,13 +1997,16 @@ struct sqlite3_mem_methods { ** ** [[SQLITE_CONFIG_LOOKASIDE]]
          SQLITE_CONFIG_LOOKASIDE
          **
          ^(The SQLITE_CONFIG_LOOKASIDE option takes two arguments that determine -** the default size of lookaside memory on each [database connection]. +** the default size of [lookaside memory] on each [database connection]. ** The first argument is the -** size of each lookaside buffer slot and the second is the number of -** slots allocated to each database connection.)^ ^(SQLITE_CONFIG_LOOKASIDE -** sets the default lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE] -** option to [sqlite3_db_config()] can be used to change the lookaside -** configuration on individual connections.)^
          +** size of each lookaside buffer slot ("sz") and the second is the number of +** slots allocated to each database connection ("cnt").)^ +** ^(SQLITE_CONFIG_LOOKASIDE sets the default lookaside size. +** The [SQLITE_DBCONFIG_LOOKASIDE] option to [sqlite3_db_config()] can +** be used to change the lookaside configuration on individual connections.)^ +** The [-DSQLITE_DEFAULT_LOOKASIDE] option can be used to change the +** default lookaside configuration at compile-time. +**
        • ** ** [[SQLITE_CONFIG_PCACHE2]]
          SQLITE_CONFIG_PCACHE2
          **
          ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is @@ -2233,31 +2243,50 @@ struct sqlite3_mem_methods { ** [[SQLITE_DBCONFIG_LOOKASIDE]] **
          SQLITE_DBCONFIG_LOOKASIDE
          **
          The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the -** configuration of the lookaside memory allocator within a database +** configuration of the [lookaside memory allocator] within a database ** connection. ** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are not ** in the [DBCONFIG arguments|usual format]. ** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two, ** so that a call to [sqlite3_db_config()] that uses SQLITE_DBCONFIG_LOOKASIDE ** should have a total of five parameters. -** ^The first argument (the third parameter to [sqlite3_db_config()] is a +**
            +**
          1. The first argument ("buf") is a ** pointer to a memory buffer to use for lookaside memory. -** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb -** may be NULL in which case SQLite will allocate the -** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the -** size of each lookaside buffer slot. ^The third argument is the number of -** slots. The size of the buffer in the first argument must be greater than -** or equal to the product of the second and third arguments. The buffer -** must be aligned to an 8-byte boundary. ^If the second argument to -** SQLITE_DBCONFIG_LOOKASIDE is not a multiple of 8, it is internally -** rounded down to the next smaller multiple of 8. ^(The lookaside memory +** The first argument may be NULL in which case SQLite will allocate the +** lookaside buffer itself using [sqlite3_malloc()]. +**

          2. The second argument ("sz") is the +** size of each lookaside buffer slot. Lookaside is disabled if "sz" +** is less than 8. The "sz" argument should be a multiple of 8 less than +** 65536. If "sz" does not meet this constraint, it is reduced in size until +** it does. +**

          3. The third argument ("cnt") is the number of slots. Lookaside is disabled +** if "cnt"is less than 1. The "cnt" value will be reduced, if necessary, so +** that the product of "sz" and "cnt" does not exceed 2,147,418,112. The "cnt" +** parameter is usually chosen so that the product of "sz" and "cnt" is less +** than 1,000,000. +**

          +**

          If the "buf" argument is not NULL, then it must +** point to a memory buffer with a size that is greater than +** or equal to the product of "sz" and "cnt". +** The buffer must be aligned to an 8-byte boundary. +** The lookaside memory ** configuration for a database connection can only be changed when that ** connection is not currently using lookaside memory, or in other words -** when the "current value" returned by -** [sqlite3_db_status](D,[SQLITE_DBSTATUS_LOOKASIDE_USED],...) is zero. +** when the value returned by [SQLITE_DBSTATUS_LOOKASIDE_USED] is zero. ** Any attempt to change the lookaside memory configuration when lookaside ** memory is in use leaves the configuration unchanged and returns -** [SQLITE_BUSY].)^

          +** [SQLITE_BUSY]. +** If the "buf" argument is NULL and an attempt +** to allocate memory based on "sz" and "cnt" fails, then +** lookaside is silently disabled. +**

          +** The [SQLITE_CONFIG_LOOKASIDE] configuration option can be used to set the +** default lookaside configuration at initialization. The +** [-DSQLITE_DEFAULT_LOOKASIDE] option can be used to set the default lookaside +** configuration at compile-time. Typical values for lookaside are 1200 for +** "sz" and 40 to 100 for "cnt". +** ** ** [[SQLITE_DBCONFIG_ENABLE_FKEY]] **

          SQLITE_DBCONFIG_ENABLE_FKEY
          @@ -2994,6 +3023,44 @@ SQLITE_API int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*); */ SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms); +/* +** CAPI3REF: Set the Setlk Timeout +** METHOD: sqlite3 +** +** This routine is only useful in SQLITE_ENABLE_SETLK_TIMEOUT builds. If +** the VFS supports blocking locks, it sets the timeout in ms used by +** eligible locks taken on wal mode databases by the specified database +** handle. In non-SQLITE_ENABLE_SETLK_TIMEOUT builds, or if the VFS does +** not support blocking locks, this function is a no-op. +** +** Passing 0 to this function disables blocking locks altogether. Passing +** -1 to this function requests that the VFS blocks for a long time - +** indefinitely if possible. The results of passing any other negative value +** are undefined. +** +** Internally, each SQLite database handle store two timeout values - the +** busy-timeout (used for rollback mode databases, or if the VFS does not +** support blocking locks) and the setlk-timeout (used for blocking locks +** on wal-mode databases). The sqlite3_busy_timeout() method sets both +** values, this function sets only the setlk-timeout value. Therefore, +** to configure separate busy-timeout and setlk-timeout values for a single +** database handle, call sqlite3_busy_timeout() followed by this function. +** +** Whenever the number of connections to a wal mode database falls from +** 1 to 0, the last connection takes an exclusive lock on the database, +** then checkpoints and deletes the wal file. While it is doing this, any +** new connection that tries to read from the database fails with an +** SQLITE_BUSY error. Or, if the SQLITE_SETLK_BLOCK_ON_CONNECT flag is +** passed to this API, the new connection blocks until the exclusive lock +** has been released. +*/ +SQLITE_API int sqlite3_setlk_timeout(sqlite3*, int ms, int flags); + +/* +** CAPI3REF: Flags for sqlite3_setlk_timeout() +*/ +#define SQLITE_SETLK_BLOCK_ON_CONNECT 0x01 + /* ** CAPI3REF: Convenience Routines For Running Queries ** METHOD: sqlite3 @@ -4013,7 +4080,7 @@ SQLITE_API sqlite3_file *sqlite3_database_file_object(const char*); ** ** The sqlite3_create_filename(D,J,W,N,P) allocates memory to hold a version of ** database filename D with corresponding journal file J and WAL file W and -** with N URI parameters key/values pairs in the array P. The result from +** an array P of N URI Key/Value pairs. The result from ** sqlite3_create_filename(D,J,W,N,P) is a pointer to a database filename that ** is safe to pass to routines like: **
            @@ -4694,7 +4761,7 @@ typedef struct sqlite3_context sqlite3_context; ** METHOD: sqlite3_stmt ** ** ^(In the SQL statement text input to [sqlite3_prepare_v2()] and its variants, -** literals may be replaced by a [parameter] that matches one of following +** literals may be replaced by a [parameter] that matches one of the following ** templates: ** **
              @@ -4739,7 +4806,7 @@ typedef struct sqlite3_context sqlite3_context; ** ** [[byte-order determination rules]] ^The byte-order of ** UTF16 input text is determined by the byte-order mark (BOM, U+FEFF) -** found in first character, which is removed, or in the absence of a BOM +** found in the first character, which is removed, or in the absence of a BOM ** the byte order is the native byte order of the host ** machine for sqlite3_bind_text16() or the byte order specified in ** the 6th parameter for sqlite3_bind_text64().)^ @@ -4759,7 +4826,7 @@ typedef struct sqlite3_context sqlite3_context; ** or sqlite3_bind_text16() or sqlite3_bind_text64() then ** that parameter must be the byte offset ** where the NUL terminator would occur assuming the string were NUL -** terminated. If any NUL characters occurs at byte offsets less than +** terminated. If any NUL characters occur at byte offsets less than ** the value of the fourth parameter then the resulting string value will ** contain embedded NULs. The result of expressions involving strings ** with embedded NULs is undefined. @@ -4971,7 +5038,7 @@ SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt*, int N); ** METHOD: sqlite3_stmt ** ** ^These routines provide a means to determine the database, table, and -** table column that is the origin of a particular result column in +** table column that is the origin of a particular result column in a ** [SELECT] statement. ** ^The name of the database or table or column can be returned as ** either a UTF-8 or UTF-16 string. ^The _database_ routines return @@ -5109,7 +5176,7 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int); ** other than [SQLITE_ROW] before any subsequent invocation of ** sqlite3_step(). Failure to reset the prepared statement using ** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from -** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1], +** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1]), ** sqlite3_step() began ** calling [sqlite3_reset()] automatically in this circumstance rather ** than returning [SQLITE_MISUSE]. This is not considered a compatibility @@ -5540,8 +5607,8 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** ** For best security, the [SQLITE_DIRECTONLY] flag is recommended for ** all application-defined SQL functions that do not need to be -** used inside of triggers, view, CHECK constraints, or other elements of -** the database schema. This flags is especially recommended for SQL +** used inside of triggers, views, CHECK constraints, or other elements of +** the database schema. This flag is especially recommended for SQL ** functions that have side effects or reveal internal application state. ** Without this flag, an attacker might be able to modify the schema of ** a database file to include invocations of the function with parameters @@ -5572,7 +5639,7 @@ SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt); ** [user-defined window functions|available here]. ** ** ^(If the final parameter to sqlite3_create_function_v2() or -** sqlite3_create_window_function() is not NULL, then it is destructor for +** sqlite3_create_window_function() is not NULL, then it is the destructor for ** the application data pointer. The destructor is invoked when the function ** is deleted, either by being overloaded or when the database connection ** closes.)^ ^The destructor is also invoked if the call to @@ -5972,7 +6039,7 @@ SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value*); ** METHOD: sqlite3_value ** ** ^The sqlite3_value_dup(V) interface makes a copy of the [sqlite3_value] -** object D and returns a pointer to that copy. ^The [sqlite3_value] returned +** object V and returns a pointer to that copy. ^The [sqlite3_value] returned ** is a [protected sqlite3_value] object even if the input is not. ** ^The sqlite3_value_dup(V) interface returns NULL if V is NULL or if a ** memory allocation fails. ^If V is a [pointer value], then the result @@ -6010,7 +6077,7 @@ SQLITE_API void sqlite3_value_free(sqlite3_value*); ** allocation error occurs. ** ** ^(The amount of space allocated by sqlite3_aggregate_context(C,N) is -** determined by the N parameter on first successful call. Changing the +** determined by the N parameter on the first successful call. Changing the ** value of N in any subsequent call to sqlite3_aggregate_context() within ** the same aggregate function instance will not resize the memory ** allocation.)^ Within the xFinal callback, it is customary to set @@ -6172,7 +6239,7 @@ SQLITE_API void sqlite3_set_auxdata(sqlite3_context*, int N, void*, void (*)(voi ** ** Security Warning: These interfaces should not be exposed in scripting ** languages or in other circumstances where it might be possible for an -** an attacker to invoke them. Any agent that can invoke these interfaces +** attacker to invoke them. Any agent that can invoke these interfaces ** can probably also take control of the process. ** ** Database connection client data is only available for SQLite @@ -6286,7 +6353,7 @@ typedef void (*sqlite3_destructor_type)(void*); ** pointed to by the 2nd parameter are taken as the application-defined ** function result. If the 3rd parameter is non-negative, then it ** must be the byte offset into the string where the NUL terminator would -** appear if the string where NUL terminated. If any NUL characters occur +** appear if the string were NUL terminated. If any NUL characters occur ** in the string at a byte offset that is less than the value of the 3rd ** parameter, then the resulting string will contain embedded NULs and the ** result of expressions operating on strings with embedded NULs is undefined. @@ -6344,7 +6411,7 @@ typedef void (*sqlite3_destructor_type)(void*); ** string and preferably a string literal. The sqlite3_result_pointer() ** routine is part of the [pointer passing interface] added for SQLite 3.20.0. ** -** If these routines are called from within the different thread +** If these routines are called from within a different thread ** than the one containing the application-defined function that received ** the [sqlite3_context] pointer, the results are undefined. */ @@ -6750,7 +6817,7 @@ SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt*); ** METHOD: sqlite3 ** ** ^The sqlite3_db_name(D,N) interface returns a pointer to the schema name -** for the N-th database on database connection D, or a NULL pointer of N is +** for the N-th database on database connection D, or a NULL pointer if N is ** out of range. An N value of 0 means the main database file. An N of 1 is ** the "temp" schema. Larger values of N correspond to various ATTACH-ed ** databases. @@ -6845,7 +6912,7 @@ SQLITE_API int sqlite3_txn_state(sqlite3*,const char *zSchema); **
              The SQLITE_TXN_READ state means that the database is currently ** in a read transaction. Content has been read from the database file ** but nothing in the database file has changed. The transaction state -** will advanced to SQLITE_TXN_WRITE if any changes occur and there are +** will be advanced to SQLITE_TXN_WRITE if any changes occur and there are ** no other conflicting concurrent write transactions. The transaction ** state will revert to SQLITE_TXN_NONE following a [ROLLBACK] or ** [COMMIT].
              @@ -6854,7 +6921,7 @@ SQLITE_API int sqlite3_txn_state(sqlite3*,const char *zSchema); **
              The SQLITE_TXN_WRITE state means that the database is currently ** in a write transaction. Content has been written to the database file ** but has not yet committed. The transaction state will change to -** to SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT].
              +** SQLITE_TXN_NONE at the next [ROLLBACK] or [COMMIT]. */ #define SQLITE_TXN_NONE 0 #define SQLITE_TXN_READ 1 @@ -7005,6 +7072,8 @@ SQLITE_API int sqlite3_autovacuum_pages( ** ** ^The second argument is a pointer to the function to invoke when a ** row is updated, inserted or deleted in a rowid table. +** ^The update hook is disabled by invoking sqlite3_update_hook() +** with a NULL pointer as the second parameter. ** ^The first argument to the callback is a copy of the third argument ** to sqlite3_update_hook(). ** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], @@ -7133,7 +7202,7 @@ SQLITE_API int sqlite3_db_release_memory(sqlite3*); ** CAPI3REF: Impose A Limit On Heap Size ** ** These interfaces impose limits on the amount of heap memory that will be -** by all database connections within a single process. +** used by all database connections within a single process. ** ** ^The sqlite3_soft_heap_limit64() interface sets and/or queries the ** soft limit on the amount of heap memory that may be allocated by SQLite. @@ -7191,7 +7260,7 @@ SQLITE_API int sqlite3_db_release_memory(sqlite3*); **
            )^ ** ** The circumstances under which SQLite will enforce the heap limits may -** changes in future releases of SQLite. +** change in future releases of SQLite. */ SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N); SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64(sqlite3_int64 N); @@ -7306,8 +7375,8 @@ SQLITE_API int sqlite3_table_column_metadata( ** ^The entry point is zProc. ** ^(zProc may be 0, in which case SQLite will try to come up with an ** entry point name on its own. It first tries "sqlite3_extension_init". -** If that does not work, it constructs a name "sqlite3_X_init" where the -** X is consists of the lower-case equivalent of all ASCII alphabetic +** If that does not work, it constructs a name "sqlite3_X_init" where +** X consists of the lower-case equivalent of all ASCII alphabetic ** characters in the filename from the last "/" to the first following ** "." and omitting any initial "lib".)^ ** ^The sqlite3_load_extension() interface returns @@ -7378,7 +7447,7 @@ SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff); ** ^(Even though the function prototype shows that xEntryPoint() takes ** no arguments and returns void, SQLite invokes xEntryPoint() with three ** arguments and expects an integer result as if the signature of the -** entry point where as follows: +** entry point were as follows: ** **
             **    int xEntryPoint(
            @@ -7542,7 +7611,7 @@ struct sqlite3_module {
             ** virtual table and might not be checked again by the byte code.)^ ^(The
             ** aConstraintUsage[].omit flag is an optimization hint. When the omit flag
             ** is left in its default setting of false, the constraint will always be
            -** checked separately in byte code.  If the omit flag is change to true, then
            +** checked separately in byte code.  If the omit flag is changed to true, then
             ** the constraint may or may not be checked in byte code.  In other words,
             ** when the omit flag is true there is no guarantee that the constraint will
             ** not be checked again using byte code.)^
            @@ -7568,7 +7637,7 @@ struct sqlite3_module {
             ** The xBestIndex method may optionally populate the idxFlags field with a
             ** mask of SQLITE_INDEX_SCAN_* flags. One such flag is
             ** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN]
            -** output to show the idxNum has hex instead of as decimal.  Another flag is
            +** output to show the idxNum as hex instead of as decimal.  Another flag is
             ** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will
             ** return at most one row.
             **
            @@ -7709,7 +7778,7 @@ struct sqlite3_index_info {
             ** the implementation of the [virtual table module].   ^The fourth
             ** parameter is an arbitrary client data pointer that is passed through
             ** into the [xCreate] and [xConnect] methods of the virtual table module
            -** when a new virtual table is be being created or reinitialized.
            +** when a new virtual table is being created or reinitialized.
             **
             ** ^The sqlite3_create_module_v2() interface has a fifth parameter which
             ** is a pointer to a destructor for the pClientData.  ^SQLite will
            @@ -7874,7 +7943,7 @@ typedef struct sqlite3_blob sqlite3_blob;
             ** in *ppBlob. Otherwise an [error code] is returned and, unless the error
             ** code is SQLITE_MISUSE, *ppBlob is set to NULL.)^ ^This means that, provided
             ** the API is not misused, it is always safe to call [sqlite3_blob_close()]
            -** on *ppBlob after this function it returns.
            +** on *ppBlob after this function returns.
             **
             ** This function fails with SQLITE_ERROR if any of the following are true:
             ** 
              @@ -7994,7 +8063,7 @@ SQLITE_API int sqlite3_blob_close(sqlite3_blob *); ** ** ^Returns the size in bytes of the BLOB accessible via the ** successfully opened [BLOB handle] in its only argument. ^The -** incremental blob I/O routines can only read or overwriting existing +** incremental blob I/O routines can only read or overwrite existing ** blob content; they cannot change the size of a blob. ** ** This routine only works on a [BLOB handle] which has been created @@ -8144,7 +8213,7 @@ SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs*); ** ^The sqlite3_mutex_alloc() routine allocates a new ** mutex and returns a pointer to it. ^The sqlite3_mutex_alloc() ** routine returns NULL if it is unable to allocate the requested -** mutex. The argument to sqlite3_mutex_alloc() must one of these +** mutex. The argument to sqlite3_mutex_alloc() must be one of these ** integer constants: ** **
                @@ -8377,7 +8446,7 @@ SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*); ** CAPI3REF: Retrieve the mutex for a database connection ** METHOD: sqlite3 ** -** ^This interface returns a pointer the [sqlite3_mutex] object that +** ^This interface returns a pointer to the [sqlite3_mutex] object that ** serializes access to the [database connection] given in the argument ** when the [threading mode] is Serialized. ** ^If the [threading mode] is Single-thread or Multi-thread then this @@ -8500,7 +8569,7 @@ SQLITE_API int sqlite3_test_control(int op, ...); ** CAPI3REF: SQL Keyword Checking ** ** These routines provide access to the set of SQL language keywords -** recognized by SQLite. Applications can uses these routines to determine +** recognized by SQLite. Applications can use these routines to determine ** whether or not a specific identifier needs to be escaped (for example, ** by enclosing in double-quotes) so as not to confuse the parser. ** @@ -8668,7 +8737,7 @@ SQLITE_API void sqlite3_str_reset(sqlite3_str*); ** content of the dynamic string under construction in X. The value ** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X ** and might be freed or altered by any subsequent method on the same -** [sqlite3_str] object. Applications must not used the pointer returned +** [sqlite3_str] object. Applications must not use the pointer returned by ** [sqlite3_str_value(X)] after any subsequent method call on the same ** object. ^Applications may change the content of the string returned ** by [sqlite3_str_value(X)] as long as they do not write into any bytes @@ -8754,7 +8823,7 @@ SQLITE_API int sqlite3_status64( ** allocation which could not be satisfied by the [SQLITE_CONFIG_PAGECACHE] ** buffer and where forced to overflow to [sqlite3_malloc()]. The ** returned value includes allocations that overflowed because they -** where too large (they were larger than the "sz" parameter to +** were too large (they were larger than the "sz" parameter to ** [SQLITE_CONFIG_PAGECACHE]) and allocations that overflowed because ** no space was left in the page cache.)^ ** @@ -8838,28 +8907,29 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** [[SQLITE_DBSTATUS_LOOKASIDE_HIT]] ^(
                SQLITE_DBSTATUS_LOOKASIDE_HIT
                **
                This parameter returns the number of malloc attempts that were ** satisfied using lookaside memory. Only the high-water value is meaningful; -** the current value is always zero.)^ +** the current value is always zero.
                )^ ** ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE]] ** ^(
                SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE
                -**
                This parameter returns the number malloc attempts that might have +**
                This parameter returns the number of malloc attempts that might have ** been satisfied using lookaside memory but failed due to the amount of ** memory requested being larger than the lookaside slot size. ** Only the high-water value is meaningful; -** the current value is always zero.)^ +** the current value is always zero.
                )^ ** ** [[SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL]] ** ^(
                SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL
                -**
                This parameter returns the number malloc attempts that might have +**
                This parameter returns the number of malloc attempts that might have ** been satisfied using lookaside memory but failed due to all lookaside ** memory already being in use. ** Only the high-water value is meaningful; -** the current value is always zero.)^ +** the current value is always zero.
                )^ ** ** [[SQLITE_DBSTATUS_CACHE_USED]] ^(
                SQLITE_DBSTATUS_CACHE_USED
                **
                This parameter returns the approximate number of bytes of heap ** memory used by all pager caches associated with the database connection.)^ ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0. +**
                ** ** [[SQLITE_DBSTATUS_CACHE_USED_SHARED]] ** ^(
                SQLITE_DBSTATUS_CACHE_USED_SHARED
                @@ -8868,10 +8938,10 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** memory used by that pager cache is divided evenly between the attached ** connections.)^ In other words, if none of the pager caches associated ** with the database connection are shared, this request returns the same -** value as DBSTATUS_CACHE_USED. Or, if one or more or the pager caches are +** value as DBSTATUS_CACHE_USED. Or, if one or more of the pager caches are ** shared, the value returned by this call will be smaller than that returned ** by DBSTATUS_CACHE_USED. ^The highwater mark associated with -** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0. +** SQLITE_DBSTATUS_CACHE_USED_SHARED is always 0. ** ** [[SQLITE_DBSTATUS_SCHEMA_USED]] ^(
                SQLITE_DBSTATUS_SCHEMA_USED
                **
                This parameter returns the approximate number of bytes of heap @@ -8881,6 +8951,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** schema memory is shared with other database connections due to ** [shared cache mode] being enabled. ** ^The highwater mark associated with SQLITE_DBSTATUS_SCHEMA_USED is always 0. +**
                ** ** [[SQLITE_DBSTATUS_STMT_USED]] ^(
                SQLITE_DBSTATUS_STMT_USED
                **
                This parameter returns the approximate number of bytes of heap @@ -8917,7 +8988,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r ** been written to disk in the middle of a transaction due to the page ** cache overflowing. Transactions are more efficient if they are written ** to disk all at once. When pages spill mid-transaction, that introduces -** additional overhead. This parameter can be used help identify +** additional overhead. This parameter can be used to help identify ** inefficiencies that can be resolved by increasing the cache size. **
                ** @@ -8988,13 +9059,13 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** [[SQLITE_STMTSTATUS_SORT]]
                SQLITE_STMTSTATUS_SORT
                **
                ^This is the number of sort operations that have occurred. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance through careful use of indices.
                +** improve performance through careful use of indices. ** ** [[SQLITE_STMTSTATUS_AUTOINDEX]]
                SQLITE_STMTSTATUS_AUTOINDEX
                **
                ^This is the number of rows inserted into transient indices that ** were created automatically in order to help joins run faster. ** A non-zero value in this counter may indicate an opportunity to -** improvement performance by adding permanent indices that do not +** improve performance by adding permanent indices that do not ** need to be reinitialized each time the statement is run.
                ** ** [[SQLITE_STMTSTATUS_VM_STEP]]
                SQLITE_STMTSTATUS_VM_STEP
                @@ -9003,19 +9074,19 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** to 2147483647. The number of virtual machine operations can be ** used as a proxy for the total work done by the prepared statement. ** If the number of virtual machine operations exceeds 2147483647 -** then the value returned by this statement status code is undefined. +** then the value returned by this statement status code is undefined. ** ** [[SQLITE_STMTSTATUS_REPREPARE]]
                SQLITE_STMTSTATUS_REPREPARE
                **
                ^This is the number of times that the prepare statement has been ** automatically regenerated due to schema changes or changes to -** [bound parameters] that might affect the query plan. +** [bound parameters] that might affect the query plan.
                ** ** [[SQLITE_STMTSTATUS_RUN]]
                SQLITE_STMTSTATUS_RUN
                **
                ^This is the number of times that the prepared statement has ** been run. A single "run" for the purposes of this counter is one ** or more calls to [sqlite3_step()] followed by a call to [sqlite3_reset()]. ** The counter is incremented on the first [sqlite3_step()] call of each -** cycle. +** cycle.
                ** ** [[SQLITE_STMTSTATUS_FILTER_MISS]] ** [[SQLITE_STMTSTATUS_FILTER HIT]] @@ -9025,7 +9096,7 @@ SQLITE_API int sqlite3_stmt_status(sqlite3_stmt*, int op,int resetFlg); ** step was bypassed because a Bloom filter returned not-found. The ** corresponding SQLITE_STMTSTATUS_FILTER_MISS value is the number of ** times that the Bloom filter returned a find, and thus the join step -** had to be processed as normal. +** had to be processed as normal. ** ** [[SQLITE_STMTSTATUS_MEMUSED]]
                SQLITE_STMTSTATUS_MEMUSED
                **
                ^This is the approximate number of bytes of heap memory @@ -9130,9 +9201,9 @@ struct sqlite3_pcache_page { ** SQLite will typically create one cache instance for each open database file, ** though this is not guaranteed. ^The ** first parameter, szPage, is the size in bytes of the pages that must -** be allocated by the cache. ^szPage will always a power of two. ^The +** be allocated by the cache. ^szPage will always be a power of two. ^The ** second parameter szExtra is a number of bytes of extra storage -** associated with each page cache entry. ^The szExtra parameter will +** associated with each page cache entry. ^The szExtra parameter will be ** a number less than 250. SQLite will use the ** extra szExtra bytes on each page to store metadata about the underlying ** database page on disk. The value passed into szExtra depends @@ -9140,17 +9211,17 @@ struct sqlite3_pcache_page { ** ^The third argument to xCreate(), bPurgeable, is true if the cache being ** created will be used to cache database pages of a file stored on disk, or ** false if it is used for an in-memory database. The cache implementation -** does not have to do anything special based with the value of bPurgeable; +** does not have to do anything special based upon the value of bPurgeable; ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will ** never invoke xUnpin() except to deliberately delete a page. ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to ** false will always have the "discard" flag set to true. -** ^Hence, a cache created with bPurgeable false will +** ^Hence, a cache created with bPurgeable set to false will ** never contain any unpinned pages. ** ** [[the xCachesize() page cache method]] ** ^(The xCachesize() method may be called at any time by SQLite to set the -** suggested maximum cache-size (number of pages stored by) the cache +** suggested maximum cache-size (number of pages stored) for the cache ** instance passed as the first argument. This is the value configured using ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable ** parameter, the implementation is not required to do anything with this @@ -9177,12 +9248,12 @@ struct sqlite3_pcache_page { ** implementation must return a pointer to the page buffer with its content ** intact. If the requested page is not already in the cache, then the ** cache implementation should use the value of the createFlag -** parameter to help it determined what action to take: +** parameter to help it determine what action to take: ** ** **
                createFlag Behavior when page is not already in cache **
                0 Do not allocate a new page. Return NULL. -**
                1 Allocate a new page if it easy and convenient to do so. +**
                1 Allocate a new page if it is easy and convenient to do so. ** Otherwise return NULL. **
                2 Make every effort to allocate a new page. Only return ** NULL if allocating a new page is effectively impossible. @@ -9199,7 +9270,7 @@ struct sqlite3_pcache_page { ** as its second argument. If the third parameter, discard, is non-zero, ** then the page must be evicted from the cache. ** ^If the discard parameter is -** zero, then the page may be discarded or retained at the discretion of +** zero, then the page may be discarded or retained at the discretion of the ** page cache implementation. ^The page cache implementation ** may choose to evict unpinned pages at any time. ** @@ -9217,7 +9288,7 @@ struct sqlite3_pcache_page { ** When SQLite calls the xTruncate() method, the cache must discard all ** existing cache entries with page numbers (keys) greater than or equal ** to the value of the iLimit parameter passed to xTruncate(). If any -** of these pages are pinned, they are implicitly unpinned, meaning that +** of these pages are pinned, they become implicitly unpinned, meaning that ** they can be safely discarded. ** ** [[the xDestroy() page cache method]] @@ -9397,7 +9468,7 @@ typedef struct sqlite3_backup sqlite3_backup; ** external process or via a database connection other than the one being ** used by the backup operation, then the backup will be automatically ** restarted by the next call to sqlite3_backup_step(). ^If the source -** database is modified by the using the same database connection as is used +** database is modified by using the same database connection as is used ** by the backup operation, then the backup database is automatically ** updated at the same time. ** @@ -9414,7 +9485,7 @@ typedef struct sqlite3_backup sqlite3_backup; ** and may not be used following a call to sqlite3_backup_finish(). ** ** ^The value returned by sqlite3_backup_finish is [SQLITE_OK] if no -** sqlite3_backup_step() errors occurred, regardless or whether or not +** sqlite3_backup_step() errors occurred, regardless of whether or not ** sqlite3_backup_step() completed. ** ^If an out-of-memory condition or IO error occurred during any prior ** sqlite3_backup_step() call on the same [sqlite3_backup] object, then @@ -9516,7 +9587,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** application receives an SQLITE_LOCKED error, it may call the ** sqlite3_unlock_notify() method with the blocked connection handle as ** the first argument to register for a callback that will be invoked -** when the blocking connections current transaction is concluded. ^The +** when the blocking connection's current transaction is concluded. ^The ** callback is invoked from within the [sqlite3_step] or [sqlite3_close] ** call that concludes the blocking connection's transaction. ** @@ -9536,7 +9607,7 @@ SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p); ** blocked connection already has a registered unlock-notify callback, ** then the new callback replaces the old.)^ ^If sqlite3_unlock_notify() is ** called with a NULL pointer as its second argument, then any existing -** unlock-notify callback is canceled. ^The blocked connections +** unlock-notify callback is canceled. ^The blocked connection's ** unlock-notify callback may also be canceled by closing the blocked ** connection using [sqlite3_close()]. ** @@ -9934,7 +10005,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** support constraints. In this configuration (which is the default) if ** a call to the [xUpdate] method returns [SQLITE_CONSTRAINT], then the entire ** statement is rolled back as if [ON CONFLICT | OR ABORT] had been -** specified as part of the users SQL statement, regardless of the actual +** specified as part of the user's SQL statement, regardless of the actual ** ON CONFLICT mode specified. ** ** If X is non-zero, then the virtual table implementation guarantees @@ -9968,7 +10039,7 @@ SQLITE_API int sqlite3_vtab_config(sqlite3*, int op, ...); ** [[SQLITE_VTAB_INNOCUOUS]]
                SQLITE_VTAB_INNOCUOUS
                **
                Calls of the form ** [sqlite3_vtab_config](db,SQLITE_VTAB_INNOCUOUS) from within the -** the [xConnect] or [xCreate] methods of a [virtual table] implementation +** [xConnect] or [xCreate] methods of a [virtual table] implementation ** identify that virtual table as being safe to use from within triggers ** and views. Conceptually, the SQLITE_VTAB_INNOCUOUS tag means that the ** virtual table can do no serious harm even if it is controlled by a @@ -10136,7 +10207,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); **
                ** ** ^For the purposes of comparing virtual table output values to see if the -** values are same value for sorting purposes, two NULL values are considered +** values are the same value for sorting purposes, two NULL values are considered ** to be the same. In other words, the comparison operator is "IS" ** (or "IS NOT DISTINCT FROM") and not "==". ** @@ -10146,7 +10217,7 @@ SQLITE_API const char *sqlite3_vtab_collation(sqlite3_index_info*,int); ** ** ^A virtual table implementation is always free to return rows in any order ** it wants, as long as the "orderByConsumed" flag is not set. ^When the -** the "orderByConsumed" flag is unset, the query planner will add extra +** "orderByConsumed" flag is unset, the query planner will add extra ** [bytecode] to ensure that the final results returned by the SQL query are ** ordered correctly. The use of the "orderByConsumed" flag and the ** sqlite3_vtab_distinct() interface is merely an optimization. ^Careful @@ -10243,7 +10314,7 @@ SQLITE_API int sqlite3_vtab_in(sqlite3_index_info*, int iCons, int bHandle); ** sqlite3_vtab_in_next(X,P) should be one of the parameters to the ** xFilter method which invokes these routines, and specifically ** a parameter that was previously selected for all-at-once IN constraint -** processing use the [sqlite3_vtab_in()] interface in the +** processing using the [sqlite3_vtab_in()] interface in the ** [xBestIndex|xBestIndex method]. ^(If the X parameter is not ** an xFilter argument that was selected for all-at-once IN constraint ** processing, then these routines return [SQLITE_ERROR].)^ @@ -10298,7 +10369,7 @@ SQLITE_API int sqlite3_vtab_in_next(sqlite3_value *pVal, sqlite3_value **ppOut); ** and only if *V is set to a value. ^The sqlite3_vtab_rhs_value(P,J,V) ** inteface returns SQLITE_NOTFOUND if the right-hand side of the J-th ** constraint is not available. ^The sqlite3_vtab_rhs_value() interface -** can return an result code other than SQLITE_OK or SQLITE_NOTFOUND if +** can return a result code other than SQLITE_OK or SQLITE_NOTFOUND if ** something goes wrong. ** ** The sqlite3_vtab_rhs_value() interface is usually only successful if @@ -10326,8 +10397,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** KEYWORDS: {conflict resolution mode} ** ** These constants are returned by [sqlite3_vtab_on_conflict()] to -** inform a [virtual table] implementation what the [ON CONFLICT] mode -** is for the SQL statement being evaluated. +** inform a [virtual table] implementation of the [ON CONFLICT] mode +** for the SQL statement being evaluated. ** ** Note that the [SQLITE_IGNORE] constant is also used as a potential ** return value from the [sqlite3_set_authorizer()] callback and that @@ -10367,39 +10438,39 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** [[SQLITE_SCANSTAT_EST]]
                SQLITE_SCANSTAT_EST
                **
                ^The "double" variable pointed to by the V parameter will be set to the ** query planner's estimate for the average number of rows output from each -** iteration of the X-th loop. If the query planner's estimates was accurate, +** iteration of the X-th loop. If the query planner's estimate was accurate, ** then this value will approximate the quotient NVISIT/NLOOP and the ** product of this value for all prior loops with the same SELECTID will -** be the NLOOP value for the current loop. +** be the NLOOP value for the current loop.
                ** ** [[SQLITE_SCANSTAT_NAME]]
                SQLITE_SCANSTAT_NAME
                **
                ^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the name of the index or table -** used for the X-th loop. +** used for the X-th loop.
                ** ** [[SQLITE_SCANSTAT_EXPLAIN]]
                SQLITE_SCANSTAT_EXPLAIN
                **
                ^The "const char *" variable pointed to by the V parameter will be set ** to a zero-terminated UTF-8 string containing the [EXPLAIN QUERY PLAN] -** description for the X-th loop. +** description for the X-th loop.
                ** ** [[SQLITE_SCANSTAT_SELECTID]]
                SQLITE_SCANSTAT_SELECTID
                **
                ^The "int" variable pointed to by the V parameter will be set to the ** id for the X-th query plan element. The id value is unique within the ** statement. The select-id is the same value as is output in the first -** column of an [EXPLAIN QUERY PLAN] query. +** column of an [EXPLAIN QUERY PLAN] query.
                ** ** [[SQLITE_SCANSTAT_PARENTID]]
                SQLITE_SCANSTAT_PARENTID
                **
                The "int" variable pointed to by the V parameter will be set to the -** the id of the parent of the current query element, if applicable, or +** id of the parent of the current query element, if applicable, or ** to zero if the query element has no parent. This is the same value as -** returned in the second column of an [EXPLAIN QUERY PLAN] query. +** returned in the second column of an [EXPLAIN QUERY PLAN] query.
                ** ** [[SQLITE_SCANSTAT_NCYCLE]]
                SQLITE_SCANSTAT_NCYCLE
                **
                The sqlite3_int64 output value is set to the number of cycles, ** according to the processor time-stamp counter, that elapsed while the ** query element was being processed. This value is not available for ** all query elements - if it is unavailable the output variable is -** set to -1. +** set to -1.
                ** */ #define SQLITE_SCANSTAT_NLOOP 0 @@ -10440,8 +10511,8 @@ SQLITE_API int sqlite3_vtab_rhs_value(sqlite3_index_info*, int, sqlite3_value ** ** sqlite3_stmt_scanstatus_v2() with a zeroed flags parameter. ** ** Parameter "idx" identifies the specific query element to retrieve statistics -** for. Query elements are numbered starting from zero. A value of -1 may be -** to query for statistics regarding the entire query. ^If idx is out of range +** for. Query elements are numbered starting from zero. A value of -1 may +** retrieve statistics for the entire query. ^If idx is out of range ** - less than -1 or greater than or equal to the total number of query ** elements used to implement the statement - a non-zero value is returned and ** the variable that pOut points to is unchanged. @@ -10484,7 +10555,7 @@ SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt*); ** METHOD: sqlite3 ** ** ^If a write-transaction is open on [database connection] D when the -** [sqlite3_db_cacheflush(D)] interface invoked, any dirty +** [sqlite3_db_cacheflush(D)] interface is invoked, any dirty ** pages in the pager-cache that are not currently in use are written out ** to disk. A dirty page may be in use if a database cursor created by an ** active SQL statement is reading from it, or if it is page 1 of a database @@ -10598,8 +10669,8 @@ SQLITE_API int sqlite3_db_cacheflush(sqlite3*); ** triggers; and so forth. ** ** When the [sqlite3_blob_write()] API is used to update a blob column, -** the pre-update hook is invoked with SQLITE_DELETE. This is because the -** in this case the new values are not available. In this case, when a +** the pre-update hook is invoked with SQLITE_DELETE, because +** the new values are not yet available. In this case, when a ** callback made with op==SQLITE_DELETE is actually a write using the ** sqlite3_blob_write() API, the [sqlite3_preupdate_blobwrite()] returns ** the index of the column being written. In other cases, where the @@ -10852,7 +10923,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** For an ordinary on-disk database file, the serialization is just a ** copy of the disk file. For an in-memory database or a "TEMP" database, ** the serialization is the same sequence of bytes which would be written -** to disk if that database where backed up to disk. +** to disk if that database were backed up to disk. ** ** The usual case is that sqlite3_serialize() copies the serialization of ** the database into memory obtained from [sqlite3_malloc64()] and returns @@ -10861,7 +10932,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c ** contains the SQLITE_SERIALIZE_NOCOPY bit, then no memory allocations ** are made, and the sqlite3_serialize() function will return a pointer ** to the contiguous memory representation of the database that SQLite -** is currently using for that database, or NULL if the no such contiguous +** is currently using for that database, or NULL if no such contiguous ** memory representation of the database exists. A contiguous memory ** representation of the database will usually only exist if there has ** been a prior call to [sqlite3_deserialize(D,S,...)] with the same @@ -10932,7 +11003,7 @@ SQLITE_API unsigned char *sqlite3_serialize( ** database is currently in a read transaction or is involved in a backup ** operation. ** -** It is not possible to deserialized into the TEMP database. If the +** It is not possible to deserialize into the TEMP database. If the ** S argument to sqlite3_deserialize(D,S,P,N,M,F) is "temp" then the ** function returns SQLITE_ERROR. ** @@ -10954,7 +11025,7 @@ SQLITE_API int sqlite3_deserialize( sqlite3 *db, /* The database connection */ const char *zSchema, /* Which DB to reopen with the deserialization */ unsigned char *pData, /* The serialized database content */ - sqlite3_int64 szDb, /* Number bytes in the deserialization */ + sqlite3_int64 szDb, /* Number of bytes in the deserialization */ sqlite3_int64 szBuf, /* Total size of buffer pData[] */ unsigned mFlags /* Zero or more SQLITE_DESERIALIZE_* flags */ ); @@ -10962,7 +11033,7 @@ SQLITE_API int sqlite3_deserialize( /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -11487,9 +11558,10 @@ SQLITE_API void sqlite3session_table_filter( ** is inserted while a session object is enabled, then later deleted while ** the same session object is disabled, no INSERT record will appear in the ** changeset, even though the delete took place while the session was disabled. -** Or, if one field of a row is updated while a session is disabled, and -** another field of the same row is updated while the session is enabled, the -** resulting changeset will contain an UPDATE change that updates both fields. +** Or, if one field of a row is updated while a session is enabled, and +** then another field of the same row is updated while the session is disabled, +** the resulting changeset will contain an UPDATE change that updates both +** fields. */ SQLITE_API int sqlite3session_changeset( sqlite3_session *pSession, /* Session object */ @@ -11561,8 +11633,9 @@ SQLITE_API sqlite3_int64 sqlite3session_changeset_size(sqlite3_session *pSession ** database zFrom the contents of the two compatible tables would be ** identical. ** -** It an error if database zFrom does not exist or does not contain the -** required compatible table. +** Unless the call to this function is a no-op as described above, it is an +** error if database zFrom does not exist or does not contain the required +** compatible table. ** ** If the operation is successful, SQLITE_OK is returned. Otherwise, an SQLite ** error code. In this case, if argument pzErrMsg is not NULL, *pzErrMsg @@ -11697,7 +11770,7 @@ SQLITE_API int sqlite3changeset_start_v2( ** The following flags may passed via the 4th parameter to ** [sqlite3changeset_start_v2] and [sqlite3changeset_start_v2_strm]: ** -**
                SQLITE_CHANGESETAPPLY_INVERT
                +**
                SQLITE_CHANGESETSTART_INVERT
                ** Invert the changeset while iterating through it. This is equivalent to ** inverting a changeset using sqlite3changeset_invert() before applying it. ** It is an error to specify this flag with a patchset. @@ -12012,19 +12085,6 @@ SQLITE_API int sqlite3changeset_concat( void **ppOut /* OUT: Buffer containing output changeset */ ); - -/* -** CAPI3REF: Upgrade the Schema of a Changeset/Patchset -*/ -SQLITE_API int sqlite3changeset_upgrade( - sqlite3 *db, - const char *zDb, - int nIn, const void *pIn, /* Input changeset */ - int *pnOut, void **ppOut /* OUT: Inverse of input */ -); - - - /* ** CAPI3REF: Changegroup Handle ** diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_userauth.go b/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_userauth.go index 76d84016..5a492766 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_userauth.go +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_userauth.go @@ -16,53 +16,10 @@ package sqlite3 #else #include #endif -#include - -static int -_sqlite3_user_authenticate(sqlite3* db, const char* zUsername, const char* aPW, int nPW) -{ - return sqlite3_user_authenticate(db, zUsername, aPW, nPW); -} - -static int -_sqlite3_user_add(sqlite3* db, const char* zUsername, const char* aPW, int nPW, int isAdmin) -{ - return sqlite3_user_add(db, zUsername, aPW, nPW, isAdmin); -} - -static int -_sqlite3_user_change(sqlite3* db, const char* zUsername, const char* aPW, int nPW, int isAdmin) -{ - return sqlite3_user_change(db, zUsername, aPW, nPW, isAdmin); -} - -static int -_sqlite3_user_delete(sqlite3* db, const char* zUsername) -{ - return sqlite3_user_delete(db, zUsername); -} - -static int -_sqlite3_auth_enabled(sqlite3* db) -{ - int exists = -1; - - sqlite3_stmt *stmt; - sqlite3_prepare_v2(db, "select count(type) from sqlite_master WHERE type='table' and name='sqlite_user';", -1, &stmt, NULL); - - while ( sqlite3_step(stmt) == SQLITE_ROW) { - exists = sqlite3_column_int(stmt, 0); - } - - sqlite3_finalize(stmt); - - return exists; -} */ import "C" import ( "errors" - "unsafe" ) const ( @@ -70,8 +27,9 @@ const ( ) var ( - ErrUnauthorized = errors.New("SQLITE_AUTH: Unauthorized") - ErrAdminRequired = errors.New("SQLITE_AUTH: Unauthorized; Admin Privileges Required") + ErrUnauthorized = errors.New("SQLITE_AUTH: Unauthorized") + ErrAdminRequired = errors.New("SQLITE_AUTH: Unauthorized; Admin Privileges Required") + errUserAuthNoLongerSupported = errors.New("sqlite3: the sqlite_userauth tag is no longer supported as the userauth extension is no longer supported by the SQLite authors, see https://github.com/mattn/go-sqlite3/issues/1341") ) // Authenticate will perform an authentication of the provided username @@ -88,15 +46,7 @@ var ( // If the SQLITE_USER table is not present in the database file, then // this interface is a harmless no-op returning SQLITE_OK. func (c *SQLiteConn) Authenticate(username, password string) error { - rv := c.authenticate(username, password) - switch rv { - case C.SQLITE_ERROR, C.SQLITE_AUTH: - return ErrUnauthorized - case C.SQLITE_OK: - return nil - default: - return c.lastError() - } + return errUserAuthNoLongerSupported } // authenticate provides the actual authentication to SQLite. @@ -109,17 +59,7 @@ func (c *SQLiteConn) Authenticate(username, password string) error { // C.SQLITE_ERROR (1) // C.SQLITE_AUTH (23) func (c *SQLiteConn) authenticate(username, password string) int { - // Allocate C Variables - cuser := C.CString(username) - cpass := C.CString(password) - - // Free C Variables - defer func() { - C.free(unsafe.Pointer(cuser)) - C.free(unsafe.Pointer(cpass)) - }() - - return int(C._sqlite3_user_authenticate(c.db, cuser, cpass, C.int(len(password)))) + return 1 } // AuthUserAdd can be used (by an admin user only) @@ -131,20 +71,7 @@ func (c *SQLiteConn) authenticate(username, password string) int { // for any ATTACH-ed databases. Any call to AuthUserAdd by a // non-admin user results in an error. func (c *SQLiteConn) AuthUserAdd(username, password string, admin bool) error { - isAdmin := 0 - if admin { - isAdmin = 1 - } - - rv := c.authUserAdd(username, password, isAdmin) - switch rv { - case C.SQLITE_ERROR, C.SQLITE_AUTH: - return ErrAdminRequired - case C.SQLITE_OK: - return nil - default: - return c.lastError() - } + return errUserAuthNoLongerSupported } // authUserAdd enables the User Authentication if not enabled. @@ -162,17 +89,7 @@ func (c *SQLiteConn) AuthUserAdd(username, password string, admin bool) error { // C.SQLITE_ERROR (1) // C.SQLITE_AUTH (23) func (c *SQLiteConn) authUserAdd(username, password string, admin int) int { - // Allocate C Variables - cuser := C.CString(username) - cpass := C.CString(password) - - // Free C Variables - defer func() { - C.free(unsafe.Pointer(cuser)) - C.free(unsafe.Pointer(cpass)) - }() - - return int(C._sqlite3_user_add(c.db, cuser, cpass, C.int(len(password)), C.int(admin))) + return 1 } // AuthUserChange can be used to change a users @@ -181,20 +98,7 @@ func (c *SQLiteConn) authUserAdd(username, password string, admin int) int { // credentials or admin privilege setting. No user may change their own // admin privilege setting. func (c *SQLiteConn) AuthUserChange(username, password string, admin bool) error { - isAdmin := 0 - if admin { - isAdmin = 1 - } - - rv := c.authUserChange(username, password, isAdmin) - switch rv { - case C.SQLITE_ERROR, C.SQLITE_AUTH: - return ErrAdminRequired - case C.SQLITE_OK: - return nil - default: - return c.lastError() - } + return errUserAuthNoLongerSupported } // authUserChange allows to modify a user. @@ -215,17 +119,7 @@ func (c *SQLiteConn) AuthUserChange(username, password string, admin bool) error // C.SQLITE_ERROR (1) // C.SQLITE_AUTH (23) func (c *SQLiteConn) authUserChange(username, password string, admin int) int { - // Allocate C Variables - cuser := C.CString(username) - cpass := C.CString(password) - - // Free C Variables - defer func() { - C.free(unsafe.Pointer(cuser)) - C.free(unsafe.Pointer(cpass)) - }() - - return int(C._sqlite3_user_change(c.db, cuser, cpass, C.int(len(password)), C.int(admin))) + return 1 } // AuthUserDelete can be used (by an admin user only) @@ -234,15 +128,7 @@ func (c *SQLiteConn) authUserChange(username, password string, admin int) int { // the database cannot be converted into a no-authentication-required // database. func (c *SQLiteConn) AuthUserDelete(username string) error { - rv := c.authUserDelete(username) - switch rv { - case C.SQLITE_ERROR, C.SQLITE_AUTH: - return ErrAdminRequired - case C.SQLITE_OK: - return nil - default: - return c.lastError() - } + return errUserAuthNoLongerSupported } // authUserDelete can be used to delete a user. @@ -258,25 +144,12 @@ func (c *SQLiteConn) AuthUserDelete(username string) error { // C.SQLITE_ERROR (1) // C.SQLITE_AUTH (23) func (c *SQLiteConn) authUserDelete(username string) int { - // Allocate C Variables - cuser := C.CString(username) - - // Free C Variables - defer func() { - C.free(unsafe.Pointer(cuser)) - }() - - return int(C._sqlite3_user_delete(c.db, cuser)) + return 1 } // AuthEnabled checks if the database is protected by user authentication func (c *SQLiteConn) AuthEnabled() (exists bool) { - rv := c.authEnabled() - if rv == 1 { - exists = true - } - - return + return false } // authEnabled perform the actual check for user authentication. @@ -289,7 +162,7 @@ func (c *SQLiteConn) AuthEnabled() (exists bool) { // 0 - Disabled // 1 - Enabled func (c *SQLiteConn) authEnabled() int { - return int(C._sqlite3_auth_enabled(c.db)) + return 0 } // EOF diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h b/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h index 935437bb..3a5e0a4e 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h @@ -371,6 +371,8 @@ struct sqlite3_api_routines { /* Version 3.44.0 and later */ void *(*get_clientdata)(sqlite3*,const char*); int (*set_clientdata)(sqlite3*, const char*, void*, void(*)(void*)); + /* Version 3.50.0 and later */ + int (*setlk_timeout)(sqlite3*,int,int); }; /* @@ -704,6 +706,8 @@ typedef int (*sqlite3_loadext_entry)( /* Version 3.44.0 and later */ #define sqlite3_get_clientdata sqlite3_api->get_clientdata #define sqlite3_set_clientdata sqlite3_api->set_clientdata +/* Version 3.50.0 and later */ +#define sqlite3_setlk_timeout sqlite3_api->setlk_timeout #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */ #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) diff --git a/vendor/github.com/spf13/pflag/README.md b/vendor/github.com/spf13/pflag/README.md index 7eacc5bd..388c4e5e 100644 --- a/vendor/github.com/spf13/pflag/README.md +++ b/vendor/github.com/spf13/pflag/README.md @@ -284,6 +284,33 @@ func main() { } ``` +### Using pflag with go test +`pflag` does not parse the shorthand versions of go test's built-in flags (i.e., those starting with `-test.`). +For more context, see issues [#63](https://github.com/spf13/pflag/issues/63) and [#238](https://github.com/spf13/pflag/issues/238) for more details. + +For example, if you use pflag in your `TestMain` function and call `pflag.Parse()` after defining your custom flags, running a test like this: +```bash +go test /your/tests -run ^YourTest -v --your-test-pflags +``` +will result in the `-v` flag being ignored. This happens because of the way pflag handles flag parsing, skipping over go test's built-in shorthand flags. +To work around this, you can use the `ParseSkippedFlags` function, which ensures that go test's flags are parsed separately using the standard flag package. + +**Example**: You want to parse go test flags that are otherwise ignore by `pflag.Parse()` +```go +import ( + goflag "flag" + flag "github.com/spf13/pflag" +) + +var ip *int = flag.Int("flagname", 1234, "help message for flagname") + +func main() { + flag.CommandLine.AddGoFlagSet(goflag.CommandLine) + flag.ParseSkippedFlags(os.Args[1:], goflag.CommandLine) + flag.Parse() +} +``` + ## More info You can see the full reference documentation of the pflag package diff --git a/vendor/github.com/spf13/pflag/bool_func.go b/vendor/github.com/spf13/pflag/bool_func.go new file mode 100644 index 00000000..83d77afa --- /dev/null +++ b/vendor/github.com/spf13/pflag/bool_func.go @@ -0,0 +1,40 @@ +package pflag + +// -- func Value +type boolfuncValue func(string) error + +func (f boolfuncValue) Set(s string) error { return f(s) } + +func (f boolfuncValue) Type() string { return "boolfunc" } + +func (f boolfuncValue) String() string { return "" } // same behavior as stdlib 'flag' package + +func (f boolfuncValue) IsBoolFlag() bool { return true } + +// BoolFunc defines a func flag with specified name, callback function and usage string. +// +// The callback function will be called every time "--{name}" (or any form that matches the flag) is parsed +// on the command line. +func (f *FlagSet) BoolFunc(name string, usage string, fn func(string) error) { + f.BoolFuncP(name, "", usage, fn) +} + +// BoolFuncP is like BoolFunc, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) BoolFuncP(name, shorthand string, usage string, fn func(string) error) { + var val Value = boolfuncValue(fn) + flag := f.VarPF(val, name, shorthand, usage) + flag.NoOptDefVal = "true" +} + +// BoolFunc defines a func flag with specified name, callback function and usage string. +// +// The callback function will be called every time "--{name}" (or any form that matches the flag) is parsed +// on the command line. +func BoolFunc(name string, usage string, fn func(string) error) { + CommandLine.BoolFuncP(name, "", usage, fn) +} + +// BoolFuncP is like BoolFunc, but accepts a shorthand letter that can be used after a single dash. +func BoolFuncP(name, shorthand string, usage string, fn func(string) error) { + CommandLine.BoolFuncP(name, shorthand, usage, fn) +} diff --git a/vendor/github.com/spf13/pflag/count.go b/vendor/github.com/spf13/pflag/count.go index a0b2679f..d49c0143 100644 --- a/vendor/github.com/spf13/pflag/count.go +++ b/vendor/github.com/spf13/pflag/count.go @@ -85,7 +85,7 @@ func (f *FlagSet) CountP(name, shorthand string, usage string) *int { // Count defines a count flag with specified name, default value, and usage string. // The return value is the address of an int variable that stores the value of the flag. -// A count flag will add 1 to its value evey time it is found on the command line +// A count flag will add 1 to its value every time it is found on the command line func Count(name string, usage string) *int { return CommandLine.CountP(name, "", usage) } diff --git a/vendor/github.com/spf13/pflag/errors.go b/vendor/github.com/spf13/pflag/errors.go new file mode 100644 index 00000000..ff11b66b --- /dev/null +++ b/vendor/github.com/spf13/pflag/errors.go @@ -0,0 +1,149 @@ +package pflag + +import "fmt" + +// notExistErrorMessageType specifies which flavor of "flag does not exist" +// is printed by NotExistError. This allows the related errors to be grouped +// under a single NotExistError struct without making a breaking change to +// the error message text. +type notExistErrorMessageType int + +const ( + flagNotExistMessage notExistErrorMessageType = iota + flagNotDefinedMessage + flagNoSuchFlagMessage + flagUnknownFlagMessage + flagUnknownShorthandFlagMessage +) + +// NotExistError is the error returned when trying to access a flag that +// does not exist in the FlagSet. +type NotExistError struct { + name string + specifiedShorthands string + messageType notExistErrorMessageType +} + +// Error implements error. +func (e *NotExistError) Error() string { + switch e.messageType { + case flagNotExistMessage: + return fmt.Sprintf("flag %q does not exist", e.name) + + case flagNotDefinedMessage: + return fmt.Sprintf("flag accessed but not defined: %s", e.name) + + case flagNoSuchFlagMessage: + return fmt.Sprintf("no such flag -%v", e.name) + + case flagUnknownFlagMessage: + return fmt.Sprintf("unknown flag: --%s", e.name) + + case flagUnknownShorthandFlagMessage: + c := rune(e.name[0]) + return fmt.Sprintf("unknown shorthand flag: %q in -%s", c, e.specifiedShorthands) + } + + panic(fmt.Errorf("unknown flagNotExistErrorMessageType: %v", e.messageType)) +} + +// GetSpecifiedName returns the name of the flag (without dashes) as it +// appeared in the parsed arguments. +func (e *NotExistError) GetSpecifiedName() string { + return e.name +} + +// GetSpecifiedShortnames returns the group of shorthand arguments +// (without dashes) that the flag appeared within. If the flag was not in a +// shorthand group, this will return an empty string. +func (e *NotExistError) GetSpecifiedShortnames() string { + return e.specifiedShorthands +} + +// ValueRequiredError is the error returned when a flag needs an argument but +// no argument was provided. +type ValueRequiredError struct { + flag *Flag + specifiedName string + specifiedShorthands string +} + +// Error implements error. +func (e *ValueRequiredError) Error() string { + if len(e.specifiedShorthands) > 0 { + c := rune(e.specifiedName[0]) + return fmt.Sprintf("flag needs an argument: %q in -%s", c, e.specifiedShorthands) + } + + return fmt.Sprintf("flag needs an argument: --%s", e.specifiedName) +} + +// GetFlag returns the flag for which the error occurred. +func (e *ValueRequiredError) GetFlag() *Flag { + return e.flag +} + +// GetSpecifiedName returns the name of the flag (without dashes) as it +// appeared in the parsed arguments. +func (e *ValueRequiredError) GetSpecifiedName() string { + return e.specifiedName +} + +// GetSpecifiedShortnames returns the group of shorthand arguments +// (without dashes) that the flag appeared within. If the flag was not in a +// shorthand group, this will return an empty string. +func (e *ValueRequiredError) GetSpecifiedShortnames() string { + return e.specifiedShorthands +} + +// InvalidValueError is the error returned when an invalid value is used +// for a flag. +type InvalidValueError struct { + flag *Flag + value string + cause error +} + +// Error implements error. +func (e *InvalidValueError) Error() string { + flag := e.flag + var flagName string + if flag.Shorthand != "" && flag.ShorthandDeprecated == "" { + flagName = fmt.Sprintf("-%s, --%s", flag.Shorthand, flag.Name) + } else { + flagName = fmt.Sprintf("--%s", flag.Name) + } + return fmt.Sprintf("invalid argument %q for %q flag: %v", e.value, flagName, e.cause) +} + +// Unwrap implements errors.Unwrap. +func (e *InvalidValueError) Unwrap() error { + return e.cause +} + +// GetFlag returns the flag for which the error occurred. +func (e *InvalidValueError) GetFlag() *Flag { + return e.flag +} + +// GetValue returns the invalid value that was provided. +func (e *InvalidValueError) GetValue() string { + return e.value +} + +// InvalidSyntaxError is the error returned when a bad flag name is passed on +// the command line. +type InvalidSyntaxError struct { + specifiedFlag string +} + +// Error implements error. +func (e *InvalidSyntaxError) Error() string { + return fmt.Sprintf("bad flag syntax: %s", e.specifiedFlag) +} + +// GetSpecifiedName returns the exact flag (with dashes) as it +// appeared in the parsed arguments. +func (e *InvalidSyntaxError) GetSpecifiedFlag() string { + return e.specifiedFlag +} diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go index 7c058de3..d4dfbc5e 100644 --- a/vendor/github.com/spf13/pflag/flag.go +++ b/vendor/github.com/spf13/pflag/flag.go @@ -27,23 +27,32 @@ unaffected. Define flags using flag.String(), Bool(), Int(), etc. This declares an integer flag, -flagname, stored in the pointer ip, with type *int. + var ip = flag.Int("flagname", 1234, "help message for flagname") + If you like, you can bind the flag to a variable using the Var() functions. + var flagvar int func init() { flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname") } + Or you can create custom flags that satisfy the Value interface (with pointer receivers) and couple them to flag parsing by + flag.Var(&flagVal, "name", "help message for flagname") + For such flags, the default value is just the initial value of the variable. After all flags are defined, call + flag.Parse() + to parse the command line into the defined flags. Flags may then be used directly. If you're using the flags themselves, they are all pointers; if you bind to variables, they're values. + fmt.Println("ip has value ", *ip) fmt.Println("flagvar has value ", flagvar) @@ -54,22 +63,26 @@ The arguments are indexed from 0 through flag.NArg()-1. The pflag package also defines some new functions that are not in flag, that give one-letter shorthands for flags. You can use these by appending 'P' to the name of any function that defines a flag. + var ip = flag.IntP("flagname", "f", 1234, "help message") var flagvar bool func init() { flag.BoolVarP(&flagvar, "boolname", "b", true, "help message") } flag.VarP(&flagval, "varname", "v", "help message") + Shorthand letters can be used with single dashes on the command line. Boolean shorthand flags can be combined with other shorthand flags. Command line flag syntax: + --flag // boolean flags only --flag=x Unlike the flag package, a single dash before an option means something different than a double dash. Single dashes signify a series of shorthand letters for flags. All but the last shorthand letter must be boolean flags. + // boolean flags -f -abc @@ -381,7 +394,7 @@ func (f *FlagSet) lookup(name NormalizedName) *Flag { func (f *FlagSet) getFlagType(name string, ftype string, convFunc func(sval string) (interface{}, error)) (interface{}, error) { flag := f.Lookup(name) if flag == nil { - err := fmt.Errorf("flag accessed but not defined: %s", name) + err := &NotExistError{name: name, messageType: flagNotDefinedMessage} return nil, err } @@ -411,7 +424,7 @@ func (f *FlagSet) ArgsLenAtDash() int { func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error { flag := f.Lookup(name) if flag == nil { - return fmt.Errorf("flag %q does not exist", name) + return &NotExistError{name: name, messageType: flagNotExistMessage} } if usageMessage == "" { return fmt.Errorf("deprecated message for flag %q must be set", name) @@ -427,7 +440,7 @@ func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error { func (f *FlagSet) MarkShorthandDeprecated(name string, usageMessage string) error { flag := f.Lookup(name) if flag == nil { - return fmt.Errorf("flag %q does not exist", name) + return &NotExistError{name: name, messageType: flagNotExistMessage} } if usageMessage == "" { return fmt.Errorf("deprecated message for flag %q must be set", name) @@ -441,7 +454,7 @@ func (f *FlagSet) MarkShorthandDeprecated(name string, usageMessage string) erro func (f *FlagSet) MarkHidden(name string) error { flag := f.Lookup(name) if flag == nil { - return fmt.Errorf("flag %q does not exist", name) + return &NotExistError{name: name, messageType: flagNotExistMessage} } flag.Hidden = true return nil @@ -464,18 +477,16 @@ func (f *FlagSet) Set(name, value string) error { normalName := f.normalizeFlagName(name) flag, ok := f.formal[normalName] if !ok { - return fmt.Errorf("no such flag -%v", name) + return &NotExistError{name: name, messageType: flagNoSuchFlagMessage} } err := flag.Value.Set(value) if err != nil { - var flagName string - if flag.Shorthand != "" && flag.ShorthandDeprecated == "" { - flagName = fmt.Sprintf("-%s, --%s", flag.Shorthand, flag.Name) - } else { - flagName = fmt.Sprintf("--%s", flag.Name) + return &InvalidValueError{ + flag: flag, + value: value, + cause: err, } - return fmt.Errorf("invalid argument %q for %q flag: %v", value, flagName, err) } if !flag.Changed { @@ -501,7 +512,7 @@ func (f *FlagSet) SetAnnotation(name, key string, values []string) error { normalName := f.normalizeFlagName(name) flag, ok := f.formal[normalName] if !ok { - return fmt.Errorf("no such flag -%v", name) + return &NotExistError{name: name, messageType: flagNoSuchFlagMessage} } if flag.Annotations == nil { flag.Annotations = map[string][]string{} @@ -538,7 +549,7 @@ func (f *FlagSet) PrintDefaults() { func (f *Flag) defaultIsZeroValue() bool { switch f.Value.(type) { case boolFlag: - return f.DefValue == "false" + return f.DefValue == "false" || f.DefValue == "" case *durationValue: // Beginning in Go 1.7, duration zero values are "0s" return f.DefValue == "0" || f.DefValue == "0s" @@ -551,7 +562,7 @@ func (f *Flag) defaultIsZeroValue() bool { case *intSliceValue, *stringSliceValue, *stringArrayValue: return f.DefValue == "[]" default: - switch f.Value.String() { + switch f.DefValue { case "false": return true case "": @@ -588,8 +599,10 @@ func UnquoteUsage(flag *Flag) (name string, usage string) { name = flag.Value.Type() switch name { - case "bool": + case "bool", "boolfunc": name = "" + case "func": + name = "value" case "float64": name = "float" case "int64": @@ -707,7 +720,7 @@ func (f *FlagSet) FlagUsagesWrapped(cols int) string { switch flag.Value.Type() { case "string": line += fmt.Sprintf("[=\"%s\"]", flag.NoOptDefVal) - case "bool": + case "bool", "boolfunc": if flag.NoOptDefVal != "true" { line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) } @@ -911,10 +924,9 @@ func VarP(value Value, name, shorthand, usage string) { CommandLine.VarP(value, name, shorthand, usage) } -// failf prints to standard error a formatted error and usage message and +// fail prints an error message and usage message to standard error and // returns the error. -func (f *FlagSet) failf(format string, a ...interface{}) error { - err := fmt.Errorf(format, a...) +func (f *FlagSet) fail(err error) error { if f.errorHandling != ContinueOnError { fmt.Fprintln(f.Output(), err) f.usage() @@ -934,9 +946,9 @@ func (f *FlagSet) usage() { } } -//--unknown (args will be empty) -//--unknown --next-flag ... (args will be --next-flag ...) -//--unknown arg ... (args will be arg ...) +// --unknown (args will be empty) +// --unknown --next-flag ... (args will be --next-flag ...) +// --unknown arg ... (args will be arg ...) func stripUnknownFlagValue(args []string) []string { if len(args) == 0 { //--unknown @@ -960,7 +972,7 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin a = args name := s[2:] if len(name) == 0 || name[0] == '-' || name[0] == '=' { - err = f.failf("bad flag syntax: %s", s) + err = f.fail(&InvalidSyntaxError{specifiedFlag: s}) return } @@ -982,7 +994,7 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin return stripUnknownFlagValue(a), nil default: - err = f.failf("unknown flag: --%s", name) + err = f.fail(&NotExistError{name: name, messageType: flagUnknownFlagMessage}) return } } @@ -1000,13 +1012,16 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin a = a[1:] } else { // '--flag' (arg was required) - err = f.failf("flag needs an argument: %s", s) + err = f.fail(&ValueRequiredError{ + flag: flag, + specifiedName: name, + }) return } err = fn(flag, value) if err != nil { - f.failf(err.Error()) + f.fail(err) } return } @@ -1014,7 +1029,7 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parseFunc) (outShorts string, outArgs []string, err error) { outArgs = args - if strings.HasPrefix(shorthands, "test.") { + if isGotestShorthandFlag(shorthands) { return } @@ -1039,7 +1054,11 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parse outArgs = stripUnknownFlagValue(outArgs) return default: - err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands) + err = f.fail(&NotExistError{ + name: string(c), + specifiedShorthands: shorthands, + messageType: flagUnknownShorthandFlagMessage, + }) return } } @@ -1062,7 +1081,11 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parse outArgs = args[1:] } else { // '-f' (arg was required) - err = f.failf("flag needs an argument: %q in -%s", c, shorthands) + err = f.fail(&ValueRequiredError{ + flag: flag, + specifiedName: string(c), + specifiedShorthands: shorthands, + }) return } @@ -1072,7 +1095,7 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parse err = fn(flag, value) if err != nil { - f.failf(err.Error()) + f.fail(err) } return } @@ -1135,7 +1158,7 @@ func (f *FlagSet) Parse(arguments []string) error { } f.parsed = true - if len(arguments) < 0 { + if len(arguments) == 0 { return nil } diff --git a/vendor/github.com/spf13/pflag/func.go b/vendor/github.com/spf13/pflag/func.go new file mode 100644 index 00000000..9f4d88f2 --- /dev/null +++ b/vendor/github.com/spf13/pflag/func.go @@ -0,0 +1,37 @@ +package pflag + +// -- func Value +type funcValue func(string) error + +func (f funcValue) Set(s string) error { return f(s) } + +func (f funcValue) Type() string { return "func" } + +func (f funcValue) String() string { return "" } // same behavior as stdlib 'flag' package + +// Func defines a func flag with specified name, callback function and usage string. +// +// The callback function will be called every time "--{name}={value}" (or equivalent) is +// parsed on the command line, with "{value}" as an argument. +func (f *FlagSet) Func(name string, usage string, fn func(string) error) { + f.FuncP(name, "", usage, fn) +} + +// FuncP is like Func, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) FuncP(name string, shorthand string, usage string, fn func(string) error) { + var val Value = funcValue(fn) + f.VarP(val, name, shorthand, usage) +} + +// Func defines a func flag with specified name, callback function and usage string. +// +// The callback function will be called every time "--{name}={value}" (or equivalent) is +// parsed on the command line, with "{value}" as an argument. +func Func(name string, usage string, fn func(string) error) { + CommandLine.FuncP(name, "", usage, fn) +} + +// FuncP is like Func, but accepts a shorthand letter that can be used after a single dash. +func FuncP(name, shorthand string, usage string, fn func(string) error) { + CommandLine.FuncP(name, shorthand, usage, fn) +} diff --git a/vendor/github.com/spf13/pflag/golangflag.go b/vendor/github.com/spf13/pflag/golangflag.go index d3dd72b7..f563907e 100644 --- a/vendor/github.com/spf13/pflag/golangflag.go +++ b/vendor/github.com/spf13/pflag/golangflag.go @@ -10,6 +10,15 @@ import ( "strings" ) +// go test flags prefixes +func isGotestFlag(flag string) bool { + return strings.HasPrefix(flag, "-test.") +} + +func isGotestShorthandFlag(flag string) bool { + return strings.HasPrefix(flag, "test.") +} + // flagValueWrapper implements pflag.Value around a flag.Value. The main // difference here is the addition of the Type method that returns a string // name of the type. As this is generally unknown, we approximate that with @@ -103,3 +112,16 @@ func (f *FlagSet) AddGoFlagSet(newSet *goflag.FlagSet) { } f.addedGoFlagSets = append(f.addedGoFlagSets, newSet) } + +// ParseSkippedFlags explicitly Parses go test flags (i.e. the one starting with '-test.') with goflag.Parse(), +// since by default those are skipped by pflag.Parse(). +// Typical usage example: `ParseGoTestFlags(os.Args[1:], goflag.CommandLine)` +func ParseSkippedFlags(osArgs []string, goFlagSet *goflag.FlagSet) error { + var skippedFlags []string + for _, f := range osArgs { + if isGotestFlag(f) { + skippedFlags = append(skippedFlags, f) + } + } + return goFlagSet.Parse(skippedFlags) +} diff --git a/vendor/github.com/spf13/pflag/ipnet_slice.go b/vendor/github.com/spf13/pflag/ipnet_slice.go index 6b541aa8..c6e89da1 100644 --- a/vendor/github.com/spf13/pflag/ipnet_slice.go +++ b/vendor/github.com/spf13/pflag/ipnet_slice.go @@ -73,7 +73,7 @@ func (s *ipNetSliceValue) String() string { func ipNetSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") - // Emtpy string would cause a slice with one (empty) entry + // Empty string would cause a slice with one (empty) entry if len(val) == 0 { return []net.IPNet{}, nil } diff --git a/vendor/github.com/spf13/pflag/text.go b/vendor/github.com/spf13/pflag/text.go new file mode 100644 index 00000000..886d5a3d --- /dev/null +++ b/vendor/github.com/spf13/pflag/text.go @@ -0,0 +1,81 @@ +package pflag + +import ( + "encoding" + "fmt" + "reflect" +) + +// following is copied from go 1.23.4 flag.go +type textValue struct{ p encoding.TextUnmarshaler } + +func newTextValue(val encoding.TextMarshaler, p encoding.TextUnmarshaler) textValue { + ptrVal := reflect.ValueOf(p) + if ptrVal.Kind() != reflect.Ptr { + panic("variable value type must be a pointer") + } + defVal := reflect.ValueOf(val) + if defVal.Kind() == reflect.Ptr { + defVal = defVal.Elem() + } + if defVal.Type() != ptrVal.Type().Elem() { + panic(fmt.Sprintf("default type does not match variable type: %v != %v", defVal.Type(), ptrVal.Type().Elem())) + } + ptrVal.Elem().Set(defVal) + return textValue{p} +} + +func (v textValue) Set(s string) error { + return v.p.UnmarshalText([]byte(s)) +} + +func (v textValue) Get() interface{} { + return v.p +} + +func (v textValue) String() string { + if m, ok := v.p.(encoding.TextMarshaler); ok { + if b, err := m.MarshalText(); err == nil { + return string(b) + } + } + return "" +} + +//end of copy + +func (v textValue) Type() string { + return reflect.ValueOf(v.p).Type().Name() +} + +// GetText set out, which implements encoding.UnmarshalText, to the value of a flag with given name +func (f *FlagSet) GetText(name string, out encoding.TextUnmarshaler) error { + flag := f.Lookup(name) + if flag == nil { + return fmt.Errorf("flag accessed but not defined: %s", name) + } + if flag.Value.Type() != reflect.TypeOf(out).Name() { + return fmt.Errorf("trying to get %s value of flag of type %s", reflect.TypeOf(out).Name(), flag.Value.Type()) + } + return out.UnmarshalText([]byte(flag.Value.String())) +} + +// TextVar defines a flag with a specified name, default value, and usage string. The argument p must be a pointer to a variable that will hold the value of the flag, and p must implement encoding.TextUnmarshaler. If the flag is used, the flag value will be passed to p's UnmarshalText method. The type of the default value must be the same as the type of p. +func (f *FlagSet) TextVar(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string) { + f.VarP(newTextValue(value, p), name, "", usage) +} + +// TextVarP is like TextVar, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) TextVarP(p encoding.TextUnmarshaler, name, shorthand string, value encoding.TextMarshaler, usage string) { + f.VarP(newTextValue(value, p), name, shorthand, usage) +} + +// TextVar defines a flag with a specified name, default value, and usage string. The argument p must be a pointer to a variable that will hold the value of the flag, and p must implement encoding.TextUnmarshaler. If the flag is used, the flag value will be passed to p's UnmarshalText method. The type of the default value must be the same as the type of p. +func TextVar(p encoding.TextUnmarshaler, name string, value encoding.TextMarshaler, usage string) { + CommandLine.VarP(newTextValue(value, p), name, "", usage) +} + +// TextVarP is like TextVar, but accepts a shorthand letter that can be used after a single dash. +func TextVarP(p encoding.TextUnmarshaler, name, shorthand string, value encoding.TextMarshaler, usage string) { + CommandLine.VarP(newTextValue(value, p), name, shorthand, usage) +} diff --git a/vendor/github.com/spf13/pflag/time.go b/vendor/github.com/spf13/pflag/time.go new file mode 100644 index 00000000..dc024807 --- /dev/null +++ b/vendor/github.com/spf13/pflag/time.go @@ -0,0 +1,118 @@ +package pflag + +import ( + "fmt" + "strings" + "time" +) + +// TimeValue adapts time.Time for use as a flag. +type timeValue struct { + *time.Time + formats []string +} + +func newTimeValue(val time.Time, p *time.Time, formats []string) *timeValue { + *p = val + return &timeValue{ + Time: p, + formats: formats, + } +} + +// Set time.Time value from string based on accepted formats. +func (d *timeValue) Set(s string) error { + s = strings.TrimSpace(s) + for _, f := range d.formats { + v, err := time.Parse(f, s) + if err != nil { + continue + } + *d.Time = v + return nil + } + + formatsString := "" + for i, f := range d.formats { + if i > 0 { + formatsString += ", " + } + formatsString += fmt.Sprintf("`%s`", f) + } + + return fmt.Errorf("invalid time format `%s` must be one of: %s", s, formatsString) +} + +// Type name for time.Time flags. +func (d *timeValue) Type() string { + return "time" +} + +func (d *timeValue) String() string { return d.Time.Format(time.RFC3339Nano) } + +// GetTime return the time value of a flag with the given name +func (f *FlagSet) GetTime(name string) (time.Time, error) { + flag := f.Lookup(name) + if flag == nil { + err := fmt.Errorf("flag accessed but not defined: %s", name) + return time.Time{}, err + } + + if flag.Value.Type() != "time" { + err := fmt.Errorf("trying to get %s value of flag of type %s", "time", flag.Value.Type()) + return time.Time{}, err + } + + val, ok := flag.Value.(*timeValue) + if !ok { + return time.Time{}, fmt.Errorf("value %s is not a time", flag.Value) + } + + return *val.Time, nil +} + +// TimeVar defines a time.Time flag with specified name, default value, and usage string. +// The argument p points to a time.Time variable in which to store the value of the flag. +func (f *FlagSet) TimeVar(p *time.Time, name string, value time.Time, formats []string, usage string) { + f.TimeVarP(p, name, "", value, formats, usage) +} + +// TimeVarP is like TimeVar, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) TimeVarP(p *time.Time, name, shorthand string, value time.Time, formats []string, usage string) { + f.VarP(newTimeValue(value, p, formats), name, shorthand, usage) +} + +// TimeVar defines a time.Time flag with specified name, default value, and usage string. +// The argument p points to a time.Time variable in which to store the value of the flag. +func TimeVar(p *time.Time, name string, value time.Time, formats []string, usage string) { + CommandLine.TimeVarP(p, name, "", value, formats, usage) +} + +// TimeVarP is like TimeVar, but accepts a shorthand letter that can be used after a single dash. +func TimeVarP(p *time.Time, name, shorthand string, value time.Time, formats []string, usage string) { + CommandLine.VarP(newTimeValue(value, p, formats), name, shorthand, usage) +} + +// Time defines a time.Time flag with specified name, default value, and usage string. +// The return value is the address of a time.Time variable that stores the value of the flag. +func (f *FlagSet) Time(name string, value time.Time, formats []string, usage string) *time.Time { + return f.TimeP(name, "", value, formats, usage) +} + +// TimeP is like Time, but accepts a shorthand letter that can be used after a single dash. +func (f *FlagSet) TimeP(name, shorthand string, value time.Time, formats []string, usage string) *time.Time { + p := new(time.Time) + f.TimeVarP(p, name, shorthand, value, formats, usage) + return p +} + +// Time defines a time.Time flag with specified name, default value, and usage string. +// The return value is the address of a time.Time variable that stores the value of the flag. +func Time(name string, value time.Time, formats []string, usage string) *time.Time { + return CommandLine.TimeP(name, "", value, formats, usage) +} + +// TimeP is like Time, but accepts a shorthand letter that can be used after a single dash. +func TimeP(name, shorthand string, value time.Time, formats []string, usage string) *time.Time { + return CommandLine.TimeP(name, shorthand, value, formats, usage) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 257d4f95..f090ee01 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -55,7 +55,7 @@ github.com/go-openapi/analysis/internal/flatten/sortref # github.com/go-openapi/errors v0.22.2 ## explicit; go 1.20 github.com/go-openapi/errors -# github.com/go-openapi/jsonpointer v0.21.1 +# github.com/go-openapi/jsonpointer v0.21.2 ## explicit; go 1.20 github.com/go-openapi/jsonpointer # github.com/go-openapi/jsonreference v0.21.0 @@ -160,7 +160,7 @@ github.com/mattn/go-isatty # github.com/mattn/go-runewidth v0.0.16 ## explicit; go 1.9 github.com/mattn/go-runewidth -# github.com/mattn/go-sqlite3 v1.14.28 +# github.com/mattn/go-sqlite3 v1.14.31 ## explicit; go 1.19 github.com/mattn/go-sqlite3 # github.com/minio/sio v0.4.1 @@ -223,7 +223,7 @@ github.com/rivo/uniseg # github.com/spf13/cobra v1.9.1 ## explicit; go 1.15 github.com/spf13/cobra -# github.com/spf13/pflag v1.0.6 +# github.com/spf13/pflag v1.0.7 ## explicit; go 1.12 github.com/spf13/pflag # github.com/stretchr/objx v0.5.2 diff --git a/webapp/.env.development b/webapp/.env.development new file mode 100644 index 00000000..17e74eaa --- /dev/null +++ b/webapp/.env.development @@ -0,0 +1,2 @@ +VITE_GARM_API_URL=http://localhost:9997 +NODE_ENV=development diff --git a/webapp/.env.example b/webapp/.env.example new file mode 100644 index 00000000..2e2f8dbb --- /dev/null +++ b/webapp/.env.example @@ -0,0 +1,8 @@ +# Development Environment Variables + +# GARM Backend API URL (for development only) +# When set, the frontend will connect to this URL instead of using proxy +# VITE_GARM_API_URL=http://localhost:9997 + +# Node Environment (automatically set by npm scripts) +# NODE_ENV=development \ No newline at end of file diff --git a/webapp/DEV_SETUP.md b/webapp/DEV_SETUP.md new file mode 100644 index 00000000..2eb778f3 --- /dev/null +++ b/webapp/DEV_SETUP.md @@ -0,0 +1,79 @@ +# Development Setup + +The web app can be started with the `npm run dev` command, which will start a development server with hot reloading. To properly work, there are a number of prerequisites you need to have and some GARM settings to tweak. + +## Prerequisites + +To have a full development setup, you will need the following prerequisites: + +- **Node.js 24+** and **npm** +- **Go 1.24+** (for building the GARM backend) +- **openapi-generator-cli** in your PATH (for API client generation) + +The `openapi-generator-cli` will also need java to be installed. If you're running on Ubuntu, running: + +```bash +sudo apt-get install default-jre +``` + +should be enough. Different distros should have an equivalent package available. + +>[!NOTE] +>If you don't need to change the web app, you don't need to rebuild it. There is already a pre-built version in the repo. + +## Necessary GARM settings + +GARM has strict origin checks for websockets and API calls. To allow your local development server to communicate with the GARM backend, you need to configure the following settings: + +```toml +[apiserver] +cors_origins = ["https://garm.example.com", "http://127.0.0.1:5173"] +``` + +>[!IMPORTANT] +> You must include the port. + +>[!IMPORTANT] +> Omitting the `cors_origins` option will automatically check same host origin. + +## Development Server + +Your GARM server can be started and hosted anywhere. As long as you set the proper `cors_origins` URLs, your web-ui development server can be separate from your GARM server. To point the web app to the GARM server, you will need to create an `.env.development` file in the `webapp/` directory: + +```bash +cd /home/ubuntu/garm/webapp +echo "VITE_GARM_API_URL=http://localhost:9997" > .env +echo "NODE_ENV=development" >> .env +npm run dev +``` + +## Asset Management + +During development: +- SVG icons are served from `static/assets/` +- Favicons are served from `static/` +- All static assets are copied from `assets/assets/` to `static/assets/` + +## Building for Production + +For production deployments, the web app is embedded into the GARM binary. You don't need to serve it separately. To build the web app and embed it into the binary, run the following 2 commands: + +```bash +# Build the static webapp +make build-webui +# Build the garm binary with the webapp embedded +make build +``` + +This creates the production build with: +- Base path set to `/ui` +- All assets embedded for Go to serve +- Optimized bundles + +>[!IMPORTANT] +>The web UI is an optional feature in GARM. For the `/ui` URL to be available, you will need to enable it in the garm config file under: +>```toml +>[apiserver.webui] +> enable=true +>``` +>See the sample config file in the `testdata/config.toml` file. \ No newline at end of file diff --git a/webapp/README.md b/webapp/README.md new file mode 100644 index 00000000..4b63b2a8 --- /dev/null +++ b/webapp/README.md @@ -0,0 +1,102 @@ +# GARM SPA (SvelteKit) + +This is a Single Page Application (SPA) implementation of the GARM web interface using SvelteKit. + +## Features + +- **Lightweight**: Uses SvelteKit for minimal bundle size and fast performance +- **Modern**: TypeScript-first development with full type safety +- **Responsive**: Mobile-first design using Tailwind CSS +- **Real-time**: WebSocket integration for live updates +- **API-driven**: Uses the existing GARM REST API endpoints + +### Quick Start + +1. **Clone the repository** (if not already done) + +```bash +git clone https://github.com/cloudbase/garm.git +cd garm +``` + +2. **Build and test GARM with embedded webapp** + +```bash +# You can skip this command if you made no changes to the webapp. +make build-webui +# builds the binary, with the web UI embedded. +make build +``` + +Make sure you enable the webui in the config: + +```toml +[apiserver.webui] + enable=true +``` + +3. **Access the webapp** + - Navigate to `http://localhost:9997/ui/` (or your configured fqdn and port) + +### Development Workflow + +See the [DEV_SETUP.md](DEV_SETUP.md) file. + +### Git Workflow + +**DO NOT commit** the following directories: +- `webapp/node_modules/` - Dependencies (managed by package-lock.json) +- `webapp/.svelte-kit/` - Build cache and generated files +- `webapp/build/` - Production build output + +These are already included in `.gitignore`. Only commit source files in `webapp/src/` and configuration files. + +### API Client Generation + +The webapp uses auto-generated TypeScript clients from the GARM OpenAPI spec using `go generate`. To regenerate the clients, mocks and everything else, run: + +```bash +go generate ./... +``` + +In the root folder of the project. + +>[!NOTE] +> See [DEV_SETUP.md](DEV_SETUP.md) for prerequisites, before you try to generate the files. + +### Asset Serving + +The webapp is embedded using Go's `embed` package in `webapp/assets/assets.go`: + +```go +//go:embed all:* +var EmbeddedSPA embed.FS +``` + +This allows GARM to serve the entire webapp with zero external dependencies. The webapp assets are compiled into the Go binary at build time. + +## Running GARM behind a reverse proxy + +In production, GARM will serve the web UI and assets from the embedded files inside the binary. The web UI also relies on the [events](/doc/events.md) API for real-time updates. + +To have a fully working experience, you will need to configure your reverse proxy to allow websocket upgrades. For an `nginx` example, see [the sample config in the testdata folder](/testdata/nginx-server.conf). + +Additionally, in production you can also override the default web UI that is embedded in GARM, without updating the garm binary. To do that, build the webapp, place it in the document root of `nginx` and create a new `location /ui` config in nginx. Something like the following should work: + +``` + # Place this before the proxy_pass location + location ~ ^/ui(/.*)?$ { + root /var/www/html/garm-webui/; + } + + location / { + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Host $http_host; + + proxy_pass http://garm_backend; + proxy_set_header Host $Host; + proxy_redirect off; + } +``` + +This should allow you to override the default web UI embedded in GARM without updating the GARM binary. diff --git a/webapp/assets/_app/env.js b/webapp/assets/_app/env.js new file mode 100644 index 00000000..f5427da6 --- /dev/null +++ b/webapp/assets/_app/env.js @@ -0,0 +1 @@ +export const env={} \ No newline at end of file diff --git a/webapp/assets/_app/immutable/assets/0.BPrCR_r7.css b/webapp/assets/_app/immutable/assets/0.BPrCR_r7.css new file mode 100644 index 00000000..17f0a1ed --- /dev/null +++ b/webapp/assets/_app/immutable/assets/0.BPrCR_r7.css @@ -0,0 +1 @@ +/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-orange-50:oklch(98% .016 73.684);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-700:oklch(55.4% .135 66.442);--color-yellow-800:oklch(47.6% .114 61.907);--color-yellow-900:oklch(42.1% .095 57.708);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-green-900:oklch(39.3% .095 152.535);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-900:oklch(35.9% .144 278.697);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-xl:36rem;--container-2xl:42rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--tracking-wide:.025em;--tracking-wider:.05em;--radius-md:.375rem;--radius-lg:.5rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.top-4{top:calc(var(--spacing)*4)}.top-full{top:100%}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-4{right:calc(var(--spacing)*4)}.right-full{right:100%}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-full{left:100%}.z-0{z-index:0}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[60\]{z-index:60}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-4{margin-inline:calc(var(--spacing)*4)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-8{margin-top:calc(var(--spacing)*8)}.-mr-0\.5{margin-right:calc(var(--spacing)*-.5)}.-mr-1{margin-right:calc(var(--spacing)*-1)}.-mr-12{margin-right:calc(var(--spacing)*-12)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-2\.5{margin-right:calc(var(--spacing)*2.5)}.mr-3{margin-right:calc(var(--spacing)*3)}.mr-4{margin-right:calc(var(--spacing)*4)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.-ml-0\.5{margin-left:calc(var(--spacing)*-.5)}.-ml-1{margin-left:calc(var(--spacing)*-1)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-5{margin-left:calc(var(--spacing)*5)}.ml-6{margin-left:calc(var(--spacing)*6)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-0{height:calc(var(--spacing)*0)}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-16{height:calc(var(--spacing)*16)}.h-24{height:calc(var(--spacing)*24)}.h-48{height:calc(var(--spacing)*48)}.h-full{height:100%}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[90vh\]{max-height:90vh}.max-h-screen{max-height:100vh}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\[38px\]{min-height:38px}.min-h-screen{min-height:100vh}.w-0{width:calc(var(--spacing)*0)}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-64{width:calc(var(--spacing)*64)}.w-80{width:calc(var(--spacing)*80)}.w-auto{width:auto}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-2{gap:calc(var(--spacing)*2)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-6{gap:calc(var(--spacing)*6)}:where(.-space-y-px>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(-1px*var(--tw-space-y-reverse));margin-block-end:calc(-1px*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*8)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{-moz-column-gap:calc(var(--spacing)*4);column-gap:calc(var(--spacing)*4)}:where(.-space-x-px>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(-1px*var(--tw-space-x-reverse));margin-inline-end:calc(-1px*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*1)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*3)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-4>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*4)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-x-reverse)))}.gap-y-6{row-gap:calc(var(--spacing)*6)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-gray-200>:not(:last-child)){border-color:var(--color-gray-200)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-none{border-radius:0}.rounded-t-md{border-top-left-radius:var(--radius-md);border-top-right-radius:var(--radius-md)}.rounded-l-md{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-b-md{border-bottom-right-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l-0{border-left-style:var(--tw-border-style);border-left-width:0}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-blue-200{border-color:var(--color-blue-200)}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-600{border-color:var(--color-blue-600)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-red-300{border-color:var(--color-red-300)}.border-transparent{border-color:#0000}.border-white{border-color:var(--color-white)}.border-yellow-200{border-color:var(--color-yellow-200)}.border-t-gray-900{border-top-color:var(--color-gray-900)}.border-r-gray-900{border-right-color:var(--color-gray-900)}.border-b-gray-900{border-bottom-color:var(--color-gray-900)}.border-l-gray-900{border-left-color:var(--color-gray-900)}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-orange-50{background-color:var(--color-orange-50)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-purple-500{background-color:var(--color-purple-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-600{background-color:var(--color-red-600)}.bg-white{background-color:var(--color-white)}.bg-yellow-50{background-color:var(--color-yellow-50)}.bg-yellow-100{background-color:var(--color-yellow-100)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-gray-50{--tw-gradient-from:var(--color-gray-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-5{padding-top:calc(var(--spacing)*5)}.pt-6{padding-top:calc(var(--spacing)*6)}.pt-20{padding-top:calc(var(--spacing)*20)}.pr-3{padding-right:calc(var(--spacing)*3)}.pr-8{padding-right:calc(var(--spacing)*8)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-5{--tw-leading:calc(var(--spacing)*5);line-height:calc(var(--spacing)*5)}.leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-all{word-break:break-all}.text-black{color:var(--color-black)}.text-blue-400{color:var(--color-blue-400)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-indigo-600{color:var(--color-indigo-600)}.text-orange-700{color:var(--color-orange-700)}.text-purple-600{color:var(--color-purple-600)}.text-purple-700{color:var(--color-purple-700)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-red-900{color:var(--color-red-900)}.text-white{color:var(--color-white)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-600{color:var(--color-yellow-600)}.text-yellow-700{color:var(--color-yellow-700)}.text-yellow-800{color:var(--color-yellow-800)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.placeholder-gray-400::-moz-placeholder{color:var(--color-gray-400)}.placeholder-gray-400::placeholder{color:var(--color-gray-400)}.placeholder-gray-500::-moz-placeholder{color:var(--color-gray-500)}.placeholder-gray-500::placeholder{color:var(--color-gray-500)}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-blue-600\/20{--tw-ring-color:#155dfc33}@supports (color:color-mix(in lab,red,red)){.ring-blue-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-blue-600)20%,transparent)}}.ring-gray-500\/20{--tw-ring-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.ring-gray-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.ring-gray-600\/20{--tw-ring-color:#4a556533}@supports (color:color-mix(in lab,red,red)){.ring-gray-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-gray-600)20%,transparent)}}.ring-green-600\/20{--tw-ring-color:#00a54433}@supports (color:color-mix(in lab,red,red)){.ring-green-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-green-600)20%,transparent)}}.ring-orange-600\/20{--tw-ring-color:#f0510033}@supports (color:color-mix(in lab,red,red)){.ring-orange-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-orange-600)20%,transparent)}}.ring-purple-600\/20{--tw-ring-color:#9810fa33}@supports (color:color-mix(in lab,red,red)){.ring-purple-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-purple-600)20%,transparent)}}.ring-red-600\/20{--tw-ring-color:#e4001433}@supports (color:color-mix(in lab,red,red)){.ring-red-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-red-600)20%,transparent)}}.ring-yellow-600\/20{--tw-ring-color:#cd890033}@supports (color:color-mix(in lab,red,red)){.ring-yellow-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-yellow-600)20%,transparent)}}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ring-inset{--tw-ring-inset:inset}@media (hover:hover){.group-hover\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.first\:rounded-l-md:first-child{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.first\:border-l:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}@media (hover:hover){.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\:border-blue-400:hover{border-color:var(--color-blue-400)}.hover\:border-gray-400:hover{border-color:var(--color-gray-400)}.hover\:bg-blue-200:hover{background-color:var(--color-blue-200)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-red-200:hover{background-color:var(--color-red-200)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:text-blue-500:hover{color:var(--color-blue-500)}.hover\:text-blue-600:hover{color:var(--color-blue-600)}.hover\:text-gray-600:hover{color:var(--color-gray-600)}.hover\:text-gray-700:hover{color:var(--color-gray-700)}.hover\:text-gray-800:hover{color:var(--color-gray-800)}.hover\:text-gray-900:hover{color:var(--color-gray-900)}.hover\:text-green-500:hover{color:var(--color-green-500)}.hover\:text-green-900:hover{color:var(--color-green-900)}.hover\:text-indigo-900:hover{color:var(--color-indigo-900)}.hover\:text-red-500:hover{color:var(--color-red-500)}.hover\:text-red-900:hover{color:var(--color-red-900)}.hover\:text-yellow-300:hover{color:var(--color-yellow-300)}.hover\:text-yellow-500:hover{color:var(--color-yellow-500)}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:z-10:focus{z-index:10}.focus\:border-blue-500:focus{border-color:var(--color-blue-500)}.focus\:bg-red-200:focus{background-color:var(--color-red-200)}.focus\:placeholder-gray-400:focus::-moz-placeholder{color:var(--color-gray-400)}.focus\:placeholder-gray-400:focus::placeholder{color:var(--color-gray-400)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:ring-gray-500:focus{--tw-ring-color:var(--color-gray-500)}.focus\:ring-green-500:focus{--tw-ring-color:var(--color-green-500)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:ring-red-500:focus{--tw-ring-color:var(--color-red-500)}.focus\:ring-white:focus{--tw-ring-color:var(--color-white)}.focus\:ring-yellow-500:focus{--tw-ring-color:var(--color-yellow-500)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus\:ring-inset:focus{--tw-ring-inset:inset}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-400:disabled{background-color:var(--color-gray-400)}.disabled\:opacity-50:disabled{opacity:.5}@media (hover:hover){.disabled\:hover\:bg-gray-400:disabled:hover{background-color:var(--color-gray-400)}}@media (min-width:640px){.sm\:mx-auto{margin-inline:auto}.sm\:mt-0{margin-top:calc(var(--spacing)*0)}.sm\:ml-4{margin-left:calc(var(--spacing)*4)}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:w-full{width:100%}.sm\:max-w-md{max-width:var(--container-md)}.sm\:flex-1{flex:1}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:rounded-lg{border-radius:var(--radius-lg)}.sm\:p-6{padding:calc(var(--spacing)*6)}.sm\:px-6{padding-inline:calc(var(--spacing)*6)}.sm\:px-10{padding-inline:calc(var(--spacing)*10)}.sm\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media (min-width:768px){.md\:ml-2{margin-left:calc(var(--spacing)*2)}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}:where(.md\:space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*3)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-x-reverse)))}}@media (min-width:1024px){.lg\:fixed{position:fixed}.lg\:inset-y-0{inset-block:calc(var(--spacing)*0)}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-64{width:calc(var(--spacing)*64)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-col{flex-direction:column}.lg\:px-8{padding-inline:calc(var(--spacing)*8)}.lg\:pt-6{padding-top:calc(var(--spacing)*6)}.lg\:pl-64{padding-left:calc(var(--spacing)*64)}}.dark .dark\:block{display:block}.dark .dark\:hidden{display:none}:where(.dark .dark\:divide-gray-700>:not(:last-child)){border-color:var(--color-gray-700)}.dark .dark\:border-blue-700{border-color:var(--color-blue-700)}.dark .dark\:border-blue-800{border-color:var(--color-blue-800)}.dark .dark\:border-gray-600{border-color:var(--color-gray-600)}.dark .dark\:border-gray-700{border-color:var(--color-gray-700)}.dark .dark\:border-green-700{border-color:var(--color-green-700)}.dark .dark\:border-red-600{border-color:var(--color-red-600)}.dark .dark\:border-red-700{border-color:var(--color-red-700)}.dark .dark\:border-red-800{border-color:var(--color-red-800)}.dark .dark\:border-yellow-700{border-color:var(--color-yellow-700)}.dark .dark\:border-yellow-800{border-color:var(--color-yellow-800)}.dark .dark\:bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.dark .dark\:bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.dark .dark\:bg-blue-900{background-color:var(--color-blue-900)}.dark .dark\:bg-blue-900\/20{background-color:#1c398e33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-blue-900\/20{background-color:color-mix(in oklab,var(--color-blue-900)20%,transparent)}}.dark .dark\:bg-blue-900\/50{background-color:#1c398e80}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-blue-900\/50{background-color:color-mix(in oklab,var(--color-blue-900)50%,transparent)}}.dark .dark\:bg-gray-500\/10{background-color:#6a72821a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-gray-500\/10{background-color:color-mix(in oklab,var(--color-gray-500)10%,transparent)}}.dark .dark\:bg-gray-600{background-color:var(--color-gray-600)}.dark .dark\:bg-gray-700{background-color:var(--color-gray-700)}.dark .dark\:bg-gray-800{background-color:var(--color-gray-800)}.dark .dark\:bg-gray-800\/50{background-color:#1e293980}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-gray-800\/50{background-color:color-mix(in oklab,var(--color-gray-800)50%,transparent)}}.dark .dark\:bg-gray-900{background-color:var(--color-gray-900)}.dark .dark\:bg-gray-900\/50{background-color:#10182880}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-gray-900\/50{background-color:color-mix(in oklab,var(--color-gray-900)50%,transparent)}}.dark .dark\:bg-green-500\/10{background-color:#00c7581a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-green-500\/10{background-color:color-mix(in oklab,var(--color-green-500)10%,transparent)}}.dark .dark\:bg-green-900{background-color:var(--color-green-900)}.dark .dark\:bg-green-900\/50{background-color:#0d542b80}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-green-900\/50{background-color:color-mix(in oklab,var(--color-green-900)50%,transparent)}}.dark .dark\:bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.dark .dark\:bg-purple-500\/10{background-color:#ac4bff1a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-purple-500\/10{background-color:color-mix(in oklab,var(--color-purple-500)10%,transparent)}}.dark .dark\:bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.dark .dark\:bg-red-700{background-color:var(--color-red-700)}.dark .dark\:bg-red-800{background-color:var(--color-red-800)}.dark .dark\:bg-red-900{background-color:var(--color-red-900)}.dark .dark\:bg-red-900\/20{background-color:#82181a33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-red-900\/20{background-color:color-mix(in oklab,var(--color-red-900)20%,transparent)}}.dark .dark\:bg-red-900\/50{background-color:#82181a80}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-red-900\/50{background-color:color-mix(in oklab,var(--color-red-900)50%,transparent)}}.dark .dark\:bg-yellow-500\/10{background-color:#edb2001a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-yellow-500\/10{background-color:color-mix(in oklab,var(--color-yellow-500)10%,transparent)}}.dark .dark\:bg-yellow-900{background-color:var(--color-yellow-900)}.dark .dark\:bg-yellow-900\/20{background-color:#733e0a33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-yellow-900\/20{background-color:color-mix(in oklab,var(--color-yellow-900)20%,transparent)}}.dark .dark\:from-gray-800{--tw-gradient-from:var(--color-gray-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark .dark\:to-gray-700{--tw-gradient-to:var(--color-gray-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark .dark\:text-blue-200{color:var(--color-blue-200)}.dark .dark\:text-blue-300{color:var(--color-blue-300)}.dark .dark\:text-blue-400{color:var(--color-blue-400)}.dark .dark\:text-gray-200{color:var(--color-gray-200)}.dark .dark\:text-gray-300{color:var(--color-gray-300)}.dark .dark\:text-gray-400{color:var(--color-gray-400)}.dark .dark\:text-gray-500{color:var(--color-gray-500)}.dark .dark\:text-green-200{color:var(--color-green-200)}.dark .dark\:text-green-300{color:var(--color-green-300)}.dark .dark\:text-green-400{color:var(--color-green-400)}.dark .dark\:text-indigo-400{color:var(--color-indigo-400)}.dark .dark\:text-orange-400{color:var(--color-orange-400)}.dark .dark\:text-purple-400{color:var(--color-purple-400)}.dark .dark\:text-red-100{color:var(--color-red-100)}.dark .dark\:text-red-200{color:var(--color-red-200)}.dark .dark\:text-red-300{color:var(--color-red-300)}.dark .dark\:text-red-400{color:var(--color-red-400)}.dark .dark\:text-white{color:var(--color-white)}.dark .dark\:text-yellow-200{color:var(--color-yellow-200)}.dark .dark\:text-yellow-300{color:var(--color-yellow-300)}.dark .dark\:text-yellow-400{color:var(--color-yellow-400)}.dark .dark\:placeholder-gray-400::-moz-placeholder{color:var(--color-gray-400)}.dark .dark\:placeholder-gray-400::placeholder{color:var(--color-gray-400)}.dark .dark\:placeholder-gray-500::-moz-placeholder{color:var(--color-gray-500)}.dark .dark\:placeholder-gray-500::placeholder{color:var(--color-gray-500)}.dark .dark\:ring-blue-400\/20{--tw-ring-color:#54a2ff33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-blue-400\/20{--tw-ring-color:color-mix(in oklab,var(--color-blue-400)20%,transparent)}}.dark .dark\:ring-blue-400\/30{--tw-ring-color:#54a2ff4d}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-blue-400\/30{--tw-ring-color:color-mix(in oklab,var(--color-blue-400)30%,transparent)}}.dark .dark\:ring-blue-500\/20{--tw-ring-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-blue-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.dark .dark\:ring-gray-400\/20{--tw-ring-color:#99a1af33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-gray-400\/20{--tw-ring-color:color-mix(in oklab,var(--color-gray-400)20%,transparent)}}.dark .dark\:ring-gray-400\/30{--tw-ring-color:#99a1af4d}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-gray-400\/30{--tw-ring-color:color-mix(in oklab,var(--color-gray-400)30%,transparent)}}.dark .dark\:ring-gray-500\/20{--tw-ring-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-gray-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.dark .dark\:ring-green-400\/20{--tw-ring-color:#05df7233}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-green-400\/20{--tw-ring-color:color-mix(in oklab,var(--color-green-400)20%,transparent)}}.dark .dark\:ring-green-400\/30{--tw-ring-color:#05df724d}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-green-400\/30{--tw-ring-color:color-mix(in oklab,var(--color-green-400)30%,transparent)}}.dark .dark\:ring-green-500\/20{--tw-ring-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-green-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.dark .dark\:ring-orange-500\/20{--tw-ring-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-orange-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.dark .dark\:ring-purple-500\/20{--tw-ring-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-purple-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.dark .dark\:ring-red-400\/20{--tw-ring-color:#ff656833}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-red-400\/20{--tw-ring-color:color-mix(in oklab,var(--color-red-400)20%,transparent)}}.dark .dark\:ring-red-400\/30{--tw-ring-color:#ff65684d}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-red-400\/30{--tw-ring-color:color-mix(in oklab,var(--color-red-400)30%,transparent)}}.dark .dark\:ring-red-500\/20{--tw-ring-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-red-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.dark .dark\:ring-yellow-400\/30{--tw-ring-color:#fac8004d}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-yellow-400\/30{--tw-ring-color:color-mix(in oklab,var(--color-yellow-400)30%,transparent)}}.dark .dark\:ring-yellow-500\/20{--tw-ring-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-yellow-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}@media (hover:hover){.dark .dark\:hover\:border-blue-400:hover{border-color:var(--color-blue-400)}.dark .dark\:hover\:border-gray-500:hover{border-color:var(--color-gray-500)}.dark .dark\:hover\:bg-blue-800:hover{background-color:var(--color-blue-800)}.dark .dark\:hover\:bg-gray-500:hover{background-color:var(--color-gray-500)}.dark .dark\:hover\:bg-gray-600:hover{background-color:var(--color-gray-600)}.dark .dark\:hover\:bg-gray-700:hover{background-color:var(--color-gray-700)}.dark .dark\:hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.dark .dark\:hover\:bg-red-700:hover{background-color:var(--color-red-700)}.dark .dark\:hover\:bg-red-800:hover{background-color:var(--color-red-800)}.dark .dark\:hover\:text-blue-300:hover{color:var(--color-blue-300)}.dark .dark\:hover\:text-gray-100:hover{color:var(--color-gray-100)}.dark .dark\:hover\:text-gray-300:hover{color:var(--color-gray-300)}.dark .dark\:hover\:text-green-300:hover{color:var(--color-green-300)}.dark .dark\:hover\:text-indigo-300:hover{color:var(--color-indigo-300)}.dark .dark\:hover\:text-red-300:hover{color:var(--color-red-300)}.dark .dark\:hover\:text-white:hover{color:var(--color-white)}}.dark .dark\:focus\:bg-red-700:focus{background-color:var(--color-red-700)}.dark .dark\:focus\:ring-offset-gray-900:focus{--tw-ring-offset-color:var(--color-gray-900)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/webapp/assets/_app/immutable/assets/_layout.BPrCR_r7.css b/webapp/assets/_app/immutable/assets/_layout.BPrCR_r7.css new file mode 100644 index 00000000..17f0a1ed --- /dev/null +++ b/webapp/assets/_app/immutable/assets/_layout.BPrCR_r7.css @@ -0,0 +1 @@ +/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */@layer properties{@supports ((-webkit-hyphens:none) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-800:oklch(44.4% .177 26.899);--color-red-900:oklch(39.6% .141 25.723);--color-orange-50:oklch(98% .016 73.684);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-700:oklch(55.4% .135 66.442);--color-yellow-800:oklch(47.6% .114 61.907);--color-yellow-900:oklch(42.1% .095 57.708);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-green-900:oklch(39.3% .095 152.535);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-indigo-600:oklch(51.1% .262 276.966);--color-indigo-900:oklch(35.9% .144 278.697);--color-purple-50:oklch(97.7% .014 308.299);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklch(55.8% .288 302.321);--color-purple-700:oklch(49.6% .265 301.924);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-xl:36rem;--container-2xl:42rem;--container-6xl:72rem;--container-7xl:80rem;--text-xs:.75rem;--text-xs--line-height:calc(1/.75);--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75/1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75/1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2/1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--tracking-wide:.025em;--tracking-wider:.05em;--radius-md:.375rem;--radius-lg:.5rem;--ease-in-out:cubic-bezier(.4,0,.2,1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::-moz-placeholder{opacity:1}::placeholder{opacity:1}@supports (not (-webkit-appearance:-apple-pay-button)) or (contain-intrinsic-size:1px){::-moz-placeholder{color:currentColor}::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::-moz-placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}html{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing)*0)}.inset-y-0{inset-block:calc(var(--spacing)*0)}.top-0{top:calc(var(--spacing)*0)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing)*2)}.top-4{top:calc(var(--spacing)*4)}.top-full{top:100%}.right-0{right:calc(var(--spacing)*0)}.right-2{right:calc(var(--spacing)*2)}.right-4{right:calc(var(--spacing)*4)}.right-full{right:100%}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing)*0)}.left-1\/2{left:50%}.left-full{left:100%}.z-0{z-index:0}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[60\]{z-index:60}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.mx-1{margin-inline:calc(var(--spacing)*1)}.mx-2{margin-inline:calc(var(--spacing)*2)}.mx-4{margin-inline:calc(var(--spacing)*4)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing)*.5)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.mt-3{margin-top:calc(var(--spacing)*3)}.mt-4{margin-top:calc(var(--spacing)*4)}.mt-5{margin-top:calc(var(--spacing)*5)}.mt-6{margin-top:calc(var(--spacing)*6)}.mt-8{margin-top:calc(var(--spacing)*8)}.-mr-0\.5{margin-right:calc(var(--spacing)*-.5)}.-mr-1{margin-right:calc(var(--spacing)*-1)}.-mr-12{margin-right:calc(var(--spacing)*-12)}.mr-2{margin-right:calc(var(--spacing)*2)}.mr-2\.5{margin-right:calc(var(--spacing)*2.5)}.mr-3{margin-right:calc(var(--spacing)*3)}.mr-4{margin-right:calc(var(--spacing)*4)}.mb-1{margin-bottom:calc(var(--spacing)*1)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.mb-3{margin-bottom:calc(var(--spacing)*3)}.mb-4{margin-bottom:calc(var(--spacing)*4)}.mb-6{margin-bottom:calc(var(--spacing)*6)}.-ml-0\.5{margin-left:calc(var(--spacing)*-.5)}.-ml-1{margin-left:calc(var(--spacing)*-1)}.ml-1{margin-left:calc(var(--spacing)*1)}.ml-2{margin-left:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.ml-4{margin-left:calc(var(--spacing)*4)}.ml-5{margin-left:calc(var(--spacing)*5)}.ml-6{margin-left:calc(var(--spacing)*6)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-0{height:calc(var(--spacing)*0)}.h-2{height:calc(var(--spacing)*2)}.h-2\.5{height:calc(var(--spacing)*2.5)}.h-3{height:calc(var(--spacing)*3)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-6{height:calc(var(--spacing)*6)}.h-8{height:calc(var(--spacing)*8)}.h-10{height:calc(var(--spacing)*10)}.h-12{height:calc(var(--spacing)*12)}.h-16{height:calc(var(--spacing)*16)}.h-24{height:calc(var(--spacing)*24)}.h-48{height:calc(var(--spacing)*48)}.h-full{height:100%}.max-h-96{max-height:calc(var(--spacing)*96)}.max-h-\[90vh\]{max-height:90vh}.max-h-screen{max-height:100vh}.min-h-0{min-height:calc(var(--spacing)*0)}.min-h-\[38px\]{min-height:38px}.min-h-screen{min-height:100vh}.w-0{width:calc(var(--spacing)*0)}.w-2{width:calc(var(--spacing)*2)}.w-2\.5{width:calc(var(--spacing)*2.5)}.w-3{width:calc(var(--spacing)*3)}.w-4{width:calc(var(--spacing)*4)}.w-5{width:calc(var(--spacing)*5)}.w-6{width:calc(var(--spacing)*6)}.w-8{width:calc(var(--spacing)*8)}.w-10{width:calc(var(--spacing)*10)}.w-12{width:calc(var(--spacing)*12)}.w-16{width:calc(var(--spacing)*16)}.w-20{width:calc(var(--spacing)*20)}.w-64{width:calc(var(--spacing)*64)}.w-80{width:calc(var(--spacing)*80)}.w-auto{width:auto}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-6xl{max-width:var(--container-6xl)}.max-w-7xl{max-width:var(--container-7xl)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing)*0)}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x)var(--tw-translate-y)}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing)*0)}.gap-2{gap:calc(var(--spacing)*2)}.gap-4{gap:calc(var(--spacing)*4)}.gap-5{gap:calc(var(--spacing)*5)}.gap-6{gap:calc(var(--spacing)*6)}:where(.-space-y-px>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(-1px*var(--tw-space-y-reverse));margin-block-end:calc(-1px*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*1)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*2)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*3)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*4)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*6)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*6)*calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing)*8)*var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing)*8)*calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{-moz-column-gap:calc(var(--spacing)*4);column-gap:calc(var(--spacing)*4)}:where(.-space-x-px>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(-1px*var(--tw-space-x-reverse));margin-inline-end:calc(-1px*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-1>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*1)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*1)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*2)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*2)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*3)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-4>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*4)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*4)*calc(1 - var(--tw-space-x-reverse)))}.gap-y-6{row-gap:calc(var(--spacing)*6)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px*var(--tw-divide-y-reverse));border-bottom-width:calc(1px*calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-gray-200>:not(:last-child)){border-color:var(--color-gray-200)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.scroll-smooth{scroll-behavior:smooth}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-none{border-radius:0}.rounded-t-md{border-top-left-radius:var(--radius-md);border-top-right-radius:var(--radius-md)}.rounded-l-md{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-md{border-top-right-radius:var(--radius-md);border-bottom-right-radius:var(--radius-md)}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-b-md{border-bottom-right-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l-0{border-left-style:var(--tw-border-style);border-left-width:0}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-blue-200{border-color:var(--color-blue-200)}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-600{border-color:var(--color-blue-600)}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-green-200{border-color:var(--color-green-200)}.border-red-200{border-color:var(--color-red-200)}.border-red-300{border-color:var(--color-red-300)}.border-transparent{border-color:#0000}.border-white{border-color:var(--color-white)}.border-yellow-200{border-color:var(--color-yellow-200)}.border-t-gray-900{border-top-color:var(--color-gray-900)}.border-r-gray-900{border-right-color:var(--color-gray-900)}.border-b-gray-900{border-bottom-color:var(--color-gray-900)}.border-l-gray-900{border-left-color:var(--color-gray-900)}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black)30%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-orange-50{background-color:var(--color-orange-50)}.bg-purple-50{background-color:var(--color-purple-50)}.bg-purple-500{background-color:var(--color-purple-500)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-600{background-color:var(--color-red-600)}.bg-white{background-color:var(--color-white)}.bg-yellow-50{background-color:var(--color-yellow-50)}.bg-yellow-100{background-color:var(--color-yellow-100)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-gray-50{--tw-gradient-from:var(--color-gray-50);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.to-white{--tw-gradient-to:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.p-1{padding:calc(var(--spacing)*1)}.p-2{padding:calc(var(--spacing)*2)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-5{padding:calc(var(--spacing)*5)}.p-6{padding:calc(var(--spacing)*6)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-2\.5{padding-inline:calc(var(--spacing)*2.5)}.px-3{padding-inline:calc(var(--spacing)*3)}.px-4{padding-inline:calc(var(--spacing)*4)}.px-6{padding-inline:calc(var(--spacing)*6)}.py-0\.5{padding-block:calc(var(--spacing)*.5)}.py-1{padding-block:calc(var(--spacing)*1)}.py-2{padding-block:calc(var(--spacing)*2)}.py-3{padding-block:calc(var(--spacing)*3)}.py-4{padding-block:calc(var(--spacing)*4)}.py-5{padding-block:calc(var(--spacing)*5)}.py-6{padding-block:calc(var(--spacing)*6)}.py-8{padding-block:calc(var(--spacing)*8)}.py-12{padding-block:calc(var(--spacing)*12)}.pt-2{padding-top:calc(var(--spacing)*2)}.pt-4{padding-top:calc(var(--spacing)*4)}.pt-5{padding-top:calc(var(--spacing)*5)}.pt-6{padding-top:calc(var(--spacing)*6)}.pt-20{padding-top:calc(var(--spacing)*20)}.pr-3{padding-right:calc(var(--spacing)*3)}.pr-8{padding-right:calc(var(--spacing)*8)}.pb-2{padding-bottom:calc(var(--spacing)*2)}.pb-4{padding-bottom:calc(var(--spacing)*4)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-3{padding-left:calc(var(--spacing)*3)}.pl-10{padding-left:calc(var(--spacing)*10)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-5{--tw-leading:calc(var(--spacing)*5);line-height:calc(var(--spacing)*5)}.leading-6{--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-all{word-break:break-all}.text-black{color:var(--color-black)}.text-blue-400{color:var(--color-blue-400)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-indigo-600{color:var(--color-indigo-600)}.text-orange-700{color:var(--color-orange-700)}.text-purple-600{color:var(--color-purple-600)}.text-purple-700{color:var(--color-purple-700)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-800{color:var(--color-red-800)}.text-red-900{color:var(--color-red-900)}.text-white{color:var(--color-white)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-600{color:var(--color-yellow-600)}.text-yellow-700{color:var(--color-yellow-700)}.text-yellow-800{color:var(--color-yellow-800)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.placeholder-gray-400::-moz-placeholder{color:var(--color-gray-400)}.placeholder-gray-400::placeholder{color:var(--color-gray-400)}.placeholder-gray-500::-moz-placeholder{color:var(--color-gray-500)}.placeholder-gray-500::placeholder{color:var(--color-gray-500)}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a),0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring,.ring-1{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-blue-600\/20{--tw-ring-color:#155dfc33}@supports (color:color-mix(in lab,red,red)){.ring-blue-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-blue-600)20%,transparent)}}.ring-gray-500\/20{--tw-ring-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.ring-gray-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.ring-gray-600\/20{--tw-ring-color:#4a556533}@supports (color:color-mix(in lab,red,red)){.ring-gray-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-gray-600)20%,transparent)}}.ring-green-600\/20{--tw-ring-color:#00a54433}@supports (color:color-mix(in lab,red,red)){.ring-green-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-green-600)20%,transparent)}}.ring-orange-600\/20{--tw-ring-color:#f0510033}@supports (color:color-mix(in lab,red,red)){.ring-orange-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-orange-600)20%,transparent)}}.ring-purple-600\/20{--tw-ring-color:#9810fa33}@supports (color:color-mix(in lab,red,red)){.ring-purple-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-purple-600)20%,transparent)}}.ring-red-600\/20{--tw-ring-color:#e4001433}@supports (color:color-mix(in lab,red,red)){.ring-red-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-red-600)20%,transparent)}}.ring-yellow-600\/20{--tw-ring-color:#cd890033}@supports (color:color-mix(in lab,red,red)){.ring-yellow-600\/20{--tw-ring-color:color-mix(in oklab,var(--color-yellow-600)20%,transparent)}}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ring-inset{--tw-ring-inset:inset}@media (hover:hover){.group-hover\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.first\:rounded-l-md:first-child{border-top-left-radius:var(--radius-md);border-bottom-left-radius:var(--radius-md)}.first\:border-l:first-child{border-left-style:var(--tw-border-style);border-left-width:1px}@media (hover:hover){.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\:border-blue-400:hover{border-color:var(--color-blue-400)}.hover\:border-gray-400:hover{border-color:var(--color-gray-400)}.hover\:bg-blue-200:hover{background-color:var(--color-blue-200)}.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}.hover\:bg-red-200:hover{background-color:var(--color-red-200)}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:text-blue-500:hover{color:var(--color-blue-500)}.hover\:text-blue-600:hover{color:var(--color-blue-600)}.hover\:text-gray-600:hover{color:var(--color-gray-600)}.hover\:text-gray-700:hover{color:var(--color-gray-700)}.hover\:text-gray-800:hover{color:var(--color-gray-800)}.hover\:text-gray-900:hover{color:var(--color-gray-900)}.hover\:text-green-500:hover{color:var(--color-green-500)}.hover\:text-green-900:hover{color:var(--color-green-900)}.hover\:text-indigo-900:hover{color:var(--color-indigo-900)}.hover\:text-red-500:hover{color:var(--color-red-500)}.hover\:text-red-900:hover{color:var(--color-red-900)}.hover\:text-yellow-300:hover{color:var(--color-yellow-300)}.hover\:text-yellow-500:hover{color:var(--color-yellow-500)}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a),0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.hover\:shadow-sm:hover{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:z-10:focus{z-index:10}.focus\:border-blue-500:focus{border-color:var(--color-blue-500)}.focus\:bg-red-200:focus{background-color:var(--color-red-200)}.focus\:placeholder-gray-400:focus::-moz-placeholder{color:var(--color-gray-400)}.focus\:placeholder-gray-400:focus::placeholder{color:var(--color-gray-400)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(1px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,)0 0 0 calc(2px + var(--tw-ring-offset-width))var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-blue-500:focus{--tw-ring-color:var(--color-blue-500)}.focus\:ring-gray-500:focus{--tw-ring-color:var(--color-gray-500)}.focus\:ring-green-500:focus{--tw-ring-color:var(--color-green-500)}.focus\:ring-indigo-500:focus{--tw-ring-color:var(--color-indigo-500)}.focus\:ring-red-500:focus{--tw-ring-color:var(--color-red-500)}.focus\:ring-white:focus{--tw-ring-color:var(--color-white)}.focus\:ring-yellow-500:focus{--tw-ring-color:var(--color-yellow-500)}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px;--tw-ring-offset-shadow:var(--tw-ring-inset,)0 0 0 var(--tw-ring-offset-width)var(--tw-ring-offset-color)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus\:ring-inset:focus{--tw-ring-inset:inset}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-gray-400:disabled{background-color:var(--color-gray-400)}.disabled\:opacity-50:disabled{opacity:.5}@media (hover:hover){.disabled\:hover\:bg-gray-400:disabled:hover{background-color:var(--color-gray-400)}}@media (min-width:640px){.sm\:mx-auto{margin-inline:auto}.sm\:mt-0{margin-top:calc(var(--spacing)*0)}.sm\:ml-4{margin-left:calc(var(--spacing)*4)}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:w-full{width:100%}.sm\:max-w-md{max-width:var(--container-md)}.sm\:flex-1{flex:1}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:rounded-lg{border-radius:var(--radius-lg)}.sm\:p-6{padding:calc(var(--spacing)*6)}.sm\:px-6{padding-inline:calc(var(--spacing)*6)}.sm\:px-10{padding-inline:calc(var(--spacing)*10)}.sm\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}}@media (min-width:768px){.md\:ml-2{margin-left:calc(var(--spacing)*2)}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}:where(.md\:space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing)*3)*var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing)*3)*calc(1 - var(--tw-space-x-reverse)))}}@media (min-width:1024px){.lg\:fixed{position:fixed}.lg\:inset-y-0{inset-block:calc(var(--spacing)*0)}.lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:w-64{width:calc(var(--spacing)*64)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:flex-col{flex-direction:column}.lg\:px-8{padding-inline:calc(var(--spacing)*8)}.lg\:pt-6{padding-top:calc(var(--spacing)*6)}.lg\:pl-64{padding-left:calc(var(--spacing)*64)}}.dark .dark\:block{display:block}.dark .dark\:hidden{display:none}:where(.dark .dark\:divide-gray-700>:not(:last-child)){border-color:var(--color-gray-700)}.dark .dark\:border-blue-700{border-color:var(--color-blue-700)}.dark .dark\:border-blue-800{border-color:var(--color-blue-800)}.dark .dark\:border-gray-600{border-color:var(--color-gray-600)}.dark .dark\:border-gray-700{border-color:var(--color-gray-700)}.dark .dark\:border-green-700{border-color:var(--color-green-700)}.dark .dark\:border-red-600{border-color:var(--color-red-600)}.dark .dark\:border-red-700{border-color:var(--color-red-700)}.dark .dark\:border-red-800{border-color:var(--color-red-800)}.dark .dark\:border-yellow-700{border-color:var(--color-yellow-700)}.dark .dark\:border-yellow-800{border-color:var(--color-yellow-800)}.dark .dark\:bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-black\/50{background-color:color-mix(in oklab,var(--color-black)50%,transparent)}}.dark .dark\:bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500)10%,transparent)}}.dark .dark\:bg-blue-900{background-color:var(--color-blue-900)}.dark .dark\:bg-blue-900\/20{background-color:#1c398e33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-blue-900\/20{background-color:color-mix(in oklab,var(--color-blue-900)20%,transparent)}}.dark .dark\:bg-blue-900\/50{background-color:#1c398e80}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-blue-900\/50{background-color:color-mix(in oklab,var(--color-blue-900)50%,transparent)}}.dark .dark\:bg-gray-500\/10{background-color:#6a72821a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-gray-500\/10{background-color:color-mix(in oklab,var(--color-gray-500)10%,transparent)}}.dark .dark\:bg-gray-600{background-color:var(--color-gray-600)}.dark .dark\:bg-gray-700{background-color:var(--color-gray-700)}.dark .dark\:bg-gray-800{background-color:var(--color-gray-800)}.dark .dark\:bg-gray-800\/50{background-color:#1e293980}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-gray-800\/50{background-color:color-mix(in oklab,var(--color-gray-800)50%,transparent)}}.dark .dark\:bg-gray-900{background-color:var(--color-gray-900)}.dark .dark\:bg-gray-900\/50{background-color:#10182880}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-gray-900\/50{background-color:color-mix(in oklab,var(--color-gray-900)50%,transparent)}}.dark .dark\:bg-green-500\/10{background-color:#00c7581a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-green-500\/10{background-color:color-mix(in oklab,var(--color-green-500)10%,transparent)}}.dark .dark\:bg-green-900{background-color:var(--color-green-900)}.dark .dark\:bg-green-900\/50{background-color:#0d542b80}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-green-900\/50{background-color:color-mix(in oklab,var(--color-green-900)50%,transparent)}}.dark .dark\:bg-orange-500\/10{background-color:#fe6e001a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-orange-500\/10{background-color:color-mix(in oklab,var(--color-orange-500)10%,transparent)}}.dark .dark\:bg-purple-500\/10{background-color:#ac4bff1a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-purple-500\/10{background-color:color-mix(in oklab,var(--color-purple-500)10%,transparent)}}.dark .dark\:bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500)10%,transparent)}}.dark .dark\:bg-red-700{background-color:var(--color-red-700)}.dark .dark\:bg-red-800{background-color:var(--color-red-800)}.dark .dark\:bg-red-900{background-color:var(--color-red-900)}.dark .dark\:bg-red-900\/20{background-color:#82181a33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-red-900\/20{background-color:color-mix(in oklab,var(--color-red-900)20%,transparent)}}.dark .dark\:bg-red-900\/50{background-color:#82181a80}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-red-900\/50{background-color:color-mix(in oklab,var(--color-red-900)50%,transparent)}}.dark .dark\:bg-yellow-500\/10{background-color:#edb2001a}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-yellow-500\/10{background-color:color-mix(in oklab,var(--color-yellow-500)10%,transparent)}}.dark .dark\:bg-yellow-900{background-color:var(--color-yellow-900)}.dark .dark\:bg-yellow-900\/20{background-color:#733e0a33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:bg-yellow-900\/20{background-color:color-mix(in oklab,var(--color-yellow-900)20%,transparent)}}.dark .dark\:from-gray-800{--tw-gradient-from:var(--color-gray-800);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark .dark\:to-gray-700{--tw-gradient-to:var(--color-gray-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position),var(--tw-gradient-from)var(--tw-gradient-from-position),var(--tw-gradient-to)var(--tw-gradient-to-position))}.dark .dark\:text-blue-200{color:var(--color-blue-200)}.dark .dark\:text-blue-300{color:var(--color-blue-300)}.dark .dark\:text-blue-400{color:var(--color-blue-400)}.dark .dark\:text-gray-200{color:var(--color-gray-200)}.dark .dark\:text-gray-300{color:var(--color-gray-300)}.dark .dark\:text-gray-400{color:var(--color-gray-400)}.dark .dark\:text-gray-500{color:var(--color-gray-500)}.dark .dark\:text-green-200{color:var(--color-green-200)}.dark .dark\:text-green-300{color:var(--color-green-300)}.dark .dark\:text-green-400{color:var(--color-green-400)}.dark .dark\:text-indigo-400{color:var(--color-indigo-400)}.dark .dark\:text-orange-400{color:var(--color-orange-400)}.dark .dark\:text-purple-400{color:var(--color-purple-400)}.dark .dark\:text-red-100{color:var(--color-red-100)}.dark .dark\:text-red-200{color:var(--color-red-200)}.dark .dark\:text-red-300{color:var(--color-red-300)}.dark .dark\:text-red-400{color:var(--color-red-400)}.dark .dark\:text-white{color:var(--color-white)}.dark .dark\:text-yellow-200{color:var(--color-yellow-200)}.dark .dark\:text-yellow-300{color:var(--color-yellow-300)}.dark .dark\:text-yellow-400{color:var(--color-yellow-400)}.dark .dark\:placeholder-gray-400::-moz-placeholder{color:var(--color-gray-400)}.dark .dark\:placeholder-gray-400::placeholder{color:var(--color-gray-400)}.dark .dark\:placeholder-gray-500::-moz-placeholder{color:var(--color-gray-500)}.dark .dark\:placeholder-gray-500::placeholder{color:var(--color-gray-500)}.dark .dark\:ring-blue-400\/20{--tw-ring-color:#54a2ff33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-blue-400\/20{--tw-ring-color:color-mix(in oklab,var(--color-blue-400)20%,transparent)}}.dark .dark\:ring-blue-400\/30{--tw-ring-color:#54a2ff4d}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-blue-400\/30{--tw-ring-color:color-mix(in oklab,var(--color-blue-400)30%,transparent)}}.dark .dark\:ring-blue-500\/20{--tw-ring-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-blue-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-blue-500)20%,transparent)}}.dark .dark\:ring-gray-400\/20{--tw-ring-color:#99a1af33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-gray-400\/20{--tw-ring-color:color-mix(in oklab,var(--color-gray-400)20%,transparent)}}.dark .dark\:ring-gray-400\/30{--tw-ring-color:#99a1af4d}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-gray-400\/30{--tw-ring-color:color-mix(in oklab,var(--color-gray-400)30%,transparent)}}.dark .dark\:ring-gray-500\/20{--tw-ring-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-gray-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-gray-500)20%,transparent)}}.dark .dark\:ring-green-400\/20{--tw-ring-color:#05df7233}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-green-400\/20{--tw-ring-color:color-mix(in oklab,var(--color-green-400)20%,transparent)}}.dark .dark\:ring-green-400\/30{--tw-ring-color:#05df724d}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-green-400\/30{--tw-ring-color:color-mix(in oklab,var(--color-green-400)30%,transparent)}}.dark .dark\:ring-green-500\/20{--tw-ring-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-green-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-green-500)20%,transparent)}}.dark .dark\:ring-orange-500\/20{--tw-ring-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-orange-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-orange-500)20%,transparent)}}.dark .dark\:ring-purple-500\/20{--tw-ring-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-purple-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-purple-500)20%,transparent)}}.dark .dark\:ring-red-400\/20{--tw-ring-color:#ff656833}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-red-400\/20{--tw-ring-color:color-mix(in oklab,var(--color-red-400)20%,transparent)}}.dark .dark\:ring-red-400\/30{--tw-ring-color:#ff65684d}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-red-400\/30{--tw-ring-color:color-mix(in oklab,var(--color-red-400)30%,transparent)}}.dark .dark\:ring-red-500\/20{--tw-ring-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-red-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-red-500)20%,transparent)}}.dark .dark\:ring-yellow-400\/30{--tw-ring-color:#fac8004d}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-yellow-400\/30{--tw-ring-color:color-mix(in oklab,var(--color-yellow-400)30%,transparent)}}.dark .dark\:ring-yellow-500\/20{--tw-ring-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.dark .dark\:ring-yellow-500\/20{--tw-ring-color:color-mix(in oklab,var(--color-yellow-500)20%,transparent)}}@media (hover:hover){.dark .dark\:hover\:border-blue-400:hover{border-color:var(--color-blue-400)}.dark .dark\:hover\:border-gray-500:hover{border-color:var(--color-gray-500)}.dark .dark\:hover\:bg-blue-800:hover{background-color:var(--color-blue-800)}.dark .dark\:hover\:bg-gray-500:hover{background-color:var(--color-gray-500)}.dark .dark\:hover\:bg-gray-600:hover{background-color:var(--color-gray-600)}.dark .dark\:hover\:bg-gray-700:hover{background-color:var(--color-gray-700)}.dark .dark\:hover\:bg-gray-800:hover{background-color:var(--color-gray-800)}.dark .dark\:hover\:bg-red-700:hover{background-color:var(--color-red-700)}.dark .dark\:hover\:bg-red-800:hover{background-color:var(--color-red-800)}.dark .dark\:hover\:text-blue-300:hover{color:var(--color-blue-300)}.dark .dark\:hover\:text-gray-100:hover{color:var(--color-gray-100)}.dark .dark\:hover\:text-gray-300:hover{color:var(--color-gray-300)}.dark .dark\:hover\:text-green-300:hover{color:var(--color-green-300)}.dark .dark\:hover\:text-indigo-300:hover{color:var(--color-indigo-300)}.dark .dark\:hover\:text-red-300:hover{color:var(--color-red-300)}.dark .dark\:hover\:text-white:hover{color:var(--color-white)}}.dark .dark\:focus\:bg-red-700:focus{background-color:var(--color-red-700)}.dark .dark\:focus\:ring-offset-gray-900:focus{--tw-ring-offset-color:var(--color-gray-900)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/webapp/assets/_app/immutable/chunks/5WA7h8uK.js b/webapp/assets/_app/immutable/chunks/5WA7h8uK.js new file mode 100644 index 00000000..04989407 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/5WA7h8uK.js @@ -0,0 +1 @@ +import{M as K,K as T,L as j,N as C,_ as F,a0 as q,a1 as $,Y as z,a2 as x,O as G,P as A,Q as H,at as J,R as Z,aa as Q,U as V,T as W,au as D,m as X,av as k,s as U,J as ee,g as m,aw as re,ax as ne,ay as w,az as se,aA as M,ar as ae,q as ie,aB as te,aj as R,aC as ue,a6 as fe,aD as le,u as oe,aE as ce,aF as de,aG as _e,aH as N,aI as L,aJ as pe,aK as ve,S as Y,aL as B,aM as S}from"./D8EpLgQ1.js";function Ie(e,r,s=!1){T&&j();var n=e,a=null,i=null,l=J,d=s?C:0,p=!1;const P=(o,u=!0)=>{p=!0,_(u,o)};var f=null;function I(){f!==null&&(f.lastChild.remove(),n.before(f),f=null);var o=l?a:i,u=l?i:a;o&&Q(o),u&&V(u,()=>{l?i=null:a=null})}const _=(o,u)=>{if(l===(l=o))return;let g=!1;if(T){const E=F(n)===q;!!l===E&&(n=$(),z(n),x(!1),g=!0)}var b=Z(),c=n;if(b&&(f=document.createDocumentFragment(),f.append(c=G())),l?a??=u&&A(()=>u(c)):i??=u&&A(()=>u(c)),b){var h=H,t=l?a:i,v=l?i:a;t&&h.skipped_effects.delete(t),v&&h.skipped_effects.add(v),h.add_callback(I)}else I();g&&x(!0)};K(()=>{p=!1,r(P),p||_(null,null)},d),T&&(n=W)}let O=!1,y=Symbol();function ge(e,r,s){const n=s[r]??={store:null,source:X(void 0),unsubscribe:D};if(n.store!==e&&!(y in s))if(n.unsubscribe(),n.store=e??null,e==null)n.source.v=void 0,n.unsubscribe=D;else{var a=!0;n.unsubscribe=k(e,i=>{a?n.source.v=i:U(n.source,i)}),a=!1}return e&&y in s?ee(e):m(n.source)}function Ee(){const e={};function r(){re(()=>{for(var s in e)e[s].unsubscribe();ne(e,y,{enumerable:!1,value:!0})})}return[e,r]}function be(e){var r=O;try{return O=!1,[e(),O]}finally{O=r}}const he={get(e,r){if(!e.exclude.includes(r))return m(e.version),r in e.special?e.special[r]():e.props[r]},set(e,r,s){if(!(r in e.special)){var n=R;try{L(e.parent_effect),e.special[r]=me({get[r](){return e.props[r]}},r,M)}finally{L(n)}}return e.special[r](s),N(e.version),!0},getOwnPropertyDescriptor(e,r){if(!e.exclude.includes(r)&&r in e.props)return{enumerable:!0,configurable:!0,value:e.props[r]}},deleteProperty(e,r){return e.exclude.includes(r)||(e.exclude.push(r),N(e.version)),!0},has(e,r){return e.exclude.includes(r)?!1:r in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(r=>!e.exclude.includes(r))}};function Oe(e,r){return new Proxy({props:e,exclude:r,special:{},version:fe(0),parent_effect:R},he)}const Se={get(e,r){let s=e.props.length;for(;s--;){let n=e.props[s];if(S(n)&&(n=n()),typeof n=="object"&&n!==null&&r in n)return n[r]}},set(e,r,s){let n=e.props.length;for(;n--;){let a=e.props[n];S(a)&&(a=a());const i=w(a,r);if(i&&i.set)return i.set(s),!0}return!1},getOwnPropertyDescriptor(e,r){let s=e.props.length;for(;s--;){let n=e.props[s];if(S(n)&&(n=n()),typeof n=="object"&&n!==null&&r in n){const a=w(n,r);return a&&!a.configurable&&(a.configurable=!0),a}}},has(e,r){if(r===Y||r===B)return!1;for(let s of e.props)if(S(s)&&(s=s()),s!=null&&r in s)return!0;return!1},ownKeys(e){const r=[];for(let s of e.props)if(S(s)&&(s=s()),!!s){for(const n in s)r.includes(n)||r.push(n);for(const n of Object.getOwnPropertySymbols(s))r.includes(n)||r.push(n)}return r}};function Te(...e){return new Proxy({props:e},Se)}function me(e,r,s,n){var a=!ce||(s&de)!==0,i=(s&le)!==0,l=(s&pe)!==0,d=n,p=!0,P=()=>(p&&(p=!1,d=l?oe(n):n),d),f;if(i){var I=Y in e||B in e;f=w(e,r)?.set??(I&&r in e?t=>e[r]=t:void 0)}var _,o=!1;i?[_,o]=be(()=>e[r]):_=e[r],_===void 0&&n!==void 0&&(_=P(),f&&(a&&se(),f(_)));var u;if(a?u=()=>{var t=e[r];return t===void 0?P():(p=!0,t)}:u=()=>{var t=e[r];return t!==void 0&&(d=void 0),t===void 0?d:t},a&&(s&M)===0)return u;if(f){var g=e.$$legacy;return function(t,v){return arguments.length>0?((!a||!v||g||o)&&f(v?u():t),t):u()}}var b=!1,c=((s&_e)!==0?ae:ie)(()=>(b=!1,u()));i&&m(c);var h=R;return function(t,v){if(arguments.length>0){const E=v?m(c):a&&i?te(t):t;return U(c,E),b=!0,d!==void 0&&(d=E),t}return ve&&b||(h.f&ue)!==0?c.v:m(c)}}export{ge as a,Te as b,Ie as i,Oe as l,me as p,Ee as s}; diff --git a/webapp/assets/_app/immutable/chunks/B3Pzt0F_.js b/webapp/assets/_app/immutable/chunks/B3Pzt0F_.js new file mode 100644 index 00000000..dd5dc33f --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/B3Pzt0F_.js @@ -0,0 +1 @@ +import{am as g,an as d,ao as c,u as m,ap as b,aq as i,g as p,n as v,ar as h,as as k}from"./D8EpLgQ1.js";function x(n=!1){const s=g,e=s.l.u;if(!e)return;let f=()=>v(s.s);if(n){let t=0,a={};const _=h(()=>{let l=!1;const r=s.s;for(const o in r)r[o]!==a[o]&&(a[o]=r[o],l=!0);return l&&t++,t});f=()=>p(_)}e.b.length&&d(()=>{u(s,f),i(e.b)}),c(()=>{const t=m(()=>e.m.map(b));return()=>{for(const a of t)typeof a=="function"&&a()}}),e.a.length&&c(()=>{u(s,f),i(e.a)})}function u(n,s){if(n.l.s)for(const e of n.l.s)p(e);s()}k();export{x as i}; diff --git a/webapp/assets/_app/immutable/chunks/B7ITzBt8.js b/webapp/assets/_app/immutable/chunks/B7ITzBt8.js new file mode 100644 index 00000000..8b2103d3 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/B7ITzBt8.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as j}from"./B3Pzt0F_.js";import{p as R,l as w,a as q,f as g,t as v,c as k,d as A,k as B,j as u,s as _,m as y,r as m,n as f,u as b,g as d,v as h}from"./D8EpLgQ1.js";import{p as o,i as D}from"./5WA7h8uK.js";import{c as U,s as F}from"./CiE1LlKV.js";import{b as r}from"./CoIRRsD9.js";var G=g('
                '),H=g('');function V(x,n){R(n,!1);const i=y(),p=y();let e=o(n,"item",8),s=o(n,"entityType",8,"repository"),$=o(n,"showOwner",8,!1),E=o(n,"showId",8,!1),I=o(n,"fontMono",8,!1);function z(){if(!e())return"Unknown";switch(s()){case"repository":return $()?`${e().owner||"Unknown"}/${e().name||"Unknown"}`:e().name||"Unknown";case"organization":case"enterprise":return e().name||"Unknown";case"pool":return E()?e().id||"Unknown":e().name||"Unknown";case"scaleset":return e().name||"Unknown";case"instance":return e().name||"Unknown";default:return e().name||e().id||"Unknown"}}function C(){if(!e())return"#";let t;switch(s()){case"instance":t=e().name;break;default:t=e().id||e().name;break}if(!t)return"#";switch(s()){case"repository":return`${r}/repositories/${t}`;case"organization":return`${r}/organizations/${t}`;case"enterprise":return`${r}/enterprises/${t}`;case"pool":return`${r}/pools/${t}`;case"scaleset":return`${r}/scalesets/${t}`;case"instance":return`${r}/instances/${encodeURIComponent(t)}`;default:return"#"}}w(()=>{},()=>{_(i,z())}),w(()=>{},()=>{_(p,C())}),q(),j();var c=H(),a=u(c),M=u(a,!0);m(a);var N=B(a,2);{var O=t=>{var l=G(),T=u(l,!0);m(l),v(()=>h(T,(f(e()),b(()=>e().provider_id)))),k(t,l)};D(N,t=>{f(s()),f(e()),b(()=>s()==="instance"&&e()?.provider_id)&&t(O)})}m(c),v(()=>{U(a,"href",d(p)),F(a,1,`block w-full truncate text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300 ${I()?"font-mono":""}`),U(a,"title",d(i)),h(M,d(i))}),k(x,c),A()}export{V as E}; diff --git a/webapp/assets/_app/immutable/chunks/BAg1iRPq.js b/webapp/assets/_app/immutable/chunks/BAg1iRPq.js new file mode 100644 index 00000000..9bf97768 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/BAg1iRPq.js @@ -0,0 +1 @@ +import{F as t,G as S,u as b,H as h,S as k}from"./D8EpLgQ1.js";function u(r,i){return r===i||r?.[k]===i}function d(r={},i,a,T){return t(()=>{var f,s;return S(()=>{f=s,s=[],b(()=>{r!==a(...s)&&(i(r,...s),f&&u(a(...f),r)&&i(null,...f))})}),()=>{h(()=>{s&&u(a(...s),r)&&i(null,...s)})}}),r}export{d as b}; diff --git a/webapp/assets/_app/immutable/chunks/BE4wujub.js b/webapp/assets/_app/immutable/chunks/BE4wujub.js new file mode 100644 index 00000000..6b6a2146 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/BE4wujub.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as v}from"./B3Pzt0F_.js";import{p as w,l as m,n as s,g as r,m as g,a as x,B as h,b as T,c as B,d as S,s as k,u}from"./D8EpLgQ1.js";import{k as A}from"./C9DJVOi1.js";import{p as d}from"./5WA7h8uK.js";import{k as b,B as C}from"./BGVHQGl-.js";import{f as E}from"./ow_oMtSd.js";function q(_,i){w(i,!1);const c=g(),n=g();let e=d(i,"item",8),l=d(i,"statusType",8,"entity"),a=d(i,"statusField",8,"status");m(()=>(s(e()),s(a())),()=>{k(c,e()?.[a()]||"unknown")}),m(()=>(s(e()),s(l()),r(c),s(a())),()=>{k(n,(()=>{if(!e())return{variant:"error",text:"Unknown"};switch(l()){case"entity":return b(e());case"instance":let t="secondary";switch(r(c).toLowerCase()){case"running":t="success";break;case"stopped":t="info";break;case"creating":case"pending_create":t="warning";break;case"deleting":case"pending_delete":case"pending_force_delete":t="warning";break;case"error":case"deleted":t="error";break;case"active":case"online":t="success";break;case"idle":t="info";break;case"pending":case"installing":t="warning";break;case"failed":case"terminated":case"offline":t="error";break;case"unknown":default:t="secondary";break}return{variant:t,text:E(r(c))};case"enabled":return{variant:e().enabled?"success":"error",text:e().enabled?"Enabled":"Disabled"};case"custom":const o=e()[a()]||"Unknown";if(a()==="auth-type"){const f=o==="pat"||!o?"pat":"app";return{variant:f==="pat"?"success":"info",text:f==="pat"?"PAT":"App"}}return{variant:"info",text:o};default:return b(e())}})())}),x(),v();var p=h(),y=T(p);A(y,()=>(s(e()),s(a()),u(()=>`${e()?.name||"item"}-${e()?.[a()]||"status"}-${e()?.updated_at||"time"}`)),t=>{C(t,{get variant(){return r(n),u(()=>r(n).variant)},get text(){return r(n),u(()=>r(n).text)}})}),B(_,p),S()}export{q as S}; diff --git a/webapp/assets/_app/immutable/chunks/BEkVdVE1.js b/webapp/assets/_app/immutable/chunks/BEkVdVE1.js new file mode 100644 index 00000000..1eb2c1f7 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/BEkVdVE1.js @@ -0,0 +1 @@ +import{I as u}from"./D8EpLgQ1.js";function c(){const{subscribe:s,set:i,update:o}=u([]),n={subscribe:s,add:e=>{const t=Math.random().toString(36).substr(2,9),r={...e,id:t,duration:e.duration??5e3};return o(a=>[...a,r]),r.duration&&r.duration>0&&setTimeout(()=>{o(a=>a.filter(d=>d.id!==t))},r.duration),t},remove:e=>{o(t=>t.filter(r=>r.id!==e))},clear:()=>{i([])},success:(e,t="",r)=>n.add({type:"success",title:e,message:t,duration:r}),error:(e,t="",r)=>n.add({type:"error",title:e,message:t,duration:r}),info:(e,t="",r)=>n.add({type:"info",title:e,message:t,duration:r}),warning:(e,t="",r)=>n.add({type:"warning",title:e,message:t,duration:r})};return n}const p=c();export{p as t}; diff --git a/webapp/assets/_app/immutable/chunks/BGVHQGl-.js b/webapp/assets/_app/immutable/chunks/BGVHQGl-.js new file mode 100644 index 00000000..e53186fd --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/BGVHQGl-.js @@ -0,0 +1,4 @@ +import"./DsnmJJEf.js";import{i as m}from"./B3Pzt0F_.js";import{p as w,l as x,n as d,a as k,f as _,t as b,c as v,d as y,s as h,m as E,j as B,r as z,g as L,v as M}from"./D8EpLgQ1.js";import{s as j,e as $}from"./CiE1LlKV.js";import{p as o}from"./5WA7h8uK.js";function S(e){if(!e)return"N/A";try{return(typeof e=="string"?new Date(e):e).toLocaleString()}catch{return"Invalid Date"}}function A(e,r="w-4 h-4"){return e==="gitea"?``:e==="github"?`
                `:` + + + `}function C(e,r){if(e.repo_name)return e.repo_name;if(e.org_name)return e.org_name;if(e.enterprise_name)return e.enterprise_name;if(e.repo_id&&!e.repo_name&&r?.repositories){const n=r.repositories.find(t=>t.id===e.repo_id);return n?`${n.owner}/${n.name}`:"Unknown Entity"}if(e.org_id&&!e.org_name&&r?.organizations){const n=r.organizations.find(t=>t.id===e.org_id);return n&&n.name?n.name:"Unknown Entity"}if(e.enterprise_id&&!e.enterprise_name&&r?.enterprises){const n=r.enterprises.find(t=>t.id===e.enterprise_id);return n&&n.name?n.name:"Unknown Entity"}return"Unknown Entity"}function H(e){return e.repo_id?"repository":e.org_id?"organization":e.enterprise_id?"enterprise":"unknown"}function P(e,r=""){return e.repo_id?`${r}/repositories/${e.repo_id}`:e.org_id?`${r}/organizations/${e.org_id}`:e.enterprise_id?`${r}/enterprises/${e.enterprise_id}`:"#"}function V(e){e&&(e.scrollTop=e.scrollHeight)}function W(e){return{newPerPage:e,newCurrentPage:1}}function q(e){return e.pool_manager_status?.running?{text:"Running",variant:"success"}:{text:"Stopped",variant:"error"}}function G(e){switch(e.toLowerCase()){case"error":return{text:"Error",variant:"error"};case"warning":return{text:"Warning",variant:"warning"};case"info":return{text:"Info",variant:"info"};default:return{text:e,variant:"info"}}}function l(e,r,n){if(!r.trim())return e;const t=r.toLowerCase();return e.filter(a=>typeof n=="function"?n(a).toLowerCase().includes(t):n.some(i=>a[i]?.toString().toLowerCase().includes(t)))}function J(e,r){return l(e,r,["name","owner"])}function K(e,r){return l(e,r,["name"])}function O(e,r){return l(e,r,n=>[n.name||"",n.description||"",n.endpoint?.name||""].join(" "))}function Q(e,r){return l(e,r,["name","description","base_url","api_base_url"])}function X(e,r,n){return e.slice((r-1)*n,r*n)}var T=_(" ");function Y(e,r){w(r,!1);const n=E();let t=o(r,"variant",8,"gray"),a=o(r,"size",8,"sm"),i=o(r,"text",8),g=o(r,"ring",8,!1);const c={success:"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200",error:"bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200",warning:"bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200",info:"bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200",gray:"bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200",blue:"bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200",green:"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200",red:"bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200",yellow:"bg-yellow-100 dark:bg-yellow-900 text-yellow-800 dark:text-yellow-200",secondary:"bg-gray-100 dark:bg-gray-700 text-gray-800 dark:text-gray-200"},u={success:"ring-green-600/20 dark:ring-green-400/30",error:"ring-red-600/20 dark:ring-red-400/30",warning:"ring-yellow-600/20 dark:ring-yellow-400/30",info:"ring-blue-600/20 dark:ring-blue-400/30",gray:"ring-gray-500/20 dark:ring-gray-400/30",blue:"ring-blue-600/20 dark:ring-blue-400/30",green:"ring-green-600/20 dark:ring-green-400/30",red:"ring-red-600/20 dark:ring-red-400/30",yellow:"ring-yellow-600/20 dark:ring-yellow-400/30",secondary:"ring-gray-500/20 dark:ring-gray-400/30"},f={sm:"px-2 py-1 text-xs",md:"px-2.5 py-0.5 text-xs"};x(()=>(d(t()),d(a()),d(g())),()=>{h(n,["inline-flex items-center rounded-full font-semibold",c[t()],f[a()],g()?`ring-1 ring-inset ${u[t()]}`:""].filter(Boolean).join(" "))}),k(),m();var s=T(),p=B(s,!0);z(s),b(()=>{j(s,1,$(L(n))),M(p,i())}),v(e,s),y()}export{Y as B,Q as a,S as b,W as c,G as d,C as e,O as f,A as g,l as h,H as i,P as j,q as k,K as l,J as m,X as p,V as s}; diff --git a/webapp/assets/_app/immutable/chunks/BmGWMSQm.js b/webapp/assets/_app/immutable/chunks/BmGWMSQm.js new file mode 100644 index 00000000..7e21970e --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/BmGWMSQm.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as K}from"./B3Pzt0F_.js";import{p as O,f as U,j as e,r as t,k as r,n as m,u as o,z as et,t as q,v as p,c as h,d as Q,E as ct,D as mt,B as Y,b as Z,g as P}from"./D8EpLgQ1.js";import{p as T,i as G,s as ut,a as pt}from"./5WA7h8uK.js";import{c as at,B as gt}from"./CiE1LlKV.js";import{b as R,B as H,e as xt}from"./BGVHQGl-.js";import{b as ft}from"./CoIRRsD9.js";import{e as yt}from"./wyaP0EDu.js";import{D as ht,G as tt}from"./C9DJVOi1.js";import{E as _t}from"./B7ITzBt8.js";import{S as bt}from"./BE4wujub.js";import{e as kt,i as wt}from"./u94nIB4-.js";import{b as Ct}from"./BAg1iRPq.js";var Pt=U('

                ID
                Created At
                Updated At
                Status
                Pool Balancer Type
                ');function Wt(L,v){O(v,!1);let a=T(v,"entity",8),g=T(v,"entityType",8);function N(){return`${g().charAt(0).toUpperCase()+g().slice(1)} Information`}function n(){if(!a().endpoint?.base_url)return"#";switch(g()){case"repository":const d=a();return`${a().endpoint.base_url}/${d.owner}/${a().name}`;case"organization":return`${a().endpoint.base_url}/${a().name}`;case"enterprise":return`${a().endpoint.base_url}/enterprises/${a().name}`;default:return"#"}}function E(){return`${g().charAt(0).toUpperCase()+g().slice(1)} URL`}function V(){const d=a().pool_balancing_type;if(!d||d===""||d==="none")return"Round Robin (default)";switch(d){case"roundrobin":return"Round Robin";case"pack":return"Pack";default:return d}}K();var c=Pt(),x=e(c),_=e(x),I=e(_,!0);t(_);var b=r(_,2),i=e(b),f=r(e(i),2),k=e(f,!0);t(f),t(i);var u=r(i,2),D=r(e(u),2),M=e(D,!0);t(D),t(u);var w=r(u,2),S=r(e(w),2),$=e(S,!0);t(S),t(w);var s=r(w,2),C=r(e(s),2),l=e(C);{var j=d=>{H(d,{variant:"success",text:"Running"})},z=d=>{H(d,{variant:"error",text:"Stopped"})};G(l,d=>{m(a()),o(()=>a().pool_manager_status?.running)?d(j):d(z,!1)})}t(C),t(s);var B=r(s,2),A=r(e(B),2),y=e(A,!0);t(A),t(B);var W=r(B,2),F=e(W),rt=e(F,!0);t(F);var X=r(F,2),J=e(X),st=e(J);et(),t(J),t(X),t(W),t(b),t(x),t(c),q((d,ot,it,dt,nt,lt,vt)=>{p(I,d),p(k,(m(a()),o(()=>a().id))),p(M,ot),p($,it),p(y,dt),p(rt,nt),at(J,"href",lt),p(st,`${vt??""} `)},[()=>o(N),()=>(m(R),m(a()),o(()=>R(a().created_at))),()=>(m(R),m(a()),o(()=>R(a().updated_at))),()=>o(V),()=>o(E),()=>o(n),()=>o(n)]),h(L,c),Q()}var Tt=U('

                No pools configured

                '),Et=U('');function qt(L,v){O(v,!1);const[a,g]=ut(),N=()=>pt(yt,"$eagerCache",a);let n=T(v,"pools",8),E=T(v,"entityType",8),V=T(v,"entityId",8,""),c=T(v,"entityName",8,"");const x=ct();function _(){x("addPool",{entityType:E(),entityId:V(),entityName:c()})}const I=[{key:"id",title:"ID",flexible:!0,cellComponent:_t,cellProps:{entityType:"pool",showId:!0,fontMono:!0}},{key:"image",title:"Image",flexible:!0,cellComponent:tt,cellProps:{field:"image",type:"code",showTitle:!0}},{key:"provider",title:"Provider",cellComponent:tt,cellProps:{field:"provider_name"}},{key:"status",title:"Status",cellComponent:bt,cellProps:{statusType:"enabled"}}],b={entityType:"pool",primaryText:{field:"id",isClickable:!0,href:"/pools/{id}",useId:!0,isMonospace:!0},secondaryText:{field:"entity_name",computedValue:s=>xt(s,N())},badges:[{type:"custom",value:s=>({variant:s.enabled?"success":"error",text:s.enabled?"Enabled":"Disabled"})}]};K();var i=Et(),f=e(i),k=e(f),u=e(k),D=e(u);t(u);var M=r(u,2);t(k);var w=r(k,2);{var S=s=>{var C=Tt(),l=r(e(C),4),j=e(l);t(l);var z=r(l,2),B=e(z);gt(B,{variant:"primary",size:"sm",$$events:{click:_},children:(A,y)=>{et();var W=mt("Add Pool");h(A,W)},$$slots:{default:!0}}),t(z),t(C),q(()=>p(j,`No pools configured for this ${E()??""}.`)),h(s,C)},$=s=>{ht(s,{get columns(){return I},get data(){return n()},loading:!1,error:"",searchTerm:"",showSearch:!1,showPagination:!1,currentPage:1,get perPage(){return m(n()),o(()=>n().length)},totalPages:1,get totalItems(){return m(n()),o(()=>n().length)},itemName:"pools",emptyTitle:"No pools configured",get emptyMessage(){return`No pools configured for this ${E()??""}.`},emptyIconType:"cog",get mobileCardConfig(){return b}})};G(w,s=>{m(n()),o(()=>n().length===0)?s(S):s($,!1)})}t(f),t(i),q(()=>{p(D,`Pools (${m(n()),o(()=>n().length)??""})`),at(M,"href",`${ft}/pools`)}),h(L,i),Q(),g()}var It=U('

                '),Bt=U('

                Events

                '),Nt=U('

                Events

                No events available

                ');function Ft(L,v){O(v,!1);let a=T(v,"events",8),g=T(v,"eventsContainer",12,void 0);K();var N=Y(),n=Z(N);{var E=c=>{var x=Bt(),_=e(x),I=r(e(_),2);kt(I,5,a,wt,(b,i)=>{var f=It(),k=e(f),u=e(k),D=e(u,!0);t(u);var M=r(u,2),w=e(M);{var S=l=>{H(l,{variant:"error",text:"Error"})},$=l=>{var j=Y(),z=Z(j);{var B=y=>{H(y,{variant:"warning",text:"Warning"})},A=y=>{H(y,{variant:"info",text:"Info"})};G(z,y=>{P(i),o(()=>(P(i).event_level||"info").toLowerCase()==="warning")?y(B):y(A,!1)},!0)}h(l,j)};G(w,l=>{P(i),o(()=>(P(i).event_level||"info").toLowerCase()==="error")?l(S):l($,!1)})}var s=r(w,2),C=e(s,!0);t(s),t(M),t(k),t(f),q(l=>{p(D,(P(i),o(()=>P(i).message))),p(C,l)},[()=>(m(R),P(i),o(()=>R(P(i).created_at)))]),h(b,f)}),t(I),Ct(I,b=>g(b),()=>g()),t(_),t(x),h(c,x)},V=c=>{var x=Nt();h(c,x)};G(n,c=>{m(a()),o(()=>a()&&a().length>0)?c(E):c(V,!1)})}h(L,N),Q()}export{Wt as E,qt as P,Ft as a}; diff --git a/webapp/assets/_app/immutable/chunks/C41YH50Q.js b/webapp/assets/_app/immutable/chunks/C41YH50Q.js new file mode 100644 index 00000000..9f4c7cfe --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/C41YH50Q.js @@ -0,0 +1 @@ +import{s as e}from"./CTf6mQoE.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p}; diff --git a/webapp/assets/_app/immutable/chunks/C6k1Q4We.js b/webapp/assets/_app/immutable/chunks/C6k1Q4We.js new file mode 100644 index 00000000..8d095aaf --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/C6k1Q4We.js @@ -0,0 +1 @@ +import{V as b,W as o,u as h,G as _,K as t,Q as f,X as m}from"./D8EpLgQ1.js";function y(e,a,c=a){var v=b(),d=new WeakSet;o(e,"input",r=>{var l=r?e.defaultValue:e.value;if(l=n(e)?s(l):l,c(l),f!==null&&d.add(f),v&&l!==(l=a())){var k=e.selectionStart,u=e.selectionEnd;e.value=l??"",u!==null&&(e.selectionStart=k,e.selectionEnd=Math.min(u,e.value.length))}}),(t&&e.defaultValue!==e.value||h(a)==null&&e.value)&&(c(n(e)?s(e.value):e.value),f!==null&&d.add(f)),_(()=>{var r=a();if(e===document.activeElement){var l=m??f;if(d.has(l))return}n(e)&&r===s(e.value)||e.type==="date"&&!r&&!e.value||r!==e.value&&(e.value=r??"")})}function E(e,a,c=a){o(e,"change",v=>{var d=v?e.defaultChecked:e.checked;c(d)}),(t&&e.defaultChecked!==e.checked||h(a)==null)&&c(e.checked),_(()=>{var v=a();e.checked=!!v})}function n(e){var a=e.type;return a==="number"||a==="range"}function s(e){return e===""?null:+e}export{E as a,y as b}; diff --git a/webapp/assets/_app/immutable/chunks/C89fcOde.js b/webapp/assets/_app/immutable/chunks/C89fcOde.js new file mode 100644 index 00000000..481fd468 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/C89fcOde.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as dr}from"./B3Pzt0F_.js";import{p as or,E as sr,m as i,o as ir,s,f as le,j as d,r as o,k as t,g as r,n as c,u as m,t as f,x as Ge,z as nr,v as _,e as je,c as u,D as R,B as Be,b as $e,d as lr}from"./D8EpLgQ1.js";import{p as ur,i as E}from"./5WA7h8uK.js";import{r as b,b as ze}from"./CiE1LlKV.js";import{b as v,a as br}from"./C6k1Q4We.js";import{p as gr}from"./D4Caz1gY.js";import{M as cr}from"./qB7B8uiS.js";import{J as mr}from"./DZblzgqm.js";var vr=le('

                '),pr=le('
                Updating...
                '),fr=le('

                Scale Set Information

                Provider:
                Entity:

                Image & OS Configuration

                Runner Limits & Timing

                Advanced Settings

                Extra Specs (JSON)
                ');function Or(Ce,ue){or(ue,!1);let e=ur(ue,"scaleSet",8);const $=sr();let O=i(!1),J=i(""),T=i(e().name||""),I=i(e().image||""),M=i(e().flavor||""),N=i(e().max_runners),A=i(e().min_idle_runners),P=i(e().runner_bootstrap_timeout),U=i(e().runner_prefix||""),h=i(e().os_type||"linux"),k=i(e().os_arch||"amd64"),D=i(e()["github-runner-group"]||""),G=i(e().enabled),g=i("{}");ir(()=>{if(e().extra_specs)try{if(typeof e().extra_specs=="object")s(g,JSON.stringify(e().extra_specs,null,2));else{const l=JSON.parse(e().extra_specs);s(g,JSON.stringify(l,null,2))}}catch{s(g,e().extra_specs||"{}")}});async function Fe(){try{s(O,!0),s(J,"");let l={};if(r(g).trim())try{l=JSON.parse(r(g))}catch{throw new Error("Invalid JSON in extra specs")}const w={name:r(T)!==e().name?r(T):void 0,image:r(I)!==e().image?r(I):void 0,flavor:r(M)!==e().flavor?r(M):void 0,max_runners:r(N)!==e().max_runners?r(N):void 0,min_idle_runners:r(A)!==e().min_idle_runners?r(A):void 0,runner_bootstrap_timeout:r(P)!==e().runner_bootstrap_timeout?r(P):void 0,runner_prefix:r(U)!==e().runner_prefix?r(U):void 0,os_type:r(h)!==e().os_type?r(h):void 0,os_arch:r(k)!==e().os_arch?r(k):void 0,"github-runner-group":r(D)!==e()["github-runner-group"]&&r(D)||void 0,enabled:r(G)!==e().enabled?r(G):void 0,extra_specs:r(g).trim()!==JSON.stringify(e().extra_specs||{},null,2).trim()?l:void 0};Object.keys(w).forEach(p=>{w[p]===void 0&&delete w[p]}),$("submit",w)}catch(l){s(J,l instanceof Error?l.message:"Failed to update scale set")}finally{s(O,!1)}}dr(),cr(Ce,{$$events:{close:()=>$("close")},children:(l,w)=>{var p=fr(),z=d(p),be=d(z),Le=d(be);o(be),o(z);var C=t(z,2),ge=d(C);{var He=a=>{var n=vr(),j=d(n),ne=d(j,!0);o(j),o(n),f(()=>_(ne,r(J))),u(a,n)};E(ge,a=>{r(J)&&a(He)})}var F=t(ge,2),ce=t(d(F),2),L=d(ce),me=t(d(L),2),We=d(me,!0);o(me),o(L);var ve=t(L,2),pe=t(d(ve),2),qe=d(pe);{var Ke=a=>{var n=R();f(()=>_(n,`Repository: ${c(e()),m(()=>e().repo_name)??""}`)),u(a,n)},Qe=a=>{var n=Be(),j=$e(n);{var ne=x=>{var S=R();f(()=>_(S,`Organization: ${c(e()),m(()=>e().org_name)??""}`)),u(x,S)},er=x=>{var S=Be(),rr=$e(S);{var ar=y=>{var B=R();f(()=>_(B,`Enterprise: ${c(e()),m(()=>e().enterprise_name)??""}`)),u(y,B)},tr=y=>{var B=R("Unknown Entity");u(y,B)};E(rr,y=>{c(e()),m(()=>e().enterprise_name)?y(ar):y(tr,!1)},!0)}u(x,S)};E(j,x=>{c(e()),m(()=>e().org_name)?x(ne):x(er,!1)},!0)}u(a,n)};E(qe,a=>{c(e()),m(()=>e().repo_name)?a(Ke):a(Qe,!1)})}o(pe),o(ve),o(ce),o(F);var H=t(F,2),fe=t(d(H),2);b(fe),o(H);var W=t(H,2),xe=t(d(W),2),q=d(xe),ye=t(d(q),2);b(ye),o(q);var K=t(q,2),_e=t(d(K),2);b(_e),o(K);var Q=t(K,2),V=t(d(Q),2);f(()=>{r(h),Ge(()=>{})});var X=d(V);X.value=X.__value="linux";var he=t(X);he.value=he.__value="windows",o(V),o(Q);var ke=t(Q,2),Y=t(d(ke),2);f(()=>{r(k),Ge(()=>{})});var Z=d(Y);Z.value=Z.__value="amd64";var we=t(Z);we.value=we.__value="arm64",o(Y),o(ke),o(xe),o(W);var ee=t(W,2),Se=t(d(ee),2),re=d(Se),Re=t(d(re),2);b(Re),o(re);var ae=t(re,2),Ee=t(d(ae),2);b(Ee),o(ae);var Oe=t(ae,2),Je=t(d(Oe),2);b(Je),o(Oe),o(Se),o(ee);var te=t(ee,2),de=t(d(te),2),oe=d(de),Te=t(d(oe),2);b(Te),o(oe);var Ie=t(oe,2),Me=t(d(Ie),2);b(Me),o(Ie),o(de);var se=t(de,2),Ne=d(se),Ve=t(d(Ne),2);mr(Ve,{rows:4,placeholder:"{}",get value(){return r(g)},set value(a){s(g,a)},$$legacy:!0}),o(Ne),o(se);var Ae=t(se,2),Pe=d(Ae);b(Pe),nr(2),o(Ae),o(te);var Ue=t(te,2),De=d(Ue),ie=t(De,2),Xe=d(ie);{var Ye=a=>{var n=pr();u(a,n)},Ze=a=>{var n=R("Update Scale Set");u(a,n)};E(Xe,a=>{r(O)?a(Ye):a(Ze,!1)})}o(ie),o(Ue),o(C),o(p),f(()=>{_(Le,`Update Scale Set ${c(e()),m(()=>e().name)??""}`),_(We,(c(e()),m(()=>e().provider_name))),ie.disabled=r(O)}),v(fe,()=>r(T),a=>s(T,a)),v(ye,()=>r(I),a=>s(I,a)),v(_e,()=>r(M),a=>s(M,a)),ze(V,()=>r(h),a=>s(h,a)),ze(Y,()=>r(k),a=>s(k,a)),v(Re,()=>r(A),a=>s(A,a)),v(Ee,()=>r(N),a=>s(N,a)),v(Je,()=>r(P),a=>s(P,a)),v(Te,()=>r(U),a=>s(U,a)),v(Me,()=>r(D),a=>s(D,a)),br(Pe,()=>r(G),a=>s(G,a)),je("click",De,()=>$("close")),je("submit",C,gr(Fe)),u(l,p)},$$slots:{default:!0}}),lr()}export{Or as U}; diff --git a/webapp/assets/_app/immutable/chunks/C9DJVOi1.js b/webapp/assets/_app/immutable/chunks/C9DJVOi1.js new file mode 100644 index 00000000..3375b79c --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/C9DJVOi1.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as ke}from"./B3Pzt0F_.js";import{V as ut,aU as gt,aV as ft,M as ht,O as mt,P as pt,Q as kt,R as xt,at as _t,K as Xe,L as yt,U as bt,T as wt,a8 as Mt,p as fe,l as $,s as ee,m as te,n as u,a as Le,C as ye,j as s,g as e,r as n,t as R,c as i,d as he,E as be,f as L,e as Ge,u as v,k as j,v as O,z as Se,D as Te,B as Q,b as q,x as Pt,q as X}from"./D8EpLgQ1.js";import{p as o,l as Ye,i as I,b as Ct}from"./5WA7h8uK.js";import{e as de,i as ge}from"./u94nIB4-.js";import{h as Ae,s as pe,f as jt,e as zt,r as Tt,c as Be,B as Ce,b as Lt,d as $e,i as Ht}from"./CiE1LlKV.js";import{c as It}from"./CCSWcuVN.js";import{b as St}from"./C6k1Q4We.js";import{b as At}from"./CoIRRsD9.js";import{B as Bt,g as et,b as Et}from"./BGVHQGl-.js";function tt(S,r,g){Xe&&yt();var a=S,t=_t,p,h,m=null,f=ut()?gt:ft;function M(){p&&bt(p),m!==null&&(m.lastChild.remove(),a.before(m),m=null),p=h}ht(()=>{if(f(t,t=r())){var k=a,A=xt();A&&(m=document.createDocumentFragment(),m.append(k=mt())),h=pt(()=>g(k)),A?kt.add_callback(M):M()}}),Xe&&(a=wt)}function Fe(S,r){var g=S.$$events?.[r.type],a=Mt(g)?g.slice():g==null?[]:[g];for(var t of a)t.call(this,r)}var Dt=ye('');function Vt(S,r){fe(r,!1);const g=te();let a=o(r,"name",8),t=o(r,"class",8,"h-5 w-5");const p={plus:'',edit:'',delete:'',view:'',close:'',check:'',x:'',"chevron-left":'',"chevron-right":'',"chevron-down":'',"chevron-up":'',search:'',refresh:'',menu:'',settings:'',"check-circle":'',"x-circle":'',"exclamation-circle":'',"information-circle":'',loading:'',sun:'',moon:'',document:'',folder:''};$(()=>u(a()),()=>{ee(g,p[a()]||"")}),Le();var h=Dt(),m=s(h);Ae(m,()=>e(g),!0),n(h),R(()=>pe(h,0,`${t()}`)),i(S,h),he()}var Nt=L('');function rt(S,r){const g=Ye(r,["children","$$slots","$$events","$$legacy"]),a=Ye(g,["action","disabled","title","ariaLabel","size"]);fe(r,!1);const t=te(),p=te(),h=te(),m=te(),f=te(),M=te(),k=te(),A=te(),U=te(),V=be();let P=o(r,"action",8,"edit"),Z=o(r,"disabled",8,!1),B=o(r,"title",8,""),x=o(r,"ariaLabel",8,""),H=o(r,"size",8,"md");function D(){Z()||V("click")}$(()=>{},()=>{ee(t,"transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 dark:focus:ring-offset-gray-900 cursor-pointer disabled:cursor-not-allowed disabled:opacity-50")}),$(()=>u(H()),()=>{ee(p,{sm:"p-1",md:"p-2"}[H()])}),$(()=>u(P()),()=>{ee(h,{edit:"text-indigo-600 dark:text-indigo-400 hover:text-indigo-900 dark:hover:text-indigo-300 focus:ring-indigo-500",delete:"text-red-600 dark:text-red-400 hover:text-red-900 dark:hover:text-red-300 focus:ring-red-500",view:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-300 focus:ring-gray-500",add:"text-green-600 dark:text-green-400 hover:text-green-900 dark:hover:text-green-300 focus:ring-green-500"}[P()])}),$(()=>u(H()),()=>{ee(m,H()==="sm"?"h-4 w-4":"h-5 w-5")}),$(()=>(e(t),e(p),e(h)),()=>{ee(f,[e(t),e(p),e(h)].join(" "))}),$(()=>{},()=>{ee(M,{edit:'',delete:'',view:'',add:''})}),$(()=>{},()=>{ee(k,{edit:"Edit",delete:"Delete",view:"View",add:"Add"})}),$(()=>(u(B()),e(k),u(P())),()=>{ee(A,B()||e(k)[P()])}),$(()=>(u(x()),e(k),u(P())),()=>{ee(U,x()||`${e(k)[P()]} item`)}),Le(),ke();var F=Nt();jt(F,()=>({type:"button",class:e(f),disabled:Z(),title:e(A),"aria-label":e(U),...a}));var J=s(F),l=s(J);Ae(l,()=>(e(M),u(P()),v(()=>e(M)[P()])),!0),n(J),n(F),R(()=>pe(J,0,zt(e(m)))),Ge("click",F,D),i(S,F),he()}var Rt=L('
                ');function Ut(S,r){fe(r,!1);let g=o(r,"value",12,""),a=o(r,"placeholder",8,"Search..."),t=o(r,"disabled",8,!1);const p=be();function h(){p("input",g())}ke();var m=Rt(),f=s(m),M=s(f);Vt(M,{name:"search",class:"h-5 w-5 text-gray-400"}),n(f);var k=j(f,2);Tt(k),n(m),R(()=>{Be(k,"placeholder",a()),k.disabled=t()}),St(k,g),Ge("input",k,h),i(S,m),he()}var qt=L('

                ');function Ot(S,r){let g=o(r,"message",8,"Loading...");var a=qt(),t=j(s(a),2),p=s(t,!0);n(t),n(a),R(()=>O(p,g())),i(S,a)}var Ft=L('
                '),Gt=L('

                ');function Kt(S,r){let g=o(r,"title",8,"Error"),a=o(r,"message",8),t=o(r,"showRetry",8,!1),p=o(r,"onRetry",8,void 0);var h=Gt(),m=s(h),f=s(m),M=j(s(f),2),k=s(M),A=s(k,!0);n(k);var U=j(k,2),V=s(U,!0);n(U);var P=j(U,2);{var Z=B=>{var x=Ft(),H=s(x);Ce(H,{variant:"secondary",size:"sm",icon:"",class:"text-red-700 dark:text-red-200 bg-red-100 dark:bg-red-800 hover:bg-red-200 dark:hover:bg-red-700 focus:outline-none focus:bg-red-200 dark:focus:bg-red-700",$$events:{click(...D){p()?.apply(this,D)}},children:(D,F)=>{Se();var J=Te("Retry");i(D,J)},$$slots:{default:!0}}),n(x),i(B,x)};I(P,B=>{t()&&p()&&B(Z)})}n(M),n(f),n(m),n(h),R(()=>{O(A,g()),O(V,a())}),i(S,h)}var Qt=ye(''),Zt=ye(''),Jt=ye(''),Wt=ye(''),Xt=ye(''),Yt=ye(''),$t=L('

                ');function er(S,r){let g=o(r,"title",8),a=o(r,"message",8),t=o(r,"iconType",8,"document");var p=$t(),h=s(p);{var m=V=>{var P=Qt();i(V,P)},f=V=>{var P=Q(),Z=q(P);{var B=H=>{var D=Zt();i(H,D)},x=H=>{var D=Q(),F=q(D);{var J=d=>{var c=Jt();i(d,c)},l=d=>{var c=Q(),y=q(c);{var N=w=>{var E=Wt();i(w,E)},W=w=>{var E=Q(),z=q(E);{var C=T=>{var G=Xt();i(T,G)},_=T=>{var G=Q(),Y=q(G);{var re=ae=>{var ce=Yt();i(ae,ce)};I(Y,ae=>{t()==="settings"&&ae(re)},!0)}i(T,G)};I(z,T=>{t()==="key"?T(C):T(_,!1)},!0)}i(w,E)};I(y,w=>{t()==="cog"?w(N):w(W,!1)},!0)}i(d,c)};I(F,d=>{t()==="users"?d(J):d(l,!1)},!0)}i(H,D)};I(Z,H=>{t()==="building"?H(B):H(x,!1)},!0)}i(V,P)};I(h,V=>{t()==="document"?V(m):V(f,!1)})}var M=j(h,2),k=s(M,!0);n(M);var A=j(M,2),U=s(A,!0);n(A),n(p),R(()=>{O(k,g()),O(U,a())}),i(S,p)}var tr=L(""),rr=L('
                '),ar=L('
                ');function nr(S,r){fe(r,!1);let g=o(r,"searchTerm",12,""),a=o(r,"perPage",12,25),t=o(r,"placeholder",8,"Search..."),p=o(r,"showPerPageSelector",8,!0),h=o(r,"perPageOptions",24,()=>[25,50,100]);const m=be();function f(){m("search",{term:g()})}function M(){m("perPageChange",{perPage:a()})}ke();var k=ar(),A=s(k),U=s(A),V=s(U),P=j(s(V),2);Ut(P,{get placeholder(){return t()},get value(){return g()},set value(x){g(x)},$$events:{input:f},$$legacy:!0}),n(V),n(U);var Z=j(U,2);{var B=x=>{var H=rr(),D=s(H),F=j(s(D),2);R(()=>{a(),Pt(()=>{h()})}),de(F,5,h,ge,(J,l)=>{var d=tr(),c=s(d,!0);n(d);var y={};R(()=>{O(c,e(l)),y!==(y=e(l))&&(d.value=(d.__value=e(l))??"")}),i(J,d)}),n(F),n(D),n(H),Lt(F,a),Ge("change",F,M),i(x,H)};I(Z,x=>{p()&&x(B)})}n(A),n(k),i(S,k),he()}var ir=L('Showing to of ',1),or=L('
                ');function sr(S,r){fe(r,!1);const g=te(),a=te();let t=o(r,"currentPage",8,1),p=o(r,"totalPages",8,1),h=o(r,"perPage",8,25),m=o(r,"totalItems",8,0),f=o(r,"itemName",8,"results");const M=be();function k(P){P>=1&&P<=p()&&P!==t()&&M("pageChange",{page:P})}$(()=>(u(m()),u(t()),u(h())),()=>{ee(g,m()===0?0:(t()-1)*h()+1)}),$(()=>(u(t()),u(h()),u(m())),()=>{ee(a,Math.min(t()*h(),m()))}),Le(),ke();var A=Q(),U=q(A);{var V=P=>{var Z=or(),B=s(Z),x=s(B);{let z=X(()=>t()===1);Ce(x,{variant:"secondary",get disabled(){return e(z)},$$events:{click:()=>k(t()-1)},children:(C,_)=>{Se();var T=Te("Previous");i(C,T)},$$slots:{default:!0}})}var H=j(x,2);{let z=X(()=>t()===p());Ce(H,{variant:"secondary",get disabled(){return e(z)},class:"ml-3",$$events:{click:()=>k(t()+1)},children:(C,_)=>{Se();var T=Te("Next");i(C,T)},$$slots:{default:!0}})}n(B);var D=j(B,2),F=s(D),J=s(F),l=s(J);{var d=z=>{var C=Te();R(()=>O(C,`No ${f()??""}`)),i(z,C)},c=z=>{var C=ir(),_=j(q(C)),T=s(_,!0);n(_);var G=j(_,2),Y=s(G,!0);n(G);var re=j(G,2),ae=s(re,!0);n(re);var ce=j(re);R(()=>{O(T,e(g)),O(Y,e(a)),O(ae,m()),O(ce,` ${f()??""}`)}),i(z,C)};I(l,z=>{m()===0?z(d):z(c,!1)})}n(J),n(F);var y=j(F,2),N=s(y),W=s(N);{let z=X(()=>t()===1);Ce(W,{variant:"secondary",size:"sm",get disabled(){return e(z)},class:"rounded-r-none","aria-label":"Previous page",icon:"",$$events:{click:()=>k(t()-1)}})}var w=j(W,2);de(w,1,()=>(u(p()),v(()=>Array(p()))),ge,(z,C,_)=>{const T=X(()=>_+1);{let G=X(()=>e(T)===t()?"primary":"secondary");Ce(z,{get variant(){return e(G)},size:"sm",class:"rounded-none border-l-0 first:border-l first:rounded-l-md",$$events:{click:()=>k(e(T))},children:(Y,re)=>{Se();var ae=Te();R(()=>O(ae,e(T))),i(Y,ae)},$$slots:{default:!0}})}});var E=j(w,2);{let z=X(()=>t()===p());Ce(E,{variant:"secondary",size:"sm",get disabled(){return e(z)},class:"rounded-l-none","aria-label":"Next page",icon:"",$$events:{click:()=>k(t()+1)}})}n(N),n(y),n(D),n(Z),i(P,Z)};I(U,P=>{p()>1&&P(V)})}i(S,A),he()}var lr=L('

                '),dr=L('

                '),cr=L('

                '),vr=L('

                '),ur=L('
                '),gr=L('
                '),fr=L('
                '),hr=L(" "),mr=L('
                '),pr=L('
                ');function kr(S,r){fe(r,!1);const g=be();let a=o(r,"item",8),t=o(r,"config",8);function p(){if(!a())return"Unknown";const{field:l,useId:d,showOwner:c}=t().primaryText,y=a()[l];return d&&y?`${y.slice(0,8)}...`:c&&a().owner&&a().name?`${a().owner}/${a().name}`:y||"Unknown"}function h(){if(!t().secondaryText)return"";const{field:l,computedValue:d}=t().secondaryText;return d!==void 0?typeof d=="function"?d(a()):d:a()?.[l]||""}function m(){if(!t().primaryText.href||!a())return"#";let l=t().primaryText.href;return l=l.replace("{id}",a().id||""),l=l.replace("{name}",encodeURIComponent(a().name||"")),`${At}${l}`}function f(l){if(!a())return;const d=t().actions?.find(c=>c.type===l);d&&d.handler(a()),l==="edit"?g("edit",{item:a()}):l==="delete"?g("delete",{item:a()}):g("action",{type:l,item:a()})}function M(l){switch(l.type){case"status":if(t().entityType==="instance"){const c=a()?.[l.field]||"unknown";let y="neutral",N=c.charAt(0).toUpperCase()+c.slice(1);return l.field==="status"?y=c==="running"?"success":c==="pending"||c==="creating"?"info":c==="failed"||c==="error"?"error":"neutral":l.field==="runner_status"&&(y=c==="idle"?"info":c==="active"||c==="running"?"success":c==="failed"||c==="error"?"error":"neutral"),{variant:y,text:N}}return{variant:"neutral",text:a()?.[l.field]||"Unknown"};case"forge":return{variant:"neutral",text:a()?.[l.field]||"unknown"};case"auth":const d=a()?.[l.field]||"pat";return{variant:d==="pat"?"success":"info",text:d.toUpperCase()};case"custom":if(typeof l.value=="function"){const c=l.value(a());return{variant:c?.variant||"neutral",text:c?.text||""}}return{variant:l.value?.variant||"neutral",text:l.value?.text||""};default:return{variant:"neutral",text:""}}}ke();var k=pr(),A=s(k),U=s(A);{var V=l=>{var d=dr(),c=s(d),y=s(c,!0);n(c);var N=j(c,2);{var W=w=>{var E=lr(),z=s(E,!0);n(E),R(C=>O(z,C),[()=>v(h)]),i(w,E)};I(N,w=>{u(t()),v(()=>t().secondaryText)&&w(W)})}n(d),R((w,E)=>{Be(d,"href",w),pe(c,1,`text-sm font-medium text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300 truncate ${u(t()),v(()=>t().primaryText.isMonospace?"font-mono":"")??""}`),O(y,E)},[()=>v(m),()=>v(p)]),i(l,d)},P=l=>{var d=vr(),c=s(d),y=s(c,!0);n(c);var N=j(c,2);{var W=w=>{var E=cr(),z=s(E,!0);n(E),R(C=>O(z,C),[()=>v(h)]),i(w,E)};I(N,w=>{u(t()),v(()=>t().secondaryText)&&w(W)})}n(d),R(w=>O(y,w),[()=>v(p)]),i(l,d)};I(U,l=>{u(t()),v(()=>t().primaryText.isClickable)?l(V):l(P,!1)})}var Z=j(U,2);{var B=l=>{var d=fr(),c=s(d);{var y=w=>{var E=Q(),z=q(E);de(z,1,()=>(u(t()),v(()=>t().customInfo)),ge,(C,_)=>{const T=X(()=>(e(_),u(a()),v(()=>typeof e(_).icon=="function"?e(_).icon(a()):e(_).icon))),G=X(()=>(e(_),u(a()),v(()=>typeof e(_).text=="function"?e(_).text(a()):e(_).text)));var Y=ur(),re=s(Y);{var ae=je=>{var He=Q(),De=q(He);Ae(De,()=>e(T)),i(je,He)};I(re,je=>{e(T)&&je(ae)})}var ce=j(re,2),Ee=s(ce,!0);n(ce),n(Y),R(()=>O(Ee,e(G))),i(C,Y)}),i(w,E)};I(c,w=>{u(t()),v(()=>t().customInfo)&&w(y)})}var N=j(c,2);{var W=w=>{var E=Q(),z=q(E);de(z,1,()=>(u(t()),v(()=>t().badges.filter(C=>C.type==="forge"))),ge,(C,_)=>{var T=gr(),G=s(T);Ae(G,()=>(u(et),e(_),u(a()),v(()=>et(e(_).field?a()?.[e(_).field]||"unknown":a()?.endpoint?.endpoint_type||"unknown"))));var Y=j(G,2),re=s(Y,!0);n(Y),n(T),R(()=>O(re,(u(a()),v(()=>a()?.endpoint?.name||"Unknown")))),i(C,T)}),i(w,E)};I(N,w=>{u(t()),v(()=>t().badges)&&w(W)})}n(d),i(l,d)};I(Z,l=>{u(t()),v(()=>t().customInfo||t().badges?.some(d=>d.type==="forge"))&&l(B)})}n(A);var x=j(A,2),H=s(x);{var D=l=>{var d=Q(),c=q(d);de(c,1,()=>(u(t()),v(()=>t().badges.filter(y=>y.type!=="forge"))),ge,(y,N)=>{var W=Q(),w=q(W);{var E=C=>{const _=X(()=>(e(N),v(()=>M(e(N)))));var T=hr(),G=s(T,!0);n(T),R(()=>{pe(T,1,`inline-flex items-center rounded-full px-2 py-1 text-xs font-medium ring-1 ring-inset ${u(e(_)),v(()=>e(_).variant==="success"?"bg-green-50 text-green-700 ring-green-600/20 dark:bg-green-900/50 dark:text-green-300 dark:ring-green-400/20":e(_).variant==="info"?"bg-blue-50 text-blue-700 ring-blue-600/20 dark:bg-blue-900/50 dark:text-blue-300 dark:ring-blue-400/20":e(_).variant==="error"?"bg-red-50 text-red-700 ring-red-600/20 dark:bg-red-900/50 dark:text-red-300 dark:ring-red-400/20":"bg-gray-50 text-gray-700 ring-gray-600/20 dark:bg-gray-900/50 dark:text-gray-300 dark:ring-gray-400/20")??""}`),O(G,(u(e(_)),v(()=>e(_).text)))}),i(C,T)},z=C=>{const _=X(()=>(e(N),v(()=>M(e(N)))));Bt(C,{get variant(){return u(e(_)),v(()=>e(_).variant)},get text(){return u(e(_)),v(()=>e(_).text)}})};I(w,C=>{e(N),v(()=>e(N).type==="status")?C(E):C(z,!1)})}i(y,W)}),i(l,d)};I(H,l=>{u(t()),v(()=>t().badges)&&l(D)})}var F=j(H,2);{var J=l=>{var d=mr();de(d,5,()=>(u(t()),v(()=>t().actions)),ge,(c,y)=>{{let N=X(()=>(e(y),u(t()),v(()=>e(y).type==="edit"?`Edit ${t().entityType}`:`Delete ${t().entityType}`))),W=X(()=>(e(y),u(t()),v(()=>e(y).type==="edit"?`Edit ${t().entityType}`:`Delete ${t().entityType}`)));rt(c,{get action(){return e(y),v(()=>e(y).type)},size:"sm",get title(){return e(N)},get ariaLabel(){return e(W)},$$events:{click:()=>f(e(y).type)}})}}),n(d),i(l,d)};I(F,l=>{u(t()),v(()=>t().actions)&&l(J)})}n(x),n(k),i(S,k),he()}var xr=L('
                '),_r=L('
                '),yr=L("
                "),br=L("
                "),wr=L(' ',1),Mr=L('
                ');function Vr(S,r){fe(r,!1);const g=te();let a=o(r,"columns",24,()=>[]),t=o(r,"data",24,()=>[]),p=o(r,"loading",8,!1),h=o(r,"error",8,""),m=o(r,"totalItems",8,0),f=o(r,"itemName",8,"results"),M=o(r,"searchTerm",12,""),k=o(r,"searchPlaceholder",8,"Search..."),A=o(r,"showSearch",8,!0),U=o(r,"currentPage",8,1),V=o(r,"perPage",12,25),P=o(r,"totalPages",8,1),Z=o(r,"showPagination",8,!0),B=o(r,"showPerPageSelector",8,!0),x=o(r,"emptyTitle",8,"No items found"),H=o(r,"emptyMessage",8,""),D=o(r,"emptyIconType",8,"document"),F=o(r,"errorTitle",8,"Error loading data"),J=o(r,"showRetry",8,!1),l=o(r,"showMobileCards",8,!0),d=o(r,"mobileCardConfig",8,null);const c=be();function y(b){c("search",b.detail)}function N(b){c("pageChange",b.detail)}function W(b){c("perPageChange",b.detail)}function w(){c("retry")}function E(b){c("edit",b.detail)}function z(b){c("delete",b.detail)}function C(b){c("action",b.detail)}function _(b){const ve="px-6 py-4 text-sm",Ve=b.align==="right"?"text-right":b.align==="center"?"text-center":"text-left",Ne=b.key==="actions"?"font-medium":"text-gray-900 dark:text-white",Re=b.flexible?"min-w-0":"";return`${ve} ${Ve} ${Ne} ${Re}`.trim()}function T(){return a().map(b=>b.flexible?`${b.flexRatio||1}fr`:"auto").join(" ")}$(()=>(u(H()),u(M()),u(f())),()=>{ee(g,H()||(M()?`No items found matching "${M()}"`:`No ${f()} found`))}),Le(),ke();var G=Mr(),Y=s(G);{var re=b=>{nr(b,{get placeholder(){return k()},get showPerPageSelector(){return B()},get searchTerm(){return M()},set searchTerm(ve){M(ve)},get perPage(){return V()},set perPage(ve){V(ve)},$$events:{search:y,perPageChange:W},$$legacy:!0})};I(Y,b=>{A()&&b(re)})}var ae=j(Y,2),ce=s(ae);{var Ee=b=>{Ot(b,{get message(){return`Loading ${f()??""}...`}})},je=b=>{var ve=Q(),Ve=q(ve);{var Ne=we=>{{let Ie=X(()=>J()?w:void 0);Kt(we,{get title(){return F()},get message(){return h()},get showRetry(){return J()},get onRetry(){return e(Ie)}})}},Re=we=>{var Ie=Q(),at=q(Ie);{var nt=Me=>{er(Me,{get title(){return x()},get message(){return e(g)},get iconType(){return D()}})},it=Me=>{var Ke=wr(),Qe=q(Ke);{var ot=oe=>{var K=_r();de(K,7,t,(le,ne)=>le.id||le.name||ne,(le,ne,qe)=>{var ze=xr(),ie=s(ze);{var Pe=me=>{var xe=Q(),se=q(xe);tt(se,()=>(e(ne),v(()=>`${e(ne).id||e(ne).name}-${e(ne).updated_at}-mobile`)),_e=>{kr(_e,{get item(){return e(ne)},get config(){return d()},$$events:{edit(ue){Fe.call(this,r,ue)},delete(ue){Fe.call(this,r,ue)},action(ue){Fe.call(this,r,ue)}}})}),i(me,xe)},Oe=me=>{var xe=Q(),se=q(xe);$e(se,r,"mobile-card",{get item(){return e(ne)},get index(){return e(qe)}}),i(me,xe)};I(ie,me=>{d()?me(Pe):me(Oe,!1)})}n(ze),i(le,ze)}),n(K),i(oe,K)};I(Qe,oe=>{l()&&oe(ot)})}var Ze=j(Qe,2),Ue=s(Ze),Je=s(Ue);de(Je,1,a,ge,(oe,K)=>{var le=yr(),ne=s(le,!0);n(le),R(()=>{pe(le,1,`px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider bg-gray-50 dark:bg-gray-700 border-b border-gray-200 dark:border-gray-600 ${e(K),v(()=>e(K).align==="right"?"text-right":e(K).align==="center"?"text-center":"text-left")??""}`),O(ne,(e(K),v(()=>e(K).title)))}),i(oe,le)});var st=j(Je,2);de(st,3,t,(oe,K)=>oe.id||oe.name||K,(oe,K,le)=>{var ne=Q(),qe=q(ne);de(qe,1,a,ge,(ze,ie)=>{var Pe=br(),Oe=s(Pe);{var me=se=>{var _e=Q(),ue=q(_e);tt(ue,()=>(e(K),e(ie),v(()=>`${e(K).id||e(K).name}-${e(K).updated_at}-${e(ie).key}`)),lt=>{var We=Q(),dt=q(We);It(dt,()=>e(ie).cellComponent,(ct,vt)=>{vt(ct,Ct({get item(){return e(K)}},()=>e(ie).cellProps,{$$events:{edit:E,delete:z,action:C}}))}),i(lt,We)}),i(se,_e)},xe=se=>{var _e=Q(),ue=q(_e);$e(ue,r,"cell",{get item(){return e(K)},get column(){return e(ie)},get index(){return e(le)},get value(){return e(K),e(ie),v(()=>e(K)[e(ie).key])}}),i(se,_e)};I(Oe,se=>{e(ie),v(()=>e(ie).cellComponent)?se(me):se(xe,!1)})}n(Pe),R(se=>pe(Pe,1,`${se??""} border-b border-gray-200 dark:border-gray-700`),[()=>(e(ie),v(()=>_(e(ie))))]),i(ze,Pe)}),i(oe,ne)}),n(Ue),n(Ze),R(oe=>Ht(Ue,`grid-template-columns: ${oe??""}`),[()=>v(T)]),i(Me,Ke)};I(at,Me=>{u(t()),v(()=>t().length===0)?Me(nt):Me(it,!1)},!0)}i(we,Ie)};I(Ve,we=>{h()?we(Ne):we(Re,!1)},!0)}i(b,ve)};I(ce,b=>{p()?b(Ee):b(je,!1)})}var He=j(ce,2);{var De=b=>{sr(b,{get currentPage(){return U()},get totalPages(){return P()},get perPage(){return V()},get totalItems(){return m()},get itemName(){return f()},$$events:{pageChange:N}})};I(He,b=>{u(Z()),u(p()),u(h()),u(t()),v(()=>Z()&&!p()&&!h()&&t().length>0)&&b(De)})}n(ae),n(G),i(S,G),he()}var Pr=L('
                ');function Nr(S,r){fe(r,!1);const g=be();let a=o(r,"item",8),t=o(r,"actions",24,()=>[{type:"edit",title:"Edit",ariaLabel:"Edit item",action:"edit"},{type:"delete",title:"Delete",ariaLabel:"Delete item",action:"delete"}]);function p(m){a()&&(m==="edit"?g("edit",{item:a()}):m==="delete"?g("delete",{item:a()}):g("action",{type:m,item:a()}))}ke();var h=Pr();de(h,5,t,ge,(m,f)=>{{let M=X(()=>(e(f),v(()=>e(f).action||(e(f).type==="edit"?"edit":e(f).type==="delete"?"delete":"view")))),k=X(()=>(e(f),v(()=>e(f).title||(e(f).type==="edit"?"Edit":e(f).type==="delete"?"Delete":e(f).label)))),A=X(()=>(e(f),v(()=>e(f).ariaLabel||(e(f).type==="edit"?"Edit item":e(f).type==="delete"?"Delete item":e(f).label))));rt(m,{get action(){return e(M)},get title(){return e(k)},get ariaLabel(){return e(A)},$$events:{click:()=>p(e(f).type)}})}}),n(h),i(S,h),he()}var Cr=L(" "),jr=L(" ");function Rr(S,r){fe(r,!1);const g=te(),a=te();let t=o(r,"item",8),p=o(r,"field",8),h=o(r,"type",8,"text"),m=o(r,"truncateLength",8,50),f=o(r,"showTitle",8,!1);function M(){return t()&&p().split(".").reduce((B,x)=>B?.[x],t())||""}function k(){return h()==="date"?Et(e(g)):h()==="truncated"&&e(g).length>m()?`${e(g).slice(0,m())}...`:e(g)}function A(){switch(h()){case"code":return"inline-block max-w-full truncate bg-gray-100 dark:bg-gray-700 px-2 py-1 rounded text-xs font-mono";case"description":return"block w-full truncate text-sm text-gray-500 dark:text-gray-300";case"date":return"block w-full truncate text-sm text-gray-900 dark:text-white font-mono";default:return"block w-full truncate text-sm text-gray-900 dark:text-white"}}$(()=>{},()=>{ee(g,M())}),$(()=>{},()=>{ee(a,k())}),Le(),ke();var U=Q(),V=q(U);{var P=B=>{var x=Cr(),H=s(x,!0);n(x),R(D=>{pe(x,1,`${D??""} ${f()?"cursor-default":""}`),Be(x,"title",f()?e(g):""),O(H,e(a))},[()=>v(A)]),i(B,x)},Z=B=>{var x=jr(),H=s(x,!0);n(x),R(D=>{pe(x,1,`${D??""} ${f()?"cursor-default":""}`),Be(x,"title",f()?e(g):""),O(H,e(a))},[()=>v(A)]),i(B,x)};I(V,B=>{h()==="code"?B(P):B(Z,!1)})}i(S,U),he()}export{rt as A,Vr as D,Rr as G,Nr as a,tt as k}; diff --git a/webapp/assets/_app/immutable/chunks/CCSWcuVN.js b/webapp/assets/_app/immutable/chunks/CCSWcuVN.js new file mode 100644 index 00000000..2c651009 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/CCSWcuVN.js @@ -0,0 +1 @@ +import{K as l,L as u,M as m,N as _,O as p,P as h,Q as v,R as b,T,U as g}from"./D8EpLgQ1.js";function y(s,i,d){l&&u();var r=s,a,n,e=null,t=null;function f(){n&&(g(n),n=null),e&&(e.lastChild.remove(),r.before(e),e=null),n=t,t=null}m(()=>{if(a!==(a=i())){var c=b();if(a){var o=r;c&&(e=document.createDocumentFragment(),e.append(o=p())),t=h(()=>d(o,a))}c?v.add_callback(f):f()}},_),l&&(r=T)}export{y as c}; diff --git a/webapp/assets/_app/immutable/chunks/CGpPw4EW.js b/webapp/assets/_app/immutable/chunks/CGpPw4EW.js new file mode 100644 index 00000000..14941294 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/CGpPw4EW.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as _}from"./B3Pzt0F_.js";import{p as h,f as x,t as u,c as g,d as k,k as w,j as o,u as m,n as e,r,v as y}from"./D8EpLgQ1.js";import{h as b}from"./CiE1LlKV.js";import{p}from"./5WA7h8uK.js";import{g as v}from"./BGVHQGl-.js";var z=x('
                ');function U(l,i){h(i,!1);let t=p(i,"item",8),s=p(i,"iconSize",8,"w-5 h-5");_();var a=z(),n=o(a),f=o(n);b(f,()=>(e(v),e(t()),e(s()),m(()=>v(t()?.endpoint?.endpoint_type||t()?.endpoint_type||"unknown",s())))),r(n);var d=w(n,2),c=o(d,!0);r(d),r(a),u(()=>y(c,(e(t()),m(()=>t()?.endpoint?.name||t()?.endpoint_name||t()?.github_endpoint_name||"Unknown")))),g(l,a),k()}export{U as E}; diff --git a/webapp/assets/_app/immutable/chunks/CLYUNKnN.js b/webapp/assets/_app/immutable/chunks/CLYUNKnN.js new file mode 100644 index 00000000..e6432af4 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/CLYUNKnN.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as b}from"./B3Pzt0F_.js";import{p as k,f as E,t as C,u as i,n as t,v as n,c as j,d as P,k as z,j as l,r as o}from"./D8EpLgQ1.js";import{c as N}from"./CiE1LlKV.js";import{p as f}from"./5WA7h8uK.js";import"./CoIRRsD9.js";import{j as x,e as c,i as u}from"./BGVHQGl-.js";var T=E('');function G(d,r){k(r,!1);let e=f(r,"item",8),m=f(r,"eagerCache",8,null);b();var s=T(),a=l(s),v=l(a,!0);o(a);var p=z(a,2),g=l(p,!0);o(p),o(s),C((h,y,_)=>{N(a,"href",h),n(v,y),n(g,_)},[()=>(t(x),t(e()),i(()=>x(e()))),()=>(t(c),t(e()),t(m()),i(()=>c(e(),m()))),()=>(t(u),t(e()),i(()=>u(e())))]),j(d,s),P()}export{G as P}; diff --git a/webapp/assets/_app/immutable/chunks/CNMHKIIK.js b/webapp/assets/_app/immutable/chunks/CNMHKIIK.js new file mode 100644 index 00000000..c1bc0085 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/CNMHKIIK.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as j}from"./B3Pzt0F_.js";import{p as E,E as G,f as S,j as t,r,k as g,u,n as p,z as m,t as z,v as D,e as f,c as H,d as I}from"./D8EpLgQ1.js";import{h as y,s as v}from"./CiE1LlKV.js";import{p as h}from"./5WA7h8uK.js";import{g as o}from"./BGVHQGl-.js";var q=S('
                ');function M(x,s){E(s,!1);const k=G();let d=h(s,"selectedForgeType",12,""),_=h(s,"label",8,"Select Forge Type");function n(c){d(c),k("select",c)}j();var i=q(),l=t(i),F=t(l,!0);r(l);var b=g(l,2),e=t(b),w=t(e);y(w,()=>(p(o),u(()=>o("github","w-8 h-8")))),m(2),r(e);var a=g(e,2),T=t(a);y(T,()=>(p(o),u(()=>o("gitea","w-8 h-8")))),m(2),r(a),r(b),r(i),z(()=>{D(F,_()),v(e,1,`flex flex-col items-center justify-center p-6 border-2 rounded-lg transition-colors cursor-pointer ${d()==="github"?"border-blue-500 bg-blue-50 dark:bg-blue-900":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`),v(a,1,`flex flex-col items-center justify-center p-6 border-2 rounded-lg transition-colors cursor-pointer ${d()==="gitea"?"border-blue-500 bg-blue-50 dark:bg-blue-900":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`)}),f("click",e,()=>n("github")),f("click",a,()=>n("gitea")),H(x,i),I()}export{M as F}; diff --git a/webapp/assets/_app/immutable/chunks/CO4LUyTP.js b/webapp/assets/_app/immutable/chunks/CO4LUyTP.js new file mode 100644 index 00000000..8559a85a --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/CO4LUyTP.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as E}from"./B3Pzt0F_.js";import{p as H,E as L,f as h,t as f,c,d as z,j as e,r as a,k as x,v as d,z as M,D as q}from"./D8EpLgQ1.js";import{p as i,i as C}from"./5WA7h8uK.js";import{B as F}from"./CiE1LlKV.js";var G=h('
                '),I=h('

                ');function S(u,t){H(t,!1);const _=L();let k=i(t,"title",8),b=i(t,"description",8),v=i(t,"actionLabel",8,null),g=i(t,"showAction",8,!0);function w(){_("action")}E();var r=I(),s=e(r),o=e(s),y=e(o,!0);a(o);var m=x(o,2),j=e(m,!0);a(m),a(s);var A=x(s,2);{var P=n=>{var l=G(),B=e(l);F(B,{variant:"primary",icon:'',$$events:{click:w},children:(D,J)=>{M();var p=q();f(()=>d(p,v())),c(D,p)},$$slots:{default:!0}}),a(l),c(n,l)};C(A,n=>{g()&&v()&&n(P)})}a(r),f(()=>{d(y,k()),d(j,b())}),c(u,r),z()}export{S as P}; diff --git a/webapp/assets/_app/immutable/chunks/CTf6mQoE.js b/webapp/assets/_app/immutable/chunks/CTf6mQoE.js new file mode 100644 index 00000000..15ee7bf7 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/CTf6mQoE.js @@ -0,0 +1,3 @@ +import{I as Ee,o as De,aR as T,g as x,s as P,bf as yt,aS as Be}from"./D8EpLgQ1.js";import{a as wt,b as L}from"./CoIRRsD9.js";class le{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Se{constructor(t,n){this.status=t,this.location=n}}class Re extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function vt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function bt(e){return e.split("%25").map(decodeURI).join("%25")}function kt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function At(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(i,o){if(o==="get"||o==="getAll"||o==="has")return f=>(n(f),i[o](f));t();const c=Reflect.get(i,o);return typeof c=="function"?c.bind(i):c}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const i of s)Object.defineProperty(a,i,{get(){return t(),e[i]},enumerable:!0,configurable:!0});return a}function Et(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}function St(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&G.delete(Ie(e)),Rt(e,t));const G=new Map;function It(e,t){const n=Ie(e,t),r=document.querySelector(n);if(r?.textContent){let{body:a,...s}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&G.set(n,{body:a,init:s,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=St(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function Ut(e,t,n){if(G.size>0){const r=Ie(e,n),a=G.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return _e(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return _e(String.fromCharCode(...c.slice(2).split("-").map(_=>parseInt(_,16))));const d=Lt.exec(c),[,h,u,l,p]=d;return t.push({name:l,matcher:p,optional:!!h,rest:!!u,chained:u?f===1&&i[0]==="":!1}),u?"([^]*?)":h?"([^/]*)?":"([^/]+?)"}return _e(c)}).join("")}).join("")}/?$`),params:t}}function xt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Pt(e){return e.slice(1).split("/").filter(xt)}function Ct(e,t,n){const r={},a=e.slice(1),s=a.filter(o=>o!==void 0);let i=0;for(let o=0;od).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](f)){r[c.name]=f;const d=t[o+1],h=a[o+1];d&&!d.rest&&d.optional&&h&&c.chained&&(i=0),!d&&!h&&Object.keys(r).length===s.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ot({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[c,f,d]])=>{const{pattern:h,params:u}=Tt(o),l={id:o,exec:p=>{const _=h.exec(p);if(_)return Ct(_,u,r)},errors:[1,...d||[]].map(p=>e[p]),layouts:[0,...f||[]].map(i),leaf:s(c)};return l.errors.length=l.layouts.length=Math.max(l.errors.length,l.layouts.length),l});function s(o){const c=o<0;return c&&(o=~o),[c,e[o]]}function i(o){return o===void 0?o:[a.has(o),e[o]]}}function ze(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Fe(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const Nt="1755334486454",Xe="sveltekit:snapshot",Ze="sveltekit:scroll",Qe="sveltekit:states",jt="sveltekit:pageurl",F="sveltekit:history",Y="sveltekit:navigation",j={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Z=location.origin;function Ue(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function fe(){return{x:pageXOffset,y:pageYOffset}}function B(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Ve={...j,"":j.hover};function et(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function tt(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=et(e)}}function ve(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||ue(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=r?.origin===Z&&e.hasAttribute("download");return{url:r,external:s,target:a,download:i}}function te(e){let t=null,n=null,r=null,a=null,s=null,i=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=B(o,"preload-code")),a===null&&(a=B(o,"preload-data")),t===null&&(t=B(o,"keepfocus")),n===null&&(n=B(o,"noscroll")),s===null&&(s=B(o,"reload")),i===null&&(i=B(o,"replacestate")),o=et(o);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Ve[r??"off"],preload_data:Ve[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function qe(e){const t=Ee(e);let n=!0;function r(){n=!0,t.update(i=>i)}function a(i){n=!1,t.set(i)}function s(i){let o;return t.subscribe(c=>{(o===void 0||n&&c!==o)&&i(o=c)})}return{notify:r,set:a,subscribe:s}}const nt={v:()=>{}};function $t(){const{set:e,subscribe:t}=Ee(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${wt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Nt;return i&&(e(!0),nt.v(),clearTimeout(n)),i}catch{return!1}}return{subscribe:t,check:r}}function ue(e,t,n){return e.origin!==Z||!e.pathname.startsWith(t)?!0:n?!(e.pathname===t+"/"||e.pathname===t+"/index.html"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===t):!1}function kn(e){}function Me(e){const t=Bt(e),n=new ArrayBuffer(t.length),r=new DataView(n);for(let a=0;a>16),t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,t+=String.fromCharCode(n)):r===18&&(n>>=2,t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255)),t}const Ft=-1,Vt=-2,qt=-3,Mt=-4,Gt=-5,Ht=-6;function Kt(e,t){if(typeof e=="number")return a(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);function a(s,i=!1){if(s===Ft)return;if(s===qt)return NaN;if(s===Mt)return 1/0;if(s===Gt)return-1/0;if(s===Ht)return-0;if(i)throw new Error("Invalid input");if(s in r)return r[s];const o=n[s];if(!o||typeof o!="object")r[s]=o;else if(Array.isArray(o))if(typeof o[0]=="string"){const c=o[0],f=t?.[c];if(f)return r[s]=f(a(o[1]));switch(c){case"Date":r[s]=new Date(o[1]);break;case"Set":const d=new Set;r[s]=d;for(let l=1;lt!=null)}const Jt="x-sveltekit-invalidated",zt="x-sveltekit-trailing-slash";function ne(e){return e instanceof le||e instanceof Re?e.status:500}function Xt(e){return e instanceof Re?e.text:"Internal Error"}let E,J,ye;const Zt=De.toString().includes("$$")||/function \w+\(\) \{\}/.test(De.toString());Zt?(E={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},J={current:null},ye={current:!1}):(E=new class{#e=T({});get data(){return x(this.#e)}set data(t){P(this.#e,t)}#t=T(null);get form(){return x(this.#t)}set form(t){P(this.#t,t)}#n=T(null);get error(){return x(this.#n)}set error(t){P(this.#n,t)}#r=T({});get params(){return x(this.#r)}set params(t){P(this.#r,t)}#a=T({id:null});get route(){return x(this.#a)}set route(t){P(this.#a,t)}#o=T({});get state(){return x(this.#o)}set state(t){P(this.#o,t)}#s=T(-1);get status(){return x(this.#s)}set status(t){P(this.#s,t)}#i=T(new URL("https://example.com"));get url(){return x(this.#i)}set url(t){P(this.#i,t)}},J=new class{#e=T(null);get current(){return x(this.#e)}set current(t){P(this.#e,t)}},ye=new class{#e=T(!1);get current(){return x(this.#e)}set current(t){P(this.#e,t)}},nt.v=()=>ye.current=!0);function Qt(e){Object.assign(E,e)}const en="/__data.json",tn=".html__data.json";function nn(e){return e.endsWith(".html")?e.replace(/\.html$/,tn):e.replace(/\/$/,"")+en}const{tick:rn}=yt,an=new Set(["icon","shortcut icon","apple-touch-icon"]),D=ze(Ze)??{},z=ze(Xe)??{},N={url:qe({}),page:qe({}),navigating:Ee(null),updated:$t()};function Le(e){D[e]=fe()}function on(e,t){let n=e+1;for(;D[n];)delete D[n],n+=1;for(n=t+1;z[n];)delete z[n],n+=1}function q(e){return location.href=e.href,new Promise(()=>{})}async function at(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(L||"/");e&&await e.update()}}function Ge(){}let Te,be,re,C,ke,v;globalThis.__sveltekit_13hoftk.data;const ae=[],oe=[];let O=null;const ee=new Map,ot=new Set,sn=new Set,H=new Set;let w={branch:[],error:null,url:null},xe=!1,se=!1,He=!0,X=!1,M=!1,st=!1,Pe=!1,it,k,I,$;const K=new Set,Ke=new Map;async function Rn(e,t,n){document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),Te=Ot(e),C=document.documentElement,ke=t,be=e.nodes[0],re=e.nodes[1],be(),re(),k=history.state?.[F],I=history.state?.[Y],k||(k=I=Date.now(),history.replaceState({...history.state,[F]:k,[Y]:I},""));const r=D[k];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await _n(ke,n)):(await W({type:"enter",url:Ue(v.hash?wn(new URL(location.href)):location.href),replace_state:!0}),a()),mn()}function cn(){ae.length=0,Pe=!1}function ct(e){oe.some(t=>t?.snapshot)&&(z[e]=oe.map(t=>t?.snapshot?.capture()))}function lt(e){z[e]?.forEach((t,n)=>{oe[n]?.snapshot?.restore(t)})}function We(){Le(k),Fe(Ze,D),ct(I),Fe(Xe,z)}async function Ce(e,t,n,r){let a;const s=await W({type:"goto",url:Ue(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Pe=!0,a=[...Ke.keys()]),t.invalidate&&t.invalidate.forEach(gn)}});return t.invalidateAll&&Be().then(Be).then(()=>{Ke.forEach(({resource:i},o)=>{a?.includes(o)&&i.refresh?.()})}),s}async function ln(e){if(e.id!==O?.id){const t={};K.add(t),O={id:e.id,token:t,promise:dt({...e,preload:t}).then(n=>(K.delete(t),n.type==="loaded"&&n.state.error&&(O=null),n))}}return O.promise}async function we(e){const t=(await he(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].map(n=>n?.[1]()))}function ft(e,t,n){w=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(E,e.props.page),it=new v.root({target:t,props:{...e.props,stores:N,components:oe},hydrate:n,sync:!1}),lt(I),n){const a={from:null,to:{params:w.params,route:{id:w.route?.id??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};H.forEach(s=>s(a))}se=!0}function ie({url:e,params:t,branch:n,status:r,error:a,route:s,form:i}){let o="never";if(L&&(e.pathname===L||e.pathname===L+"/"))o="always";else for(const l of n)l?.slash!==void 0&&(o=l.slash);e.pathname=vt(e.pathname,o),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:s},props:{constructors:Yt(n).map(l=>l.node.component),page:$e(E)}};i!==void 0&&(c.props.form=i);let f={},d=!E,h=0;for(let l=0;l(o&&(c.route=!0),u[l])}),params:new Proxy(r,{get:(u,l)=>(o&&c.params.add(l),u[l])}),data:s?.data??null,url:At(n,()=>{o&&(c.url=!0)},u=>{o&&c.search_params.add(u)},v.hash),async fetch(u,l){u instanceof Request&&(l={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u?.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...l});const{resolved:p,promise:_}=ut(u,l,n);return o&&d(p.href),_},setHeaders:()=>{},depends:d,parent(){return o&&(c.parent=!0),t()},untrack(u){o=!1;try{return u()}finally{o=!0}}};i=await f.universal.load.call(null,h)??null}return{node:f,loader:e,server:s,universal:f.universal?.load?{type:"data",data:i,uses:c}:null,data:i??s?.data??null,slash:f.universal?.trailingSlash??s?.slash}}function ut(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=se?Ut(r,a.href,t):It(r,t);return{resolved:a,promise:s}}function Ye(e,t,n,r,a,s){if(Pe)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(s[i]!==w.params[i])return!0;for(const i of a.dependencies)if(ae.some(o=>o(new URL(i))))return!0;return!1}function Ne(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function fn(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),s=t.searchParams.getAll(r);a.every(i=>s.includes(i))&&s.every(i=>a.includes(i))&&n.delete(r)}return n}function Je({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:$e(E),constructors:[]}}}async function dt({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if(O?.id===e)return K.delete(O.token),O.promise;const{errors:i,layouts:o,leaf:c}=a,f=[...o,c];i.forEach(g=>g?.().catch(()=>{})),f.forEach(g=>g?.[1]().catch(()=>{}));let d=null;const h=w.url?e!==ce(w.url):!1,u=w.route?a.id!==w.route.id:!1,l=fn(w.url,n);let p=!1;const _=f.map((g,y)=>{const b=w.branch[y],A=!!g?.[0]&&(b?.loader!==g[1]||Ye(p,u,h,l,b.server?.uses,r));return A&&(p=!0),A});if(_.some(Boolean)){try{d=await gt(n,_)}catch(g){const y=await V(g,{url:n,params:r,route:{id:e}});return K.has(s)?Je({error:y,url:n,params:r,route:a}):de({status:ne(g),error:y,url:n,route:a})}if(d.type==="redirect")return d}const m=d?.nodes;let R=!1;const S=f.map(async(g,y)=>{if(!g)return;const b=w.branch[y],A=m?.[y];if((!A||A.type==="skip")&&g[1]===b?.loader&&!Ye(R,u,h,l,b.universal?.uses,r))return b;if(R=!0,A?.type==="error")throw A;return Oe({loader:g[1],url:n,params:r,route:a,parent:async()=>{const pe={};for(let ge=0;ge{});const U=[];for(let g=0;gPromise.resolve({}),server_data_node:Ne(s)}),c={node:await re(),loader:re,universal:null,server:null,data:null};return ie({url:n,params:a,branch:[o,c],status:e,error:t,route:null})}catch(o){if(o instanceof Se)return Ce(new URL(o.location,location.href),{},0);throw o}}async function dn(e){const t=e.href;if(ee.has(t))return ee.get(t);let n;try{const r=(async()=>{let a=await v.hooks.reroute({url:new URL(e),fetch:async(s,i)=>ut(s,i,e).promise})??e;if(typeof a=="string"){const s=new URL(e);v.hash?s.hash=a:s.pathname=a,a=s}return a})();ee.set(t,r),n=await r}catch{ee.delete(t);return}return n}async function he(e,t){if(e&&!ue(e,L,v.hash)){const n=await dn(e);if(!n)return;const r=hn(n);for(const a of Te){const s=a.exec(r);if(s)return{id:ce(e),invalidating:t,route:a,params:kt(s),url:e}}}}function hn(e){return bt(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(L.length))||"/"}function ce(e){return(v.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function ht({url:e,type:t,intent:n,delta:r}){let a=!1;const s=je(w,n,e,t);r!==void 0&&(s.navigation.delta=r);const i={...s.navigation,cancel:()=>{a=!0,s.reject(new Error("navigation cancelled"))}};return X||ot.forEach(o=>o(i)),a?null:s}async function W({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i={},redirect_count:o=0,nav_token:c={},accept:f=Ge,block:d=Ge}){const h=$;$=c;const u=await he(t,!1),l=e==="enter"?je(w,u,t,e):ht({url:t,type:e,delta:n?.delta,intent:u});if(!l){d(),$===c&&($=h);return}const p=k,_=I;f(),X=!0,se&&l.navigation.type!=="enter"&&N.navigating.set(J.current=l.navigation);let m=u&&await dt(u);if(!m){if(ue(t,L,v.hash))return await q(t);m=await pt(t,{id:null},await V(new Re(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404)}if(t=u?.url||t,$!==c)return l.reject(new Error("navigation aborted")),!1;if(m.type==="redirect")if(o>=20)m=await de({status:500,error:await V(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}});else return await Ce(new URL(m.location,t).href,{},o+1,c),!1;else m.props.page.status>=400&&await N.updated.check()&&(await at(),await q(t));if(cn(),Le(p),ct(_),m.props.page.url.pathname!==t.pathname&&(t.pathname=m.props.page.url.pathname),i=n?n.state:i,!n){const g=s?0:1,y={[F]:k+=g,[Y]:I+=g,[Qe]:i};(s?history.replaceState:history.pushState).call(history,y,"",t),s||on(k,I)}if(O=null,m.props.page.state=i,se){const g=(await Promise.all(Array.from(sn,y=>y(l.navigation)))).filter(y=>typeof y=="function");if(g.length>0){let y=function(){g.forEach(b=>{H.delete(b)})};g.push(y),g.forEach(b=>{H.add(b)})}w=m.state,m.props.page&&(m.props.page.url=t),it.$set(m.props),Qt(m.props.page),st=!0}else ft(m,ke,!1);const{activeElement:R}=document;await rn();const S=n?n.scroll:a?fe():null;if(He){const g=t.hash&&document.getElementById(_t(t));S?scrollTo(S.x,S.y):g?g.scrollIntoView():scrollTo(0,0)}const U=document.activeElement!==R&&document.activeElement!==document.body;!r&&!U&&yn(t),He=!0,m.props.page&&Object.assign(E,m.props.page),X=!1,e==="popstate"&<(I),l.fulfil(void 0),H.forEach(g=>g(l.navigation)),N.navigating.set(J.current=null)}async function pt(e,t,n,r){return e.origin===Z&&e.pathname===location.pathname&&!xe?await de({status:r,error:n,url:e,route:t}):await q(e)}function pn(){let e,t,n;C.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(e),e=setTimeout(()=>{s(c,j.hover)},20)});function r(o){o.defaultPrevented||s(o.composedPath()[0],j.tap)}C.addEventListener("mousedown",r),C.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(we(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(o,c){const f=tt(o,C),d=f===t&&c>=n;if(!f||d)return;const{url:h,external:u,download:l}=ve(f,L,v.hash);if(u||l)return;const p=te(f),_=h&&ce(w.url)===ce(h);if(!(p.reload||_))if(c<=p.preload_data){t=f,n=j.tap;const m=await he(h,!1);if(!m)return;ln(m)}else c<=p.preload_code&&(t=f,n=c,we(h))}function i(){a.disconnect();for(const o of C.querySelectorAll("a")){const{url:c,external:f,download:d}=ve(o,L,v.hash);if(f||d)continue;const h=te(o);h.reload||(h.preload_code===j.viewport&&a.observe(o),h.preload_code===j.eager&&we(c))}}H.add(i),i()}function V(e,t){if(e instanceof le)return e.body;const n=ne(e),r=Xt(e);return v.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function In(e,t={}){return e=new URL(Ue(e)),e.origin!==Z?Promise.reject(new Error("goto: invalid URL")):Ce(e,t,0)}function gn(e){if(typeof e=="function")ae.push(e);else{const{href:t}=new URL(e,location.href);ae.push(n=>n.href===t)}}function mn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(We(),!X){const r=je(w,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};ot.forEach(s=>s(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&We()}),navigator.connection?.saveData||pn(),C.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=tt(t.composedPath()[0],C);if(!n)return;const{url:r,external:a,target:s,download:i}=ve(n,L,v.hash);if(!r)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const o=te(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||i)return;const[f,d]=(v.hash?r.hash.replace(/^#/,""):r.href).split("#"),h=f===me(location);if(a||o.reload&&(!h||!d)){ht({url:r,type:"link"})?X=!0:t.preventDefault();return}if(d!==void 0&&h){const[,u]=w.url.href.split("#");if(u===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)window.scrollTo({top:0});else{const l=n.ownerDocument.getElementById(decodeURIComponent(d));l&&(l.scrollIntoView(),l.focus())}return}if(M=!0,Le(k),e(r),!o.replace_state)return;M=!1}t.preventDefault(),await new Promise(u=>{requestAnimationFrame(()=>{setTimeout(u,0)}),setTimeout(u,100)}),await W({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href})}),C.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const i=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ue(i,L,!1))return;const o=t.target,c=te(o);if(c.reload)return;t.preventDefault(),t.stopPropagation();const f=new FormData(o),d=r?.getAttribute("name");d&&f.append(d,r?.getAttribute("value")??""),i.search=new URLSearchParams(f).toString(),W({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href})}),addEventListener("popstate",async t=>{if(!Ae){if(t.state?.[F]){const n=t.state[F];if($={},n===k)return;const r=D[n],a=t.state[Qe]??{},s=new URL(t.state[jt]??location.href),i=t.state[Y],o=w.url?me(location)===me(w.url):!1;if(i===I&&(st||o)){a!==E.state&&(E.state=a),e(s),D[k]=fe(),r&&scrollTo(r.x,r.y),k=n;return}const f=n-k;await W({type:"popstate",url:s,popped:{state:a,scroll:r,delta:f},accept:()=>{k=n,I=i},block:()=>{history.go(-f)},nav_token:$})}else if(!M){const n=new URL(location.href);e(n),v.hash&&location.reload()}}}),addEventListener("hashchange",()=>{M&&(M=!1,history.replaceState({...history.state,[F]:++k,[Y]:I},"",location.href))});for(const t of document.querySelectorAll("link"))an.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&N.navigating.set(J.current=null)});function e(t){w.url=E.url=t,N.page.set($e(E)),N.page.notify()}}async function _n(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:i,data:o,form:c}){xe=!0;const f=new URL(location.href);let d;({params:a={},route:s={id:null}}=await he(f,!1)||{}),d=Te.find(({id:l})=>l===s.id);let h,u=!0;try{const l=r.map(async(_,m)=>{const R=o[m];return R?.uses&&(R.uses=mt(R.uses)),Oe({loader:v.nodes[_],url:f,params:a,route:s,parent:async()=>{const S={};for(let U=0;Us?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let s;throw a.headers.get("content-type")?.includes("application/json")?s=await a.json():a.status===404?s="Not Found":a.status===500&&(s="Internal Error"),new le(a.status,s)}return new Promise(async s=>{const i=new Map,o=a.body.getReader(),c=new TextDecoder;function f(h){return Kt(h,{...v.decoders,Promise:u=>new Promise((l,p)=>{i.set(u,{fulfil:l,reject:p})})})}let d="";for(;;){const{done:h,value:u}=await o.read();if(h&&!d)break;for(d+=!u&&d?` +`:c.decode(u,{stream:!0});;){const l=d.indexOf(` +`);if(l===-1)break;const p=JSON.parse(d.slice(0,l));if(d=d.slice(l+1),p.type==="redirect")return s(p);if(p.type==="data")p.nodes?.forEach(_=>{_?.type==="data"&&(_.uses=mt(_.uses),_.data=f(_.data))}),s(p);else if(p.type==="chunk"){const{id:_,data:m,error:R}=p,S=i.get(_);i.delete(_),R?S.reject(f(R)):S.fulfil(f(m))}}}})}function mt(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Ae=!1;function yn(e){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=_t(e);if(n&&document.getElementById(n)){const{x:a,y:s}=fe();setTimeout(()=>{const i=history.state;Ae=!0,location.replace(`#${n}`),v.hash&&location.replace(e.hash),history.replaceState(i,"",e.hash),scrollTo(a,s),Ae=!1})}else{const a=document.body,s=a.getAttribute("tabindex");a.tabIndex=-1,a.focus({preventScroll:!0,focusVisible:!1}),s!==null?a.setAttribute("tabindex",s):a.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let s=0;s{if(r.rangeCount===a.length){for(let s=0;s{a=c,s=f});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n},willUnload:!t,type:r,complete:i},fulfil:a,reject:s}}function $e(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function wn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function _t(e){let t;if(v.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Rn as a,In as g,kn as l,E as p,N as s}; diff --git a/webapp/assets/_app/immutable/chunks/CclkODgu.js b/webapp/assets/_app/immutable/chunks/CclkODgu.js new file mode 100644 index 00000000..f3c6b3c0 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/CclkODgu.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as Oe}from"./B3Pzt0F_.js";import{p as qe,E as Ie,o as Ke,f as x,j as t,r,k as o,g as e,m,z as B,t as y,x as ue,u as c,v,n as T,s as i,e as be,c as u,D as Ge,d as He}from"./D8EpLgQ1.js";import{p as ge,i as $}from"./5WA7h8uK.js";import{e as Je,i as Qe}from"./u94nIB4-.js";import{r as me,b as ye,g as Ve}from"./CiE1LlKV.js";import{a as Xe,b as Ye}from"./C6k1Q4We.js";import{p as Ze}from"./D4Caz1gY.js";import{M as ea}from"./qB7B8uiS.js";var aa=x('

                '),ta=x('
                Owner:
                '),ra=x('
                '),sa=x(""),oa=x(''),na=x('

                Leave empty to auto-generate a new secret

                '),ia=x('
                Updating...
                '),da=x('

                Name:
                Endpoint:
                Current Credentials:
                Current Pool Balancer:

                Leave unchanged to keep current credentials

                Round Robin distributes jobs evenly across pools, Pack fills pools in order

                ');function xa(xe,D){qe(D,!1);let d=ge(D,"entity",8),k=ge(D,"entityType",8);const P=Ie();let C=m(!1),w=m(""),M=m([]),R=m(!1),f=m(""),_=m(""),h=m(""),b=m(!1);function fe(){if(k()==="repository"){const l=d();return`${l.owner}/${l.name}`}return d().name||""}function W(){return k().charAt(0).toUpperCase()+k().slice(1)}function _e(){return k()==="repository"&&d().owner||""}async function he(){try{i(R,!0),i(M,await Ve.listCredentials())}catch(l){i(w,l instanceof Error?l.message:"Failed to load credentials")}finally{i(R,!1)}}function ke(){i(f,d().credentials_name||""),i(_,d().pool_balancing_type||"roundrobin"),i(h,""),i(b,!1)}async function we(){try{i(C,!0),i(w,"");const l={};let E=!1;if(e(f)&&e(f)!==d().credentials_name&&(l.credentials_name=e(f),E=!0),e(_)&&e(_)!==d().pool_balancing_type&&(l.pool_balancer_type=e(_),E=!0),e(b)){if(!e(h).trim()){i(w,"Please enter a webhook secret or uncheck the option to change it");return}l.webhook_secret=e(h),E=!0}if(!E){P("close");return}P("submit",l)}catch(l){i(w,l instanceof Error?l.message:`Failed to update ${k()}`)}finally{i(C,!1)}}Ke(()=>{he(),ke()}),Oe(),ea(xe,{$$events:{close:()=>P("close")},children:(l,E)=>{var j=da(),F=t(j),N=t(F),Ce=t(N);r(N);var Y=o(N,2),Ee=t(Y,!0);r(Y),r(F);var z=o(F,2),Z=t(z);{var Se=a=>{var s=aa(),n=t(s),p=t(n,!0);r(n),r(s),y(()=>v(p,e(w))),u(a,s)};$(Z,a=>{e(w)&&a(Se)})}var A=o(Z,2),L=t(A),Ue=t(L);r(L);var ee=o(L,2),ae=t(ee);{var $e=a=>{var s=ta(),n=o(t(s),2),p=t(n,!0);r(n),r(s),y(S=>v(p,S),[()=>c(_e)]),u(a,s)};$(ae,a=>{k()==="repository"&&a($e)})}var O=o(ae,2),te=o(t(O),2),Pe=t(te,!0);r(te),r(O);var q=o(O,2),re=o(t(q),2),Be=t(re,!0);r(re),r(q);var I=o(q,2),se=o(t(I),2),Te=t(se,!0);r(se),r(I);var oe=o(I,2),ne=o(t(oe),2),De=t(ne,!0);r(ne),r(oe),r(ee),r(A);var K=o(A,2),G=t(K),Me=o(t(G),2);{var Re=a=>{var s=ra();u(a,s)},We=a=>{var s=oa();y(()=>{e(f),ue(()=>{e(M)})});var n=t(s);n.value=n.__value="";var p=o(n);Je(p,1,()=>e(M),Qe,(S,g)=>{var U=sa(),Le=t(U);r(U);var pe={};y(()=>{v(Le,`${e(g),c(()=>e(g).name)??""} (${e(g),c(()=>e(g).endpoint?.name||"Unknown")??""})`),pe!==(pe=(e(g),c(()=>e(g).name)))&&(U.value=(U.__value=(e(g),c(()=>e(g).name)))??"")}),u(S,U)}),r(s),ye(s,()=>e(f),S=>i(f,S)),u(a,s)};$(Me,a=>{e(R)?a(Re):a(We,!1)})}B(2),r(G);var H=o(G,2),J=o(t(H),2);y(()=>{e(_),ue(()=>{})});var Q=t(J);Q.value=Q.__value="roundrobin";var ie=o(Q);ie.value=ie.__value="pack",r(J),B(2),r(H);var de=o(H,2),V=t(de),le=t(V);me(le),B(2),r(V);var je=o(V,2);{var Fe=a=>{var s=na(),n=o(t(s),2);me(n),B(2),r(s),y(()=>n.required=e(b)),Ye(n,()=>e(h),p=>i(h,p)),u(a,s)};$(je,a=>{e(b)&&a(Fe)})}r(de),r(K);var ce=o(K,2),ve=t(ce),X=o(ve,2),Ne=t(X);{var ze=a=>{var s=ia();u(a,s)},Ae=a=>{var s=Ge();y(n=>v(s,`Update ${n??""}`),[()=>c(W)]),u(a,s)};$(Ne,a=>{e(C)?a(ze):a(Ae,!1)})}r(X),r(ce),r(z),r(j),y((a,s,n,p)=>{v(Ce,`Update ${a??""}`),v(Ee,s),v(Ue,`${n??""} Information`),v(Pe,(T(d()),c(()=>d().name))),v(Be,(T(d()),c(()=>d().endpoint?.name))),v(Te,(T(d()),c(()=>d().credentials_name))),v(De,(T(d()),c(()=>d().pool_balancing_type||"roundrobin"))),X.disabled=p},[()=>c(W),()=>c(fe),()=>c(W),()=>(e(C),e(b),e(h),c(()=>e(C)||e(b)&&!e(h).trim()))]),ye(J,()=>e(_),a=>i(_,a)),Xe(le,()=>e(b),a=>i(b,a)),be("click",ve,()=>P("close")),be("submit",z,Ze(we)),u(l,j)},$$slots:{default:!0}}),He()}export{xa as U}; diff --git a/webapp/assets/_app/immutable/chunks/CiE1LlKV.js b/webapp/assets/_app/immutable/chunks/CiE1LlKV.js new file mode 100644 index 00000000..89e2bf89 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/CiE1LlKV.js @@ -0,0 +1,7 @@ +import"./DsnmJJEf.js";import{i as Tr}from"./B3Pzt0F_.js";import{t as Ie,K as Y,L as Ke,aj as Br,aW as Dr,T as ht,a3 as Lr,af as jr,aX as kr,aY as zr,aZ as ut,Y as Fr,a_ as Gr,Z as we,M as Jt,ae as Xe,P as Kt,F as ot,a8 as _r,a$ as qr,b0 as Hr,aw as $r,W as Nr,b1 as Wr,b2 as Qr,b3 as Mr,g as k,b4 as Jr,b5 as Kr,a2 as Ot,b6 as Xr,b7 as Yr,b8 as Zr,b9 as es,ba as ts,at as rs,bb as ss,bc as as,bd as os,be as ns,p as ls,E as is,l as ee,a as cs,f as ps,e as ds,c as ue,d as hs,n as oe,m as te,s as re,j as qe,k as Pt,r as He,C as nt,B as us,b as Os}from"./D8EpLgQ1.js";import{l as bt,p as se,i as $e}from"./5WA7h8uK.js";function mt(t,e,r=!1,s=!1,o=!1){var a=t,n="";Ie(()=>{var l=Br;if(n===(n=e()??"")){Y&&Ke();return}if(l.nodes_start!==null&&(Dr(l.nodes_start,l.nodes_end),l.nodes_start=l.nodes_end=null),n!==""){if(Y){ht.data;for(var i=Ke(),c=i;i!==null&&(i.nodeType!==Lr||i.data!=="");)c=i,i=jr(i);if(i===null)throw kr(),zr;ut(ht,c),a=Fr(i);return}var p=n+"";r?p=`${p}`:s&&(p=`${p}`);var R=Gr(p);if((r||s)&&(R=we(R)),ut(we(R),R.lastChild),r||s)for(;we(R);)a.before(we(R));else a.before(R)}})}function Ps(t,e,r,s,o){Y&&Ke();var a=e.$$slots?.[r],n=!1;a===!0&&(a=e[r==="default"?"children":r],n=!0),a===void 0||a(t,n?()=>s:s)}function bs(t,e){var r=void 0,s;Jt(()=>{r!==(r=e())&&(s&&(Xe(s),s=null),r&&(s=Kt(()=>{ot(()=>r(t))})))})}function Xt(t){var e,r,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e=0;){var l=n+a;(n===0||Vt.includes(s[n-1]))&&(l===s.length||Vt.includes(s[l]))?s=(n===0?"":s.substring(0,n))+s.substring(l+1):n=l}}return s===""?null:s}function St(t,e=!1){var r=e?" !important;":";",s="";for(var o in t){var a=t[o];a!=null&&a!==""&&(s+=" "+o+": "+a+r)}return s}function Ne(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function As(t,e){if(e){var r="",s,o;if(Array.isArray(e)?(s=e[0],o=e[1]):s=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,n=0,l=!1,i=[];s&&i.push(...Object.keys(s).map(Ne)),o&&i.push(...Object.keys(o).map(Ne));var c=0,p=-1;const y=t.length;for(var R=0;R{Ce(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),$r(()=>{e.disconnect()})}function Uo(t,e,r=e){var s=!0;Nr(t,"change",o=>{var a=o?"[selected]":":checked",n;if(t.multiple)n=[].map.call(t.querySelectorAll(a),me);else{var l=t.querySelector(a)??t.querySelector("option:not([disabled])");n=l&&me(l)}r(n)}),ot(()=>{var o=e();if(Ce(t,o,s),s&&o===void 0){var a=t.querySelector(":checked");a!==null&&(o=me(a),r(o))}t.__value=o,s=!1}),Yt(t)}function me(t){return"__value"in t?t.__value:t.value}const Oe=Symbol("class"),Pe=Symbol("style"),Zt=Symbol("is custom element"),er=Symbol("is html");function To(t){if(Y){var e=!1,r=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var s=t.value;Ue(t,"value",null),t.value=s}if(t.hasAttribute("checked")){var o=t.checked;Ue(t,"checked",null),t.checked=o}}};t.__on_r=r,ss(r),as()}}function Bo(t,e){var r=lt(t);r.value===(r.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function fs(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function Ue(t,e,r,s){var o=lt(t);Y&&(o[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||o[e]!==(o[e]=r)&&(e==="loading"&&(t[os]=r),r==null?t.removeAttribute(e):typeof r!="string"&&tr(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function ys(t,e,r,s,o=!1){var a=lt(t),n=a[Zt],l=!a[er];let i=Y&&n;i&&Ot(!1);var c=e||{},p=t.tagName==="OPTION";for(var R in e)R in r||(r[R]=null);r.class?r.class=Vs(r.class):r[Oe]&&(r.class=null),r[Pe]&&(r.style??=null);var I=tr(t);for(const E in r){let v=r[E];if(p&&E==="value"&&v==null){t.value=t.__value="",c[E]=v;continue}if(E==="class"){var T=t.namespaceURI==="http://www.w3.org/1999/xhtml";Ee(t,T,v,s,e?.[Oe],r[Oe]),c[E]=v,c[Oe]=r[Oe];continue}if(E==="style"){Rs(t,v,e?.[Pe],r[Pe]),c[E]=v,c[Pe]=r[Pe];continue}var f=c[E];if(!(v===f&&!(v===void 0&&t.hasAttribute(E)))){c[E]=v;var y=E[0]+E[1];if(y!=="$$")if(y==="on"){const U={},L="$$"+E;let B=E.slice(2);var w=ns(B);if(Xr(B)&&(B=B.slice(0,-7),U.capture=!0),!w&&f){if(v!=null)continue;t.removeEventListener(B,c[L],U),c[L]=null}if(v!=null)if(w)t[`__${B}`]=v,Zr([B]);else{let Z=function(ce){c[E].call(this,ce)};c[L]=Yr(B,t,Z,U)}else w&&(t[`__${B}`]=void 0)}else if(E==="style")Ue(t,E,v);else if(E==="autofocus")es(t,!!v);else if(!n&&(E==="__value"||E==="value"&&v!=null))t.value=t.__value=v;else if(E==="selected"&&p)fs(t,v);else{var C=E;l||(C=ts(C));var D=C==="defaultValue"||C==="defaultChecked";if(v==null&&!n&&!D)if(a[E]=null,C==="value"||C==="checked"){let U=t;const L=e===void 0;if(C==="value"){let B=U.defaultValue;U.removeAttribute(C),U.defaultValue=B,U.value=U.__value=L?B:null}else{let B=U.defaultChecked;U.removeAttribute(C),U.defaultChecked=B,U.checked=L?B:!1}}else t.removeAttribute(E);else D||I.includes(C)&&(n||typeof v!="string")?(t[C]=v,C in a&&(a[C]=rs)):typeof v!="function"&&Ue(t,C,v)}}}return i&&Ot(!0),c}function ws(t,e,r=[],s=[],o,a=!1){Wr(r,s,n=>{var l=void 0,i={},c=t.nodeName==="SELECT",p=!1;if(Jt(()=>{var I=e(...n.map(k)),T=ys(t,l,I,o,a);p&&c&&"value"in I&&Ce(t,I.value);for(let y of Object.getOwnPropertySymbols(i))I[y]||Xe(i[y]);for(let y of Object.getOwnPropertySymbols(I)){var f=I[y];y.description===Jr&&(!l||f!==l[y])&&(i[y]&&Xe(i[y]),i[y]=Kt(()=>bs(t,()=>f))),T[y]=f}l=T}),c){var R=t;ot(()=>{Ce(R,l.value,!0),Yt(R)})}p=!0})}function lt(t){return t.__attributes??={[Zt]:t.nodeName.includes("-"),[er]:t.namespaceURI===Qr}}var At=new Map;function tr(t){var e=At.get(t.nodeName);if(e)return e;At.set(t.nodeName,e=[]);for(var r,s=t,o=Element.prototype;o!==s;){r=Kr(s);for(var a in r)r[a].set&&e.push(a);s=Mr(s)}return e}function rr(t,e){return function(){return t.apply(e,arguments)}}const{toString:Is}=Object.prototype,{getPrototypeOf:it}=Object,{iterator:De,toStringTag:sr}=Symbol,Le=(t=>e=>{const r=Is.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),N=t=>(t=t.toLowerCase(),e=>Le(e)===t),je=t=>e=>typeof e===t,{isArray:de}=Array,Ve=je("undefined");function Se(t){return t!==null&&!Ve(t)&&t.constructor!==null&&!Ve(t.constructor)&&_(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const ar=N("ArrayBuffer");function Es(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&ar(t.buffer),e}const gs=je("string"),_=je("function"),or=je("number"),Ae=t=>t!==null&&typeof t=="object",xs=t=>t===!0||t===!1,ge=t=>{if(Le(t)!=="object")return!1;const e=it(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(sr in t)&&!(De in t)},vs=t=>{if(!Ae(t)||Se(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Cs=N("Date"),Us=N("File"),Ts=N("Blob"),Bs=N("FileList"),Ds=t=>Ae(t)&&_(t.pipe),Ls=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||_(t.append)&&((e=Le(t))==="formdata"||e==="object"&&_(t.toString)&&t.toString()==="[object FormData]"))},js=N("URLSearchParams"),[ks,zs,Fs,Gs]=["ReadableStream","Request","Response","Headers"].map(N),_s=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Re(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let s,o;if(typeof t!="object"&&(t=[t]),de(t))for(s=0,o=t.length;s0;)if(o=r[s],e===o.toLowerCase())return o;return null}const ne=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,lr=t=>!Ve(t)&&t!==ne;function Ye(){const{caseless:t}=lr(this)&&this||{},e={},r=(s,o)=>{const a=t&&nr(e,o)||o;ge(e[a])&&ge(s)?e[a]=Ye(e[a],s):ge(s)?e[a]=Ye({},s):de(s)?e[a]=s.slice():e[a]=s};for(let s=0,o=arguments.length;s(Re(e,(o,a)=>{r&&_(o)?t[a]=rr(o,r):t[a]=o},{allOwnKeys:s}),t),Hs=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),$s=(t,e,r,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},Ns=(t,e,r,s)=>{let o,a,n;const l={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),a=o.length;a-- >0;)n=o[a],(!s||s(n,t,e))&&!l[n]&&(e[n]=t[n],l[n]=!0);t=r!==!1&&it(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},Ws=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const s=t.indexOf(e,r);return s!==-1&&s===r},Qs=t=>{if(!t)return null;if(de(t))return t;let e=t.length;if(!or(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},Ms=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&it(Uint8Array)),Js=(t,e)=>{const s=(t&&t[De]).call(t);let o;for(;(o=s.next())&&!o.done;){const a=o.value;e.call(t,a[0],a[1])}},Ks=(t,e)=>{let r;const s=[];for(;(r=t.exec(e))!==null;)s.push(r);return s},Xs=N("HTMLFormElement"),Ys=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,s,o){return s.toUpperCase()+o}),Rt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Zs=N("RegExp"),ir=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),s={};Re(r,(o,a)=>{let n;(n=e(o,a,t))!==!1&&(s[a]=n||o)}),Object.defineProperties(t,s)},ea=t=>{ir(t,(e,r)=>{if(_(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const s=t[r];if(_(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},ta=(t,e)=>{const r={},s=o=>{o.forEach(a=>{r[a]=!0})};return de(t)?s(t):s(String(t).split(e)),r},ra=()=>{},sa=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function aa(t){return!!(t&&_(t.append)&&t[sr]==="FormData"&&t[De])}const oa=t=>{const e=new Array(10),r=(s,o)=>{if(Ae(s)){if(e.indexOf(s)>=0)return;if(Se(s))return s;if(!("toJSON"in s)){e[o]=s;const a=de(s)?[]:{};return Re(s,(n,l)=>{const i=r(n,o+1);!Ve(i)&&(a[l]=i)}),e[o]=void 0,a}}return s};return r(t,0)},na=N("AsyncFunction"),la=t=>t&&(Ae(t)||_(t))&&_(t.then)&&_(t.catch),cr=((t,e)=>t?setImmediate:e?((r,s)=>(ne.addEventListener("message",({source:o,data:a})=>{o===ne&&a===r&&s.length&&s.shift()()},!1),o=>{s.push(o),ne.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",_(ne.postMessage)),ia=typeof queueMicrotask<"u"?queueMicrotask.bind(ne):typeof process<"u"&&process.nextTick||cr,ca=t=>t!=null&&_(t[De]),h={isArray:de,isArrayBuffer:ar,isBuffer:Se,isFormData:Ls,isArrayBufferView:Es,isString:gs,isNumber:or,isBoolean:xs,isObject:Ae,isPlainObject:ge,isEmptyObject:vs,isReadableStream:ks,isRequest:zs,isResponse:Fs,isHeaders:Gs,isUndefined:Ve,isDate:Cs,isFile:Us,isBlob:Ts,isRegExp:Zs,isFunction:_,isStream:Ds,isURLSearchParams:js,isTypedArray:Ms,isFileList:Bs,forEach:Re,merge:Ye,extend:qs,trim:_s,stripBOM:Hs,inherits:$s,toFlatObject:Ns,kindOf:Le,kindOfTest:N,endsWith:Ws,toArray:Qs,forEachEntry:Js,matchAll:Ks,isHTMLForm:Xs,hasOwnProperty:Rt,hasOwnProp:Rt,reduceDescriptors:ir,freezeMethods:ea,toObjectSet:ta,toCamelCase:Ys,noop:ra,toFiniteNumber:sa,findKey:nr,global:ne,isContextDefined:lr,isSpecCompliantForm:aa,toJSONObject:oa,isAsyncFn:na,isThenable:la,setImmediate:cr,asap:ia,isIterable:ca};function g(t,e,r,s,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),s&&(this.request=s),o&&(this.response=o,this.status=o.status?o.status:null)}h.inherits(g,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:h.toJSONObject(this.config),code:this.code,status:this.status}}});const pr=g.prototype,dr={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{dr[t]={value:t}});Object.defineProperties(g,dr);Object.defineProperty(pr,"isAxiosError",{value:!0});g.from=(t,e,r,s,o,a)=>{const n=Object.create(pr);return h.toFlatObject(t,n,function(i){return i!==Error.prototype},l=>l!=="isAxiosError"),g.call(n,t.message,e,r,s,o),n.cause=t,n.name=t.name,a&&Object.assign(n,a),n};const pa=null;function Ze(t){return h.isPlainObject(t)||h.isArray(t)}function hr(t){return h.endsWith(t,"[]")?t.slice(0,-2):t}function ft(t,e,r){return t?t.concat(e).map(function(o,a){return o=hr(o),!r&&a?"["+o+"]":o}).join(r?".":""):e}function da(t){return h.isArray(t)&&!t.some(Ze)}const ha=h.toFlatObject(h,{},null,function(e){return/^is[A-Z]/.test(e)});function ke(t,e,r){if(!h.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=h.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,w){return!h.isUndefined(w[y])});const s=r.metaTokens,o=r.visitor||p,a=r.dots,n=r.indexes,i=(r.Blob||typeof Blob<"u"&&Blob)&&h.isSpecCompliantForm(e);if(!h.isFunction(o))throw new TypeError("visitor must be a function");function c(f){if(f===null)return"";if(h.isDate(f))return f.toISOString();if(h.isBoolean(f))return f.toString();if(!i&&h.isBlob(f))throw new g("Blob is not supported. Use a Buffer instead.");return h.isArrayBuffer(f)||h.isTypedArray(f)?i&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function p(f,y,w){let C=f;if(f&&!w&&typeof f=="object"){if(h.endsWith(y,"{}"))y=s?y:y.slice(0,-2),f=JSON.stringify(f);else if(h.isArray(f)&&da(f)||(h.isFileList(f)||h.endsWith(y,"[]"))&&(C=h.toArray(f)))return y=hr(y),C.forEach(function(E,v){!(h.isUndefined(E)||E===null)&&e.append(n===!0?ft([y],v,a):n===null?y:y+"[]",c(E))}),!1}return Ze(f)?!0:(e.append(ft(w,y,a),c(f)),!1)}const R=[],I=Object.assign(ha,{defaultVisitor:p,convertValue:c,isVisitable:Ze});function T(f,y){if(!h.isUndefined(f)){if(R.indexOf(f)!==-1)throw Error("Circular reference detected in "+y.join("."));R.push(f),h.forEach(f,function(C,D){(!(h.isUndefined(C)||C===null)&&o.call(e,C,h.isString(D)?D.trim():D,y,I))===!0&&T(C,y?y.concat(D):[D])}),R.pop()}}if(!h.isObject(t))throw new TypeError("data must be an object");return T(t),e}function yt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function ct(t,e){this._pairs=[],t&&ke(t,this,e)}const ur=ct.prototype;ur.append=function(e,r){this._pairs.push([e,r])};ur.toString=function(e){const r=e?function(s){return e.call(this,s,yt)}:yt;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function ua(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Or(t,e,r){if(!e)return t;const s=r&&r.encode||ua;h.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let a;if(o?a=o(e,r):a=h.isURLSearchParams(e)?e.toString():new ct(e,r).toString(s),a){const n=t.indexOf("#");n!==-1&&(t=t.slice(0,n)),t+=(t.indexOf("?")===-1?"?":"&")+a}return t}class wt{constructor(){this.handlers=[]}use(e,r,s){return this.handlers.push({fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){h.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Pr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Oa=typeof URLSearchParams<"u"?URLSearchParams:ct,Pa=typeof FormData<"u"?FormData:null,ba=typeof Blob<"u"?Blob:null,ma={isBrowser:!0,classes:{URLSearchParams:Oa,FormData:Pa,Blob:ba},protocols:["http","https","file","blob","url","data"]},pt=typeof window<"u"&&typeof document<"u",et=typeof navigator=="object"&&navigator||void 0,Va=pt&&(!et||["ReactNative","NativeScript","NS"].indexOf(et.product)<0),Sa=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Aa=pt&&window.location.href||"http://localhost",Ra=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pt,hasStandardBrowserEnv:Va,hasStandardBrowserWebWorkerEnv:Sa,navigator:et,origin:Aa},Symbol.toStringTag,{value:"Module"})),G={...Ra,...ma};function fa(t,e){return ke(t,new G.classes.URLSearchParams,{visitor:function(r,s,o,a){return G.isNode&&h.isBuffer(r)?(this.append(s,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...e})}function ya(t){return h.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function wa(t){const e={},r=Object.keys(t);let s;const o=r.length;let a;for(s=0;s=r.length;return n=!n&&h.isArray(o)?o.length:n,i?(h.hasOwnProp(o,n)?o[n]=[o[n],s]:o[n]=s,!l):((!o[n]||!h.isObject(o[n]))&&(o[n]=[]),e(r,s,o[n],a)&&h.isArray(o[n])&&(o[n]=wa(o[n])),!l)}if(h.isFormData(t)&&h.isFunction(t.entries)){const r={};return h.forEachEntry(t,(s,o)=>{e(ya(s),o,r,0)}),r}return null}function Ia(t,e,r){if(h.isString(t))try{return(e||JSON.parse)(t),h.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}const fe={transitional:Pr,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const s=r.getContentType()||"",o=s.indexOf("application/json")>-1,a=h.isObject(e);if(a&&h.isHTMLForm(e)&&(e=new FormData(e)),h.isFormData(e))return o?JSON.stringify(br(e)):e;if(h.isArrayBuffer(e)||h.isBuffer(e)||h.isStream(e)||h.isFile(e)||h.isBlob(e)||h.isReadableStream(e))return e;if(h.isArrayBufferView(e))return e.buffer;if(h.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let l;if(a){if(s.indexOf("application/x-www-form-urlencoded")>-1)return fa(e,this.formSerializer).toString();if((l=h.isFileList(e))||s.indexOf("multipart/form-data")>-1){const i=this.env&&this.env.FormData;return ke(l?{"files[]":e}:e,i&&new i,this.formSerializer)}}return a||o?(r.setContentType("application/json",!1),Ia(e)):e}],transformResponse:[function(e){const r=this.transitional||fe.transitional,s=r&&r.forcedJSONParsing,o=this.responseType==="json";if(h.isResponse(e)||h.isReadableStream(e))return e;if(e&&h.isString(e)&&(s&&!this.responseType||o)){const n=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(l){if(n)throw l.name==="SyntaxError"?g.from(l,g.ERR_BAD_RESPONSE,this,null,this.response):l}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:G.classes.FormData,Blob:G.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};h.forEach(["delete","get","head","post","put","patch"],t=>{fe.headers[t]={}});const Ea=h.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ga=t=>{const e={};let r,s,o;return t&&t.split(` +`).forEach(function(n){o=n.indexOf(":"),r=n.substring(0,o).trim().toLowerCase(),s=n.substring(o+1).trim(),!(!r||e[r]&&Ea[r])&&(r==="set-cookie"?e[r]?e[r].push(s):e[r]=[s]:e[r]=e[r]?e[r]+", "+s:s)}),e},It=Symbol("internals");function be(t){return t&&String(t).trim().toLowerCase()}function xe(t){return t===!1||t==null?t:h.isArray(t)?t.map(xe):String(t)}function xa(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=r.exec(t);)e[s[1]]=s[2];return e}const va=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Qe(t,e,r,s,o){if(h.isFunction(s))return s.call(this,e,r);if(o&&(e=r),!!h.isString(e)){if(h.isString(s))return e.indexOf(s)!==-1;if(h.isRegExp(s))return s.test(e)}}function Ca(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,s)=>r.toUpperCase()+s)}function Ua(t,e){const r=h.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+r,{value:function(o,a,n){return this[s].call(this,e,o,a,n)},configurable:!0})})}let q=class{constructor(e){e&&this.set(e)}set(e,r,s){const o=this;function a(l,i,c){const p=be(i);if(!p)throw new Error("header name must be a non-empty string");const R=h.findKey(o,p);(!R||o[R]===void 0||c===!0||c===void 0&&o[R]!==!1)&&(o[R||i]=xe(l))}const n=(l,i)=>h.forEach(l,(c,p)=>a(c,p,i));if(h.isPlainObject(e)||e instanceof this.constructor)n(e,r);else if(h.isString(e)&&(e=e.trim())&&!va(e))n(ga(e),r);else if(h.isObject(e)&&h.isIterable(e)){let l={},i,c;for(const p of e){if(!h.isArray(p))throw TypeError("Object iterator must return a key-value pair");l[c=p[0]]=(i=l[c])?h.isArray(i)?[...i,p[1]]:[i,p[1]]:p[1]}n(l,r)}else e!=null&&a(r,e,s);return this}get(e,r){if(e=be(e),e){const s=h.findKey(this,e);if(s){const o=this[s];if(!r)return o;if(r===!0)return xa(o);if(h.isFunction(r))return r.call(this,o,s);if(h.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=be(e),e){const s=h.findKey(this,e);return!!(s&&this[s]!==void 0&&(!r||Qe(this,this[s],s,r)))}return!1}delete(e,r){const s=this;let o=!1;function a(n){if(n=be(n),n){const l=h.findKey(s,n);l&&(!r||Qe(s,s[l],l,r))&&(delete s[l],o=!0)}}return h.isArray(e)?e.forEach(a):a(e),o}clear(e){const r=Object.keys(this);let s=r.length,o=!1;for(;s--;){const a=r[s];(!e||Qe(this,this[a],a,e,!0))&&(delete this[a],o=!0)}return o}normalize(e){const r=this,s={};return h.forEach(this,(o,a)=>{const n=h.findKey(s,a);if(n){r[n]=xe(o),delete r[a];return}const l=e?Ca(a):String(a).trim();l!==a&&delete r[a],r[l]=xe(o),s[l]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return h.forEach(this,(s,o)=>{s!=null&&s!==!1&&(r[o]=e&&h.isArray(s)?s.join(", "):s)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const s=new this(e);return r.forEach(o=>s.set(o)),s}static accessor(e){const s=(this[It]=this[It]={accessors:{}}).accessors,o=this.prototype;function a(n){const l=be(n);s[l]||(Ua(o,n),s[l]=!0)}return h.isArray(e)?e.forEach(a):a(e),this}};q.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);h.reduceDescriptors(q.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[r]=s}}});h.freezeMethods(q);function Me(t,e){const r=this||fe,s=e||r,o=q.from(s.headers);let a=s.data;return h.forEach(t,function(l){a=l.call(r,a,o.normalize(),e?e.status:void 0)}),o.normalize(),a}function mr(t){return!!(t&&t.__CANCEL__)}function he(t,e,r){g.call(this,t??"canceled",g.ERR_CANCELED,e,r),this.name="CanceledError"}h.inherits(he,g,{__CANCEL__:!0});function Vr(t,e,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?t(r):e(new g("Request failed with status code "+r.status,[g.ERR_BAD_REQUEST,g.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Ta(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Ba(t,e){t=t||10;const r=new Array(t),s=new Array(t);let o=0,a=0,n;return e=e!==void 0?e:1e3,function(i){const c=Date.now(),p=s[a];n||(n=c),r[o]=i,s[o]=c;let R=a,I=0;for(;R!==o;)I+=r[R++],R=R%t;if(o=(o+1)%t,o===a&&(a=(a+1)%t),c-n{r=p,o=null,a&&(clearTimeout(a),a=null),t(...c)};return[(...c)=>{const p=Date.now(),R=p-r;R>=s?n(c,p):(o=c,a||(a=setTimeout(()=>{a=null,n(o)},s-R)))},()=>o&&n(o)]}const Te=(t,e,r=3)=>{let s=0;const o=Ba(50,250);return Da(a=>{const n=a.loaded,l=a.lengthComputable?a.total:void 0,i=n-s,c=o(i),p=n<=l;s=n;const R={loaded:n,total:l,progress:l?n/l:void 0,bytes:i,rate:c||void 0,estimated:c&&l&&p?(l-n)/c:void 0,event:a,lengthComputable:l!=null,[e?"download":"upload"]:!0};t(R)},r)},Et=(t,e)=>{const r=t!=null;return[s=>e[0]({lengthComputable:r,total:t,loaded:s}),e[1]]},gt=t=>(...e)=>h.asap(()=>t(...e)),La=G.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,G.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(G.origin),G.navigator&&/(msie|trident)/i.test(G.navigator.userAgent)):()=>!0,ja=G.hasStandardBrowserEnv?{write(t,e,r,s,o,a){const n=[t+"="+encodeURIComponent(e)];h.isNumber(r)&&n.push("expires="+new Date(r).toGMTString()),h.isString(s)&&n.push("path="+s),h.isString(o)&&n.push("domain="+o),a===!0&&n.push("secure"),document.cookie=n.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ka(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function za(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function Sr(t,e,r){let s=!ka(e);return t&&(s||r==!1)?za(t,e):e}const xt=t=>t instanceof q?{...t}:t;function ie(t,e){e=e||{};const r={};function s(c,p,R,I){return h.isPlainObject(c)&&h.isPlainObject(p)?h.merge.call({caseless:I},c,p):h.isPlainObject(p)?h.merge({},p):h.isArray(p)?p.slice():p}function o(c,p,R,I){if(h.isUndefined(p)){if(!h.isUndefined(c))return s(void 0,c,R,I)}else return s(c,p,R,I)}function a(c,p){if(!h.isUndefined(p))return s(void 0,p)}function n(c,p){if(h.isUndefined(p)){if(!h.isUndefined(c))return s(void 0,c)}else return s(void 0,p)}function l(c,p,R){if(R in e)return s(c,p);if(R in t)return s(void 0,c)}const i={url:a,method:a,data:a,baseURL:n,transformRequest:n,transformResponse:n,paramsSerializer:n,timeout:n,timeoutMessage:n,withCredentials:n,withXSRFToken:n,adapter:n,responseType:n,xsrfCookieName:n,xsrfHeaderName:n,onUploadProgress:n,onDownloadProgress:n,decompress:n,maxContentLength:n,maxBodyLength:n,beforeRedirect:n,transport:n,httpAgent:n,httpsAgent:n,cancelToken:n,socketPath:n,responseEncoding:n,validateStatus:l,headers:(c,p,R)=>o(xt(c),xt(p),R,!0)};return h.forEach(Object.keys({...t,...e}),function(p){const R=i[p]||o,I=R(t[p],e[p],p);h.isUndefined(I)&&R!==l||(r[p]=I)}),r}const Ar=t=>{const e=ie({},t);let{data:r,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:a,headers:n,auth:l}=e;e.headers=n=q.from(n),e.url=Or(Sr(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&n.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let i;if(h.isFormData(r)){if(G.hasStandardBrowserEnv||G.hasStandardBrowserWebWorkerEnv)n.setContentType(void 0);else if((i=n.getContentType())!==!1){const[c,...p]=i?i.split(";").map(R=>R.trim()).filter(Boolean):[];n.setContentType([c||"multipart/form-data",...p].join("; "))}}if(G.hasStandardBrowserEnv&&(s&&h.isFunction(s)&&(s=s(e)),s||s!==!1&&La(e.url))){const c=o&&a&&ja.read(a);c&&n.set(o,c)}return e},Fa=typeof XMLHttpRequest<"u",Ga=Fa&&function(t){return new Promise(function(r,s){const o=Ar(t);let a=o.data;const n=q.from(o.headers).normalize();let{responseType:l,onUploadProgress:i,onDownloadProgress:c}=o,p,R,I,T,f;function y(){T&&T(),f&&f(),o.cancelToken&&o.cancelToken.unsubscribe(p),o.signal&&o.signal.removeEventListener("abort",p)}let w=new XMLHttpRequest;w.open(o.method.toUpperCase(),o.url,!0),w.timeout=o.timeout;function C(){if(!w)return;const E=q.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),U={data:!l||l==="text"||l==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:E,config:t,request:w};Vr(function(B){r(B),y()},function(B){s(B),y()},U),w=null}"onloadend"in w?w.onloadend=C:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(C)},w.onabort=function(){w&&(s(new g("Request aborted",g.ECONNABORTED,t,w)),w=null)},w.onerror=function(){s(new g("Network Error",g.ERR_NETWORK,t,w)),w=null},w.ontimeout=function(){let v=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const U=o.transitional||Pr;o.timeoutErrorMessage&&(v=o.timeoutErrorMessage),s(new g(v,U.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,t,w)),w=null},a===void 0&&n.setContentType(null),"setRequestHeader"in w&&h.forEach(n.toJSON(),function(v,U){w.setRequestHeader(U,v)}),h.isUndefined(o.withCredentials)||(w.withCredentials=!!o.withCredentials),l&&l!=="json"&&(w.responseType=o.responseType),c&&([I,f]=Te(c,!0),w.addEventListener("progress",I)),i&&w.upload&&([R,T]=Te(i),w.upload.addEventListener("progress",R),w.upload.addEventListener("loadend",T)),(o.cancelToken||o.signal)&&(p=E=>{w&&(s(!E||E.type?new he(null,t,w):E),w.abort(),w=null)},o.cancelToken&&o.cancelToken.subscribe(p),o.signal&&(o.signal.aborted?p():o.signal.addEventListener("abort",p)));const D=Ta(o.url);if(D&&G.protocols.indexOf(D)===-1){s(new g("Unsupported protocol "+D+":",g.ERR_BAD_REQUEST,t));return}w.send(a||null)})},_a=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let s=new AbortController,o;const a=function(c){if(!o){o=!0,l();const p=c instanceof Error?c:this.reason;s.abort(p instanceof g?p:new he(p instanceof Error?p.message:p))}};let n=e&&setTimeout(()=>{n=null,a(new g(`timeout ${e} of ms exceeded`,g.ETIMEDOUT))},e);const l=()=>{t&&(n&&clearTimeout(n),n=null,t.forEach(c=>{c.unsubscribe?c.unsubscribe(a):c.removeEventListener("abort",a)}),t=null)};t.forEach(c=>c.addEventListener("abort",a));const{signal:i}=s;return i.unsubscribe=()=>h.asap(l),i}},qa=function*(t,e){let r=t.byteLength;if(r{const o=Ha(t,e);let a=0,n,l=i=>{n||(n=!0,s&&s(i))};return new ReadableStream({async pull(i){try{const{done:c,value:p}=await o.next();if(c){l(),i.close();return}let R=p.byteLength;if(r){let I=a+=R;r(I)}i.enqueue(new Uint8Array(p))}catch(c){throw l(c),c}},cancel(i){return l(i),o.return()}},{highWaterMark:2})},ze=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Rr=ze&&typeof ReadableStream=="function",Na=ze&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),fr=(t,...e)=>{try{return!!t(...e)}catch{return!1}},Wa=Rr&&fr(()=>{let t=!1;const e=new Request(G.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),Ct=64*1024,tt=Rr&&fr(()=>h.isReadableStream(new Response("").body)),Be={stream:tt&&(t=>t.body)};ze&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Be[e]&&(Be[e]=h.isFunction(t[e])?r=>r[e]():(r,s)=>{throw new g(`Response type '${e}' is not supported`,g.ERR_NOT_SUPPORT,s)})})})(new Response);const Qa=async t=>{if(t==null)return 0;if(h.isBlob(t))return t.size;if(h.isSpecCompliantForm(t))return(await new Request(G.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(h.isArrayBufferView(t)||h.isArrayBuffer(t))return t.byteLength;if(h.isURLSearchParams(t)&&(t=t+""),h.isString(t))return(await Na(t)).byteLength},Ma=async(t,e)=>{const r=h.toFiniteNumber(t.getContentLength());return r??Qa(e)},Ja=ze&&(async t=>{let{url:e,method:r,data:s,signal:o,cancelToken:a,timeout:n,onDownloadProgress:l,onUploadProgress:i,responseType:c,headers:p,withCredentials:R="same-origin",fetchOptions:I}=Ar(t);c=c?(c+"").toLowerCase():"text";let T=_a([o,a&&a.toAbortSignal()],n),f;const y=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let w;try{if(i&&Wa&&r!=="get"&&r!=="head"&&(w=await Ma(p,s))!==0){let U=new Request(e,{method:"POST",body:s,duplex:"half"}),L;if(h.isFormData(s)&&(L=U.headers.get("content-type"))&&p.setContentType(L),U.body){const[B,Z]=Et(w,Te(gt(i)));s=vt(U.body,Ct,B,Z)}}h.isString(R)||(R=R?"include":"omit");const C="credentials"in Request.prototype;f=new Request(e,{...I,signal:T,method:r.toUpperCase(),headers:p.normalize().toJSON(),body:s,duplex:"half",credentials:C?R:void 0});let D=await fetch(f,I);const E=tt&&(c==="stream"||c==="response");if(tt&&(l||E&&y)){const U={};["status","statusText","headers"].forEach(ce=>{U[ce]=D[ce]});const L=h.toFiniteNumber(D.headers.get("content-length")),[B,Z]=l&&Et(L,Te(gt(l),!0))||[];D=new Response(vt(D.body,Ct,B,()=>{Z&&Z(),y&&y()}),U)}c=c||"text";let v=await Be[h.findKey(Be,c)||"text"](D,t);return!E&&y&&y(),await new Promise((U,L)=>{Vr(U,L,{data:v,headers:q.from(D.headers),status:D.status,statusText:D.statusText,config:t,request:f})})}catch(C){throw y&&y(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new g("Network Error",g.ERR_NETWORK,t,f),{cause:C.cause||C}):g.from(C,C&&C.code,t,f)}}),rt={http:pa,xhr:Ga,fetch:Ja};h.forEach(rt,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Ut=t=>`- ${t}`,Ka=t=>h.isFunction(t)||t===null||t===!1,yr={getAdapter:t=>{t=h.isArray(t)?t:[t];const{length:e}=t;let r,s;const o={};for(let a=0;a`adapter ${l} `+(i===!1?"is not supported by the environment":"is not available in the build"));let n=e?a.length>1?`since : +`+a.map(Ut).join(` +`):" "+Ut(a[0]):"as no adapter specified";throw new g("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return s},adapters:rt};function Je(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new he(null,t)}function Tt(t){return Je(t),t.headers=q.from(t.headers),t.data=Me.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),yr.getAdapter(t.adapter||fe.adapter)(t).then(function(s){return Je(t),s.data=Me.call(t,t.transformResponse,s),s.headers=q.from(s.headers),s},function(s){return mr(s)||(Je(t),s&&s.response&&(s.response.data=Me.call(t,t.transformResponse,s.response),s.response.headers=q.from(s.response.headers))),Promise.reject(s)})}const wr="1.11.0",Fe={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Fe[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const Bt={};Fe.transitional=function(e,r,s){function o(a,n){return"[Axios v"+wr+"] Transitional option '"+a+"'"+n+(s?". "+s:"")}return(a,n,l)=>{if(e===!1)throw new g(o(n," has been removed"+(r?" in "+r:"")),g.ERR_DEPRECATED);return r&&!Bt[n]&&(Bt[n]=!0,console.warn(o(n," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(a,n,l):!0}};Fe.spelling=function(e){return(r,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function Xa(t,e,r){if(typeof t!="object")throw new g("options must be an object",g.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let o=s.length;for(;o-- >0;){const a=s[o],n=e[a];if(n){const l=t[a],i=l===void 0||n(l,a,t);if(i!==!0)throw new g("option "+a+" must be "+i,g.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new g("Unknown option "+a,g.ERR_BAD_OPTION)}}const ve={assertOptions:Xa,validators:Fe},M=ve.validators;let le=class{constructor(e){this.defaults=e||{},this.interceptors={request:new wt,response:new wt}}async request(e,r){try{return await this._request(e,r)}catch(s){if(s instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const a=o.stack?o.stack.replace(/^.+\n/,""):"";try{s.stack?a&&!String(s.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(s.stack+=` +`+a):s.stack=a}catch{}}throw s}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=ie(this.defaults,r);const{transitional:s,paramsSerializer:o,headers:a}=r;s!==void 0&&ve.assertOptions(s,{silentJSONParsing:M.transitional(M.boolean),forcedJSONParsing:M.transitional(M.boolean),clarifyTimeoutError:M.transitional(M.boolean)},!1),o!=null&&(h.isFunction(o)?r.paramsSerializer={serialize:o}:ve.assertOptions(o,{encode:M.function,serialize:M.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ve.assertOptions(r,{baseUrl:M.spelling("baseURL"),withXsrfToken:M.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let n=a&&h.merge(a.common,a[r.method]);a&&h.forEach(["delete","get","head","post","put","patch","common"],f=>{delete a[f]}),r.headers=q.concat(n,a);const l=[];let i=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(i=i&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const c=[];this.interceptors.response.forEach(function(y){c.push(y.fulfilled,y.rejected)});let p,R=0,I;if(!i){const f=[Tt.bind(this),void 0];for(f.unshift(...l),f.push(...c),I=f.length,p=Promise.resolve(r);R{if(!s._listeners)return;let a=s._listeners.length;for(;a-- >0;)s._listeners[a](o);s._listeners=null}),this.promise.then=o=>{let a;const n=new Promise(l=>{s.subscribe(l),a=l}).then(o);return n.cancel=function(){s.unsubscribe(a)},n},e(function(a,n,l){s.reason||(s.reason=new he(a,n,l),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=s=>{e.abort(s)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new Ir(function(o){e=o}),cancel:e}}};function Za(t){return function(r){return t.apply(null,r)}}function eo(t){return h.isObject(t)&&t.isAxiosError===!0}const st={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(st).forEach(([t,e])=>{st[e]=t});function Er(t){const e=new le(t),r=rr(le.prototype.request,e);return h.extend(r,le.prototype,e,{allOwnKeys:!0}),h.extend(r,e,null,{allOwnKeys:!0}),r.create=function(o){return Er(ie(t,o))},r}const u=Er(fe);u.Axios=le;u.CanceledError=he;u.CancelToken=Ya;u.isCancel=mr;u.VERSION=wr;u.toFormData=ke;u.AxiosError=g;u.Cancel=u.CanceledError;u.all=function(e){return Promise.all(e)};u.spread=Za;u.isAxiosError=eo;u.mergeConfig=ie;u.AxiosHeaders=q;u.formToJSON=t=>br(h.isHTMLForm(t)?new FormData(t):t);u.getAdapter=yr.getAdapter;u.HttpStatusCode=st;u.default=u;const{Axios:jo,AxiosError:ko,CanceledError:zo,isCancel:Fo,CancelToken:Go,VERSION:_o,all:qo,Cancel:Ho,isAxiosError:$o,spread:No,toFormData:Wo,AxiosHeaders:Qo,HttpStatusCode:Mo,formToJSON:Jo,getAdapter:Ko,mergeConfig:Xo}=u,O="/api/v1".replace(/\/+$/,"");class H{constructor(e,r=O,s=u){this.basePath=r,this.axios=s,e&&(this.configuration=e,this.basePath=e.basePath??r)}configuration}class to extends Error{constructor(e,r){super(r),this.field=e,this.name="RequiredError"}}const P={},b="https://example.com",d=function(t,e,r){if(r==null)throw new to(e,`Required parameter ${e} was null or undefined when calling ${t}.`)},m=async function(t,e,r){if(r&&r.apiKey){const s=typeof r.apiKey=="function"?await r.apiKey(e):await r.apiKey;t[e]=s}};function at(t,e,r=""){e!=null&&(typeof e=="object"?Array.isArray(e)?e.forEach(s=>at(t,s,r)):Object.keys(e).forEach(s=>at(t,e[s],`${r}${r!==""?".":""}${s}`)):t.has(r)?t.append(r,e):t.set(r,e))}const V=function(t,...e){const r=new URLSearchParams(t.search);at(r,e),t.search=r.toString()},x=function(t,e,r){const s=typeof t!="string";return(s&&r&&r.isJsonMime?r.isJsonMime(e.headers["Content-Type"]):s)?JSON.stringify(t!==void 0?t:{}):t||""},S=function(t){return t.pathname+t.search+t.hash},A=function(t,e,r,s){return(o=e,a=r)=>{const n={...t.options,url:(o.defaults.baseURL?"":s?.basePath??a)+t.url};return o.request(n)}},ro=function(t){return{updateController:async(e,r={})=>{d("updateController","body",e);const s="/controller",o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"PUT",...a,...r},l={},i={};await m(l,"Authorization",t),l["Content-Type"]="application/json",V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},n.data=x(e,n,t),{url:S(o),options:n}}}},so=function(t){const e=ro(t);return{async updateController(r,s){const o=await e.updateController(r,s),a=t?.serverIndex??0,n=P["ControllerApi.updateController"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)}}};class Dt extends H{updateController(e,r){return so(this.configuration).updateController(e,r).then(s=>s(this.axios,this.basePath))}}const ao=function(t){return{controllerInfo:async(e={})=>{const r="/controller-info",s=new URL(r,b);let o;t&&(o=t.baseOptions);const a={method:"GET",...o,...e},n={},l={};await m(n,"Authorization",t),V(s,l);let i=o&&o.headers?o.headers:{};return a.headers={...n,...i,...e.headers},{url:S(s),options:a}}}},oo=function(t){const e=ao(t);return{async controllerInfo(r){const s=await e.controllerInfo(r),o=t?.serverIndex??0,a=P["ControllerInfoApi.controllerInfo"]?.[o]?.url;return(n,l)=>A(s,u,O,t)(n,a||l)}}};class Lt extends H{controllerInfo(e){return oo(this.configuration).controllerInfo(e).then(r=>r(this.axios,this.basePath))}}const no=function(t){return{createCredentials:async(e,r={})=>{d("createCredentials","body",e);const s="/github/credentials",o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"POST",...a,...r},l={},i={};await m(l,"Authorization",t),l["Content-Type"]="application/json",V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},n.data=x(e,n,t),{url:S(o),options:n}},createGiteaCredentials:async(e,r={})=>{d("createGiteaCredentials","body",e);const s="/gitea/credentials",o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"POST",...a,...r},l={},i={};await m(l,"Authorization",t),l["Content-Type"]="application/json",V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},n.data=x(e,n,t),{url:S(o),options:n}},deleteCredentials:async(e,r={})=>{d("deleteCredentials","id",e);const s="/github/credentials/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"DELETE",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},deleteGiteaCredentials:async(e,r={})=>{d("deleteGiteaCredentials","id",e);const s="/gitea/credentials/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"DELETE",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},getCredentials:async(e,r={})=>{d("getCredentials","id",e);const s="/github/credentials/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},getGiteaCredentials:async(e,r={})=>{d("getGiteaCredentials","id",e);const s="/gitea/credentials/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listCredentials:async(e={})=>{const r="/github/credentials",s=new URL(r,b);let o;t&&(o=t.baseOptions);const a={method:"GET",...o,...e},n={},l={};await m(n,"Authorization",t),V(s,l);let i=o&&o.headers?o.headers:{};return a.headers={...n,...i,...e.headers},{url:S(s),options:a}},listGiteaCredentials:async(e={})=>{const r="/gitea/credentials",s=new URL(r,b);let o;t&&(o=t.baseOptions);const a={method:"GET",...o,...e},n={},l={};await m(n,"Authorization",t),V(s,l);let i=o&&o.headers?o.headers:{};return a.headers={...n,...i,...e.headers},{url:S(s),options:a}},updateCredentials:async(e,r,s={})=>{d("updateCredentials","id",e),d("updateCredentials","body",r);const o="/github/credentials/{id}".replace("{id}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"PUT",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},updateGiteaCredentials:async(e,r,s={})=>{d("updateGiteaCredentials","id",e),d("updateGiteaCredentials","body",r);const o="/gitea/credentials/{id}".replace("{id}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"PUT",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}}}},J=function(t){const e=no(t);return{async createCredentials(r,s){const o=await e.createCredentials(r,s),a=t?.serverIndex??0,n=P["CredentialsApi.createCredentials"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async createGiteaCredentials(r,s){const o=await e.createGiteaCredentials(r,s),a=t?.serverIndex??0,n=P["CredentialsApi.createGiteaCredentials"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async deleteCredentials(r,s){const o=await e.deleteCredentials(r,s),a=t?.serverIndex??0,n=P["CredentialsApi.deleteCredentials"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async deleteGiteaCredentials(r,s){const o=await e.deleteGiteaCredentials(r,s),a=t?.serverIndex??0,n=P["CredentialsApi.deleteGiteaCredentials"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async getCredentials(r,s){const o=await e.getCredentials(r,s),a=t?.serverIndex??0,n=P["CredentialsApi.getCredentials"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async getGiteaCredentials(r,s){const o=await e.getGiteaCredentials(r,s),a=t?.serverIndex??0,n=P["CredentialsApi.getGiteaCredentials"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listCredentials(r){const s=await e.listCredentials(r),o=t?.serverIndex??0,a=P["CredentialsApi.listCredentials"]?.[o]?.url;return(n,l)=>A(s,u,O,t)(n,a||l)},async listGiteaCredentials(r){const s=await e.listGiteaCredentials(r),o=t?.serverIndex??0,a=P["CredentialsApi.listGiteaCredentials"]?.[o]?.url;return(n,l)=>A(s,u,O,t)(n,a||l)},async updateCredentials(r,s,o){const a=await e.updateCredentials(r,s,o),n=t?.serverIndex??0,l=P["CredentialsApi.updateCredentials"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async updateGiteaCredentials(r,s,o){const a=await e.updateGiteaCredentials(r,s,o),n=t?.serverIndex??0,l=P["CredentialsApi.updateGiteaCredentials"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)}}};class jt extends H{createCredentials(e,r){return J(this.configuration).createCredentials(e,r).then(s=>s(this.axios,this.basePath))}createGiteaCredentials(e,r){return J(this.configuration).createGiteaCredentials(e,r).then(s=>s(this.axios,this.basePath))}deleteCredentials(e,r){return J(this.configuration).deleteCredentials(e,r).then(s=>s(this.axios,this.basePath))}deleteGiteaCredentials(e,r){return J(this.configuration).deleteGiteaCredentials(e,r).then(s=>s(this.axios,this.basePath))}getCredentials(e,r){return J(this.configuration).getCredentials(e,r).then(s=>s(this.axios,this.basePath))}getGiteaCredentials(e,r){return J(this.configuration).getGiteaCredentials(e,r).then(s=>s(this.axios,this.basePath))}listCredentials(e){return J(this.configuration).listCredentials(e).then(r=>r(this.axios,this.basePath))}listGiteaCredentials(e){return J(this.configuration).listGiteaCredentials(e).then(r=>r(this.axios,this.basePath))}updateCredentials(e,r,s){return J(this.configuration).updateCredentials(e,r,s).then(o=>o(this.axios,this.basePath))}updateGiteaCredentials(e,r,s){return J(this.configuration).updateGiteaCredentials(e,r,s).then(o=>o(this.axios,this.basePath))}}const lo=function(t){return{createGiteaEndpoint:async(e,r={})=>{d("createGiteaEndpoint","body",e);const s="/gitea/endpoints",o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"POST",...a,...r},l={},i={};await m(l,"Authorization",t),l["Content-Type"]="application/json",V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},n.data=x(e,n,t),{url:S(o),options:n}},createGithubEndpoint:async(e,r={})=>{d("createGithubEndpoint","body",e);const s="/github/endpoints",o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"POST",...a,...r},l={},i={};await m(l,"Authorization",t),l["Content-Type"]="application/json",V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},n.data=x(e,n,t),{url:S(o),options:n}},deleteGiteaEndpoint:async(e,r={})=>{d("deleteGiteaEndpoint","name",e);const s="/gitea/endpoints/{name}".replace("{name}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"DELETE",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},deleteGithubEndpoint:async(e,r={})=>{d("deleteGithubEndpoint","name",e);const s="/github/endpoints/{name}".replace("{name}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"DELETE",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},getGiteaEndpoint:async(e,r={})=>{d("getGiteaEndpoint","name",e);const s="/gitea/endpoints/{name}".replace("{name}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},getGithubEndpoint:async(e,r={})=>{d("getGithubEndpoint","name",e);const s="/github/endpoints/{name}".replace("{name}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listGiteaEndpoints:async(e={})=>{const r="/gitea/endpoints",s=new URL(r,b);let o;t&&(o=t.baseOptions);const a={method:"GET",...o,...e},n={},l={};await m(n,"Authorization",t),V(s,l);let i=o&&o.headers?o.headers:{};return a.headers={...n,...i,...e.headers},{url:S(s),options:a}},listGithubEndpoints:async(e={})=>{const r="/github/endpoints",s=new URL(r,b);let o;t&&(o=t.baseOptions);const a={method:"GET",...o,...e},n={},l={};await m(n,"Authorization",t),V(s,l);let i=o&&o.headers?o.headers:{};return a.headers={...n,...i,...e.headers},{url:S(s),options:a}},updateGiteaEndpoint:async(e,r,s={})=>{d("updateGiteaEndpoint","name",e),d("updateGiteaEndpoint","body",r);const o="/gitea/endpoints/{name}".replace("{name}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"PUT",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},updateGithubEndpoint:async(e,r,s={})=>{d("updateGithubEndpoint","name",e),d("updateGithubEndpoint","body",r);const o="/github/endpoints/{name}".replace("{name}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"PUT",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}}}},K=function(t){const e=lo(t);return{async createGiteaEndpoint(r,s){const o=await e.createGiteaEndpoint(r,s),a=t?.serverIndex??0,n=P["EndpointsApi.createGiteaEndpoint"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async createGithubEndpoint(r,s){const o=await e.createGithubEndpoint(r,s),a=t?.serverIndex??0,n=P["EndpointsApi.createGithubEndpoint"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async deleteGiteaEndpoint(r,s){const o=await e.deleteGiteaEndpoint(r,s),a=t?.serverIndex??0,n=P["EndpointsApi.deleteGiteaEndpoint"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async deleteGithubEndpoint(r,s){const o=await e.deleteGithubEndpoint(r,s),a=t?.serverIndex??0,n=P["EndpointsApi.deleteGithubEndpoint"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async getGiteaEndpoint(r,s){const o=await e.getGiteaEndpoint(r,s),a=t?.serverIndex??0,n=P["EndpointsApi.getGiteaEndpoint"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async getGithubEndpoint(r,s){const o=await e.getGithubEndpoint(r,s),a=t?.serverIndex??0,n=P["EndpointsApi.getGithubEndpoint"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listGiteaEndpoints(r){const s=await e.listGiteaEndpoints(r),o=t?.serverIndex??0,a=P["EndpointsApi.listGiteaEndpoints"]?.[o]?.url;return(n,l)=>A(s,u,O,t)(n,a||l)},async listGithubEndpoints(r){const s=await e.listGithubEndpoints(r),o=t?.serverIndex??0,a=P["EndpointsApi.listGithubEndpoints"]?.[o]?.url;return(n,l)=>A(s,u,O,t)(n,a||l)},async updateGiteaEndpoint(r,s,o){const a=await e.updateGiteaEndpoint(r,s,o),n=t?.serverIndex??0,l=P["EndpointsApi.updateGiteaEndpoint"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async updateGithubEndpoint(r,s,o){const a=await e.updateGithubEndpoint(r,s,o),n=t?.serverIndex??0,l=P["EndpointsApi.updateGithubEndpoint"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)}}};class kt extends H{createGiteaEndpoint(e,r){return K(this.configuration).createGiteaEndpoint(e,r).then(s=>s(this.axios,this.basePath))}createGithubEndpoint(e,r){return K(this.configuration).createGithubEndpoint(e,r).then(s=>s(this.axios,this.basePath))}deleteGiteaEndpoint(e,r){return K(this.configuration).deleteGiteaEndpoint(e,r).then(s=>s(this.axios,this.basePath))}deleteGithubEndpoint(e,r){return K(this.configuration).deleteGithubEndpoint(e,r).then(s=>s(this.axios,this.basePath))}getGiteaEndpoint(e,r){return K(this.configuration).getGiteaEndpoint(e,r).then(s=>s(this.axios,this.basePath))}getGithubEndpoint(e,r){return K(this.configuration).getGithubEndpoint(e,r).then(s=>s(this.axios,this.basePath))}listGiteaEndpoints(e){return K(this.configuration).listGiteaEndpoints(e).then(r=>r(this.axios,this.basePath))}listGithubEndpoints(e){return K(this.configuration).listGithubEndpoints(e).then(r=>r(this.axios,this.basePath))}updateGiteaEndpoint(e,r,s){return K(this.configuration).updateGiteaEndpoint(e,r,s).then(o=>o(this.axios,this.basePath))}updateGithubEndpoint(e,r,s){return K(this.configuration).updateGithubEndpoint(e,r,s).then(o=>o(this.axios,this.basePath))}}const io=function(t){return{createEnterprise:async(e,r={})=>{d("createEnterprise","body",e);const s="/enterprises",o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"POST",...a,...r},l={},i={};await m(l,"Authorization",t),l["Content-Type"]="application/json",V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},n.data=x(e,n,t),{url:S(o),options:n}},createEnterprisePool:async(e,r,s={})=>{d("createEnterprisePool","enterpriseID",e),d("createEnterprisePool","body",r);const o="/enterprises/{enterpriseID}/pools".replace("{enterpriseID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},createEnterpriseScaleSet:async(e,r,s={})=>{d("createEnterpriseScaleSet","enterpriseID",e),d("createEnterpriseScaleSet","body",r);const o="/enterprises/{enterpriseID}/scalesets".replace("{enterpriseID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},deleteEnterprise:async(e,r={})=>{d("deleteEnterprise","enterpriseID",e);const s="/enterprises/{enterpriseID}".replace("{enterpriseID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"DELETE",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},deleteEnterprisePool:async(e,r,s={})=>{d("deleteEnterprisePool","enterpriseID",e),d("deleteEnterprisePool","poolID",r);const o="/enterprises/{enterpriseID}/pools/{poolID}".replace("{enterpriseID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"DELETE",...n,...s},i={},c={};await m(i,"Authorization",t),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},getEnterprise:async(e,r={})=>{d("getEnterprise","enterpriseID",e);const s="/enterprises/{enterpriseID}".replace("{enterpriseID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},getEnterprisePool:async(e,r,s={})=>{d("getEnterprisePool","enterpriseID",e),d("getEnterprisePool","poolID",r);const o="/enterprises/{enterpriseID}/pools/{poolID}".replace("{enterpriseID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"GET",...n,...s},i={},c={};await m(i,"Authorization",t),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},listEnterpriseInstances:async(e,r={})=>{d("listEnterpriseInstances","enterpriseID",e);const s="/enterprises/{enterpriseID}/instances".replace("{enterpriseID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listEnterprisePools:async(e,r={})=>{d("listEnterprisePools","enterpriseID",e);const s="/enterprises/{enterpriseID}/pools".replace("{enterpriseID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listEnterpriseScaleSets:async(e,r={})=>{d("listEnterpriseScaleSets","enterpriseID",e);const s="/enterprises/{enterpriseID}/scalesets".replace("{enterpriseID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listEnterprises:async(e,r,s={})=>{const o="/enterprises",a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"GET",...n,...s},i={},c={};await m(i,"Authorization",t),e!==void 0&&(c.name=e),r!==void 0&&(c.endpoint=r),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},updateEnterprise:async(e,r,s={})=>{d("updateEnterprise","enterpriseID",e),d("updateEnterprise","body",r);const o="/enterprises/{enterpriseID}".replace("{enterpriseID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"PUT",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},updateEnterprisePool:async(e,r,s,o={})=>{d("updateEnterprisePool","enterpriseID",e),d("updateEnterprisePool","poolID",r),d("updateEnterprisePool","body",s);const a="/enterprises/{enterpriseID}/pools/{poolID}".replace("{enterpriseID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),n=new URL(a,b);let l;t&&(l=t.baseOptions);const i={method:"PUT",...l,...o},c={},p={};await m(c,"Authorization",t),c["Content-Type"]="application/json",V(n,p);let R=l&&l.headers?l.headers:{};return i.headers={...c,...R,...o.headers},i.data=x(s,i,t),{url:S(n),options:i}}}},$=function(t){const e=io(t);return{async createEnterprise(r,s){const o=await e.createEnterprise(r,s),a=t?.serverIndex??0,n=P["EnterprisesApi.createEnterprise"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async createEnterprisePool(r,s,o){const a=await e.createEnterprisePool(r,s,o),n=t?.serverIndex??0,l=P["EnterprisesApi.createEnterprisePool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async createEnterpriseScaleSet(r,s,o){const a=await e.createEnterpriseScaleSet(r,s,o),n=t?.serverIndex??0,l=P["EnterprisesApi.createEnterpriseScaleSet"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async deleteEnterprise(r,s){const o=await e.deleteEnterprise(r,s),a=t?.serverIndex??0,n=P["EnterprisesApi.deleteEnterprise"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async deleteEnterprisePool(r,s,o){const a=await e.deleteEnterprisePool(r,s,o),n=t?.serverIndex??0,l=P["EnterprisesApi.deleteEnterprisePool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async getEnterprise(r,s){const o=await e.getEnterprise(r,s),a=t?.serverIndex??0,n=P["EnterprisesApi.getEnterprise"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async getEnterprisePool(r,s,o){const a=await e.getEnterprisePool(r,s,o),n=t?.serverIndex??0,l=P["EnterprisesApi.getEnterprisePool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async listEnterpriseInstances(r,s){const o=await e.listEnterpriseInstances(r,s),a=t?.serverIndex??0,n=P["EnterprisesApi.listEnterpriseInstances"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listEnterprisePools(r,s){const o=await e.listEnterprisePools(r,s),a=t?.serverIndex??0,n=P["EnterprisesApi.listEnterprisePools"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listEnterpriseScaleSets(r,s){const o=await e.listEnterpriseScaleSets(r,s),a=t?.serverIndex??0,n=P["EnterprisesApi.listEnterpriseScaleSets"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listEnterprises(r,s,o){const a=await e.listEnterprises(r,s,o),n=t?.serverIndex??0,l=P["EnterprisesApi.listEnterprises"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async updateEnterprise(r,s,o){const a=await e.updateEnterprise(r,s,o),n=t?.serverIndex??0,l=P["EnterprisesApi.updateEnterprise"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async updateEnterprisePool(r,s,o,a){const n=await e.updateEnterprisePool(r,s,o,a),l=t?.serverIndex??0,i=P["EnterprisesApi.updateEnterprisePool"]?.[l]?.url;return(c,p)=>A(n,u,O,t)(c,i||p)}}};class zt extends H{createEnterprise(e,r){return $(this.configuration).createEnterprise(e,r).then(s=>s(this.axios,this.basePath))}createEnterprisePool(e,r,s){return $(this.configuration).createEnterprisePool(e,r,s).then(o=>o(this.axios,this.basePath))}createEnterpriseScaleSet(e,r,s){return $(this.configuration).createEnterpriseScaleSet(e,r,s).then(o=>o(this.axios,this.basePath))}deleteEnterprise(e,r){return $(this.configuration).deleteEnterprise(e,r).then(s=>s(this.axios,this.basePath))}deleteEnterprisePool(e,r,s){return $(this.configuration).deleteEnterprisePool(e,r,s).then(o=>o(this.axios,this.basePath))}getEnterprise(e,r){return $(this.configuration).getEnterprise(e,r).then(s=>s(this.axios,this.basePath))}getEnterprisePool(e,r,s){return $(this.configuration).getEnterprisePool(e,r,s).then(o=>o(this.axios,this.basePath))}listEnterpriseInstances(e,r){return $(this.configuration).listEnterpriseInstances(e,r).then(s=>s(this.axios,this.basePath))}listEnterprisePools(e,r){return $(this.configuration).listEnterprisePools(e,r).then(s=>s(this.axios,this.basePath))}listEnterpriseScaleSets(e,r){return $(this.configuration).listEnterpriseScaleSets(e,r).then(s=>s(this.axios,this.basePath))}listEnterprises(e,r,s){return $(this.configuration).listEnterprises(e,r,s).then(o=>o(this.axios,this.basePath))}updateEnterprise(e,r,s){return $(this.configuration).updateEnterprise(e,r,s).then(o=>o(this.axios,this.basePath))}updateEnterprisePool(e,r,s,o){return $(this.configuration).updateEnterprisePool(e,r,s,o).then(a=>a(this.axios,this.basePath))}}const co=function(t){return{firstRun:async(e,r={})=>{d("firstRun","body",e);const s="/first-run",o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"POST",...a,...r},l={},i={};await m(l,"Authorization",t),l["Content-Type"]="application/json",V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},n.data=x(e,n,t),{url:S(o),options:n}}}},po=function(t){const e=co(t);return{async firstRun(r,s){const o=await e.firstRun(r,s),a=t?.serverIndex??0,n=P["FirstRunApi.firstRun"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)}}};class Ft extends H{firstRun(e,r){return po(this.configuration).firstRun(e,r).then(s=>s(this.axios,this.basePath))}}const ho=function(t){return{getOrgWebhookInfo:async(e,r={})=>{d("getOrgWebhookInfo","orgID",e);const s="/organizations/{orgID}/webhook".replace("{orgID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},getRepoWebhookInfo:async(e,r={})=>{d("getRepoWebhookInfo","repoID",e);const s="/repositories/{repoID}/webhook".replace("{repoID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},installOrgWebhook:async(e,r,s={})=>{d("installOrgWebhook","orgID",e),d("installOrgWebhook","body",r);const o="/organizations/{orgID}/webhook".replace("{orgID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},installRepoWebhook:async(e,r,s={})=>{d("installRepoWebhook","repoID",e),d("installRepoWebhook","body",r);const o="/repositories/{repoID}/webhook".replace("{repoID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},uninstallOrgWebhook:async(e,r={})=>{d("uninstallOrgWebhook","orgID",e);const s="/organizations/{orgID}/webhook".replace("{orgID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"DELETE",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},uninstallRepoWebhook:async(e,r={})=>{d("uninstallRepoWebhook","repoID",e);const s="/repositories/{repoID}/webhook".replace("{repoID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"DELETE",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}}}},pe=function(t){const e=ho(t);return{async getOrgWebhookInfo(r,s){const o=await e.getOrgWebhookInfo(r,s),a=t?.serverIndex??0,n=P["HooksApi.getOrgWebhookInfo"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async getRepoWebhookInfo(r,s){const o=await e.getRepoWebhookInfo(r,s),a=t?.serverIndex??0,n=P["HooksApi.getRepoWebhookInfo"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async installOrgWebhook(r,s,o){const a=await e.installOrgWebhook(r,s,o),n=t?.serverIndex??0,l=P["HooksApi.installOrgWebhook"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async installRepoWebhook(r,s,o){const a=await e.installRepoWebhook(r,s,o),n=t?.serverIndex??0,l=P["HooksApi.installRepoWebhook"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async uninstallOrgWebhook(r,s){const o=await e.uninstallOrgWebhook(r,s),a=t?.serverIndex??0,n=P["HooksApi.uninstallOrgWebhook"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async uninstallRepoWebhook(r,s){const o=await e.uninstallRepoWebhook(r,s),a=t?.serverIndex??0,n=P["HooksApi.uninstallRepoWebhook"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)}}};class Gt extends H{getOrgWebhookInfo(e,r){return pe(this.configuration).getOrgWebhookInfo(e,r).then(s=>s(this.axios,this.basePath))}getRepoWebhookInfo(e,r){return pe(this.configuration).getRepoWebhookInfo(e,r).then(s=>s(this.axios,this.basePath))}installOrgWebhook(e,r,s){return pe(this.configuration).installOrgWebhook(e,r,s).then(o=>o(this.axios,this.basePath))}installRepoWebhook(e,r,s){return pe(this.configuration).installRepoWebhook(e,r,s).then(o=>o(this.axios,this.basePath))}uninstallOrgWebhook(e,r){return pe(this.configuration).uninstallOrgWebhook(e,r).then(s=>s(this.axios,this.basePath))}uninstallRepoWebhook(e,r){return pe(this.configuration).uninstallRepoWebhook(e,r).then(s=>s(this.axios,this.basePath))}}const uo=function(t){return{deleteInstance:async(e,r,s,o={})=>{d("deleteInstance","instanceName",e);const a="/instances/{instanceName}".replace("{instanceName}",encodeURIComponent(String(e))),n=new URL(a,b);let l;t&&(l=t.baseOptions);const i={method:"DELETE",...l,...o},c={},p={};await m(c,"Authorization",t),r!==void 0&&(p.forceRemove=r),s!==void 0&&(p.bypassGHUnauthorized=s),V(n,p);let R=l&&l.headers?l.headers:{};return i.headers={...c,...R,...o.headers},{url:S(n),options:i}},getInstance:async(e,r={})=>{d("getInstance","instanceName",e);const s="/instances/{instanceName}".replace("{instanceName}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listEnterpriseInstances:async(e,r={})=>{d("listEnterpriseInstances","enterpriseID",e);const s="/enterprises/{enterpriseID}/instances".replace("{enterpriseID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listInstances:async(e={})=>{const r="/instances",s=new URL(r,b);let o;t&&(o=t.baseOptions);const a={method:"GET",...o,...e},n={},l={};await m(n,"Authorization",t),V(s,l);let i=o&&o.headers?o.headers:{};return a.headers={...n,...i,...e.headers},{url:S(s),options:a}},listOrgInstances:async(e,r={})=>{d("listOrgInstances","orgID",e);const s="/organizations/{orgID}/instances".replace("{orgID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listPoolInstances:async(e,r={})=>{d("listPoolInstances","poolID",e);const s="/pools/{poolID}/instances".replace("{poolID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listRepoInstances:async(e,r={})=>{d("listRepoInstances","repoID",e);const s="/repositories/{repoID}/instances".replace("{repoID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listScaleSetInstances:async(e,r={})=>{d("listScaleSetInstances","scalesetID",e);const s="/scalesets/{scalesetID}/instances".replace("{scalesetID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}}}},ae=function(t){const e=uo(t);return{async deleteInstance(r,s,o,a){const n=await e.deleteInstance(r,s,o,a),l=t?.serverIndex??0,i=P["InstancesApi.deleteInstance"]?.[l]?.url;return(c,p)=>A(n,u,O,t)(c,i||p)},async getInstance(r,s){const o=await e.getInstance(r,s),a=t?.serverIndex??0,n=P["InstancesApi.getInstance"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listEnterpriseInstances(r,s){const o=await e.listEnterpriseInstances(r,s),a=t?.serverIndex??0,n=P["InstancesApi.listEnterpriseInstances"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listInstances(r){const s=await e.listInstances(r),o=t?.serverIndex??0,a=P["InstancesApi.listInstances"]?.[o]?.url;return(n,l)=>A(s,u,O,t)(n,a||l)},async listOrgInstances(r,s){const o=await e.listOrgInstances(r,s),a=t?.serverIndex??0,n=P["InstancesApi.listOrgInstances"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listPoolInstances(r,s){const o=await e.listPoolInstances(r,s),a=t?.serverIndex??0,n=P["InstancesApi.listPoolInstances"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listRepoInstances(r,s){const o=await e.listRepoInstances(r,s),a=t?.serverIndex??0,n=P["InstancesApi.listRepoInstances"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listScaleSetInstances(r,s){const o=await e.listScaleSetInstances(r,s),a=t?.serverIndex??0,n=P["InstancesApi.listScaleSetInstances"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)}}};class _t extends H{deleteInstance(e,r,s,o){return ae(this.configuration).deleteInstance(e,r,s,o).then(a=>a(this.axios,this.basePath))}getInstance(e,r){return ae(this.configuration).getInstance(e,r).then(s=>s(this.axios,this.basePath))}listEnterpriseInstances(e,r){return ae(this.configuration).listEnterpriseInstances(e,r).then(s=>s(this.axios,this.basePath))}listInstances(e){return ae(this.configuration).listInstances(e).then(r=>r(this.axios,this.basePath))}listOrgInstances(e,r){return ae(this.configuration).listOrgInstances(e,r).then(s=>s(this.axios,this.basePath))}listPoolInstances(e,r){return ae(this.configuration).listPoolInstances(e,r).then(s=>s(this.axios,this.basePath))}listRepoInstances(e,r){return ae(this.configuration).listRepoInstances(e,r).then(s=>s(this.axios,this.basePath))}listScaleSetInstances(e,r){return ae(this.configuration).listScaleSetInstances(e,r).then(s=>s(this.axios,this.basePath))}}const Oo=function(t){return{login:async(e,r={})=>{d("login","body",e);const s="/auth/login",o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"POST",...a,...r},l={},i={};await m(l,"Authorization",t),l["Content-Type"]="application/json",V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},n.data=x(e,n,t),{url:S(o),options:n}}}},Po=function(t){const e=Oo(t);return{async login(r,s){const o=await e.login(r,s),a=t?.serverIndex??0,n=P["LoginApi.login"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)}}};class qt extends H{login(e,r){return Po(this.configuration).login(e,r).then(s=>s(this.axios,this.basePath))}}const bo=function(t){return{createOrg:async(e,r={})=>{d("createOrg","body",e);const s="/organizations",o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"POST",...a,...r},l={},i={};await m(l,"Authorization",t),l["Content-Type"]="application/json",V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},n.data=x(e,n,t),{url:S(o),options:n}},createOrgPool:async(e,r,s={})=>{d("createOrgPool","orgID",e),d("createOrgPool","body",r);const o="/organizations/{orgID}/pools".replace("{orgID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},createOrgScaleSet:async(e,r,s={})=>{d("createOrgScaleSet","orgID",e),d("createOrgScaleSet","body",r);const o="/organizations/{orgID}/scalesets".replace("{orgID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},deleteOrg:async(e,r,s={})=>{d("deleteOrg","orgID",e);const o="/organizations/{orgID}".replace("{orgID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"DELETE",...n,...s},i={},c={};await m(i,"Authorization",t),r!==void 0&&(c.keepWebhook=r),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},deleteOrgPool:async(e,r,s={})=>{d("deleteOrgPool","orgID",e),d("deleteOrgPool","poolID",r);const o="/organizations/{orgID}/pools/{poolID}".replace("{orgID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"DELETE",...n,...s},i={},c={};await m(i,"Authorization",t),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},getOrg:async(e,r={})=>{d("getOrg","orgID",e);const s="/organizations/{orgID}".replace("{orgID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},getOrgPool:async(e,r,s={})=>{d("getOrgPool","orgID",e),d("getOrgPool","poolID",r);const o="/organizations/{orgID}/pools/{poolID}".replace("{orgID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"GET",...n,...s},i={},c={};await m(i,"Authorization",t),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},getOrgWebhookInfo:async(e,r={})=>{d("getOrgWebhookInfo","orgID",e);const s="/organizations/{orgID}/webhook".replace("{orgID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},installOrgWebhook:async(e,r,s={})=>{d("installOrgWebhook","orgID",e),d("installOrgWebhook","body",r);const o="/organizations/{orgID}/webhook".replace("{orgID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},listOrgInstances:async(e,r={})=>{d("listOrgInstances","orgID",e);const s="/organizations/{orgID}/instances".replace("{orgID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listOrgPools:async(e,r={})=>{d("listOrgPools","orgID",e);const s="/organizations/{orgID}/pools".replace("{orgID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listOrgScaleSets:async(e,r={})=>{d("listOrgScaleSets","orgID",e);const s="/organizations/{orgID}/scalesets".replace("{orgID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listOrgs:async(e,r,s={})=>{const o="/organizations",a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"GET",...n,...s},i={},c={};await m(i,"Authorization",t),e!==void 0&&(c.name=e),r!==void 0&&(c.endpoint=r),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},uninstallOrgWebhook:async(e,r={})=>{d("uninstallOrgWebhook","orgID",e);const s="/organizations/{orgID}/webhook".replace("{orgID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"DELETE",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},updateOrg:async(e,r,s={})=>{d("updateOrg","orgID",e),d("updateOrg","body",r);const o="/organizations/{orgID}".replace("{orgID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"PUT",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},updateOrgPool:async(e,r,s,o={})=>{d("updateOrgPool","orgID",e),d("updateOrgPool","poolID",r),d("updateOrgPool","body",s);const a="/organizations/{orgID}/pools/{poolID}".replace("{orgID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),n=new URL(a,b);let l;t&&(l=t.baseOptions);const i={method:"PUT",...l,...o},c={},p={};await m(c,"Authorization",t),c["Content-Type"]="application/json",V(n,p);let R=l&&l.headers?l.headers:{};return i.headers={...c,...R,...o.headers},i.data=x(s,i,t),{url:S(n),options:i}}}},z=function(t){const e=bo(t);return{async createOrg(r,s){const o=await e.createOrg(r,s),a=t?.serverIndex??0,n=P["OrganizationsApi.createOrg"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async createOrgPool(r,s,o){const a=await e.createOrgPool(r,s,o),n=t?.serverIndex??0,l=P["OrganizationsApi.createOrgPool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async createOrgScaleSet(r,s,o){const a=await e.createOrgScaleSet(r,s,o),n=t?.serverIndex??0,l=P["OrganizationsApi.createOrgScaleSet"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async deleteOrg(r,s,o){const a=await e.deleteOrg(r,s,o),n=t?.serverIndex??0,l=P["OrganizationsApi.deleteOrg"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async deleteOrgPool(r,s,o){const a=await e.deleteOrgPool(r,s,o),n=t?.serverIndex??0,l=P["OrganizationsApi.deleteOrgPool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async getOrg(r,s){const o=await e.getOrg(r,s),a=t?.serverIndex??0,n=P["OrganizationsApi.getOrg"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async getOrgPool(r,s,o){const a=await e.getOrgPool(r,s,o),n=t?.serverIndex??0,l=P["OrganizationsApi.getOrgPool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async getOrgWebhookInfo(r,s){const o=await e.getOrgWebhookInfo(r,s),a=t?.serverIndex??0,n=P["OrganizationsApi.getOrgWebhookInfo"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async installOrgWebhook(r,s,o){const a=await e.installOrgWebhook(r,s,o),n=t?.serverIndex??0,l=P["OrganizationsApi.installOrgWebhook"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async listOrgInstances(r,s){const o=await e.listOrgInstances(r,s),a=t?.serverIndex??0,n=P["OrganizationsApi.listOrgInstances"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listOrgPools(r,s){const o=await e.listOrgPools(r,s),a=t?.serverIndex??0,n=P["OrganizationsApi.listOrgPools"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listOrgScaleSets(r,s){const o=await e.listOrgScaleSets(r,s),a=t?.serverIndex??0,n=P["OrganizationsApi.listOrgScaleSets"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listOrgs(r,s,o){const a=await e.listOrgs(r,s,o),n=t?.serverIndex??0,l=P["OrganizationsApi.listOrgs"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async uninstallOrgWebhook(r,s){const o=await e.uninstallOrgWebhook(r,s),a=t?.serverIndex??0,n=P["OrganizationsApi.uninstallOrgWebhook"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async updateOrg(r,s,o){const a=await e.updateOrg(r,s,o),n=t?.serverIndex??0,l=P["OrganizationsApi.updateOrg"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async updateOrgPool(r,s,o,a){const n=await e.updateOrgPool(r,s,o,a),l=t?.serverIndex??0,i=P["OrganizationsApi.updateOrgPool"]?.[l]?.url;return(c,p)=>A(n,u,O,t)(c,i||p)}}};class Ht extends H{createOrg(e,r){return z(this.configuration).createOrg(e,r).then(s=>s(this.axios,this.basePath))}createOrgPool(e,r,s){return z(this.configuration).createOrgPool(e,r,s).then(o=>o(this.axios,this.basePath))}createOrgScaleSet(e,r,s){return z(this.configuration).createOrgScaleSet(e,r,s).then(o=>o(this.axios,this.basePath))}deleteOrg(e,r,s){return z(this.configuration).deleteOrg(e,r,s).then(o=>o(this.axios,this.basePath))}deleteOrgPool(e,r,s){return z(this.configuration).deleteOrgPool(e,r,s).then(o=>o(this.axios,this.basePath))}getOrg(e,r){return z(this.configuration).getOrg(e,r).then(s=>s(this.axios,this.basePath))}getOrgPool(e,r,s){return z(this.configuration).getOrgPool(e,r,s).then(o=>o(this.axios,this.basePath))}getOrgWebhookInfo(e,r){return z(this.configuration).getOrgWebhookInfo(e,r).then(s=>s(this.axios,this.basePath))}installOrgWebhook(e,r,s){return z(this.configuration).installOrgWebhook(e,r,s).then(o=>o(this.axios,this.basePath))}listOrgInstances(e,r){return z(this.configuration).listOrgInstances(e,r).then(s=>s(this.axios,this.basePath))}listOrgPools(e,r){return z(this.configuration).listOrgPools(e,r).then(s=>s(this.axios,this.basePath))}listOrgScaleSets(e,r){return z(this.configuration).listOrgScaleSets(e,r).then(s=>s(this.axios,this.basePath))}listOrgs(e,r,s){return z(this.configuration).listOrgs(e,r,s).then(o=>o(this.axios,this.basePath))}uninstallOrgWebhook(e,r){return z(this.configuration).uninstallOrgWebhook(e,r).then(s=>s(this.axios,this.basePath))}updateOrg(e,r,s){return z(this.configuration).updateOrg(e,r,s).then(o=>o(this.axios,this.basePath))}updateOrgPool(e,r,s,o){return z(this.configuration).updateOrgPool(e,r,s,o).then(a=>a(this.axios,this.basePath))}}const mo=function(t){return{createEnterprisePool:async(e,r,s={})=>{d("createEnterprisePool","enterpriseID",e),d("createEnterprisePool","body",r);const o="/enterprises/{enterpriseID}/pools".replace("{enterpriseID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},createOrgPool:async(e,r,s={})=>{d("createOrgPool","orgID",e),d("createOrgPool","body",r);const o="/organizations/{orgID}/pools".replace("{orgID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},createRepoPool:async(e,r,s={})=>{d("createRepoPool","repoID",e),d("createRepoPool","body",r);const o="/repositories/{repoID}/pools".replace("{repoID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},deleteEnterprisePool:async(e,r,s={})=>{d("deleteEnterprisePool","enterpriseID",e),d("deleteEnterprisePool","poolID",r);const o="/enterprises/{enterpriseID}/pools/{poolID}".replace("{enterpriseID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"DELETE",...n,...s},i={},c={};await m(i,"Authorization",t),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},deleteOrgPool:async(e,r,s={})=>{d("deleteOrgPool","orgID",e),d("deleteOrgPool","poolID",r);const o="/organizations/{orgID}/pools/{poolID}".replace("{orgID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"DELETE",...n,...s},i={},c={};await m(i,"Authorization",t),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},deletePool:async(e,r={})=>{d("deletePool","poolID",e);const s="/pools/{poolID}".replace("{poolID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"DELETE",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},deleteRepoPool:async(e,r,s={})=>{d("deleteRepoPool","repoID",e),d("deleteRepoPool","poolID",r);const o="/repositories/{repoID}/pools/{poolID}".replace("{repoID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"DELETE",...n,...s},i={},c={};await m(i,"Authorization",t),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},getEnterprisePool:async(e,r,s={})=>{d("getEnterprisePool","enterpriseID",e),d("getEnterprisePool","poolID",r);const o="/enterprises/{enterpriseID}/pools/{poolID}".replace("{enterpriseID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"GET",...n,...s},i={},c={};await m(i,"Authorization",t),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},getOrgPool:async(e,r,s={})=>{d("getOrgPool","orgID",e),d("getOrgPool","poolID",r);const o="/organizations/{orgID}/pools/{poolID}".replace("{orgID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"GET",...n,...s},i={},c={};await m(i,"Authorization",t),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},getPool:async(e,r={})=>{d("getPool","poolID",e);const s="/pools/{poolID}".replace("{poolID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},getRepoPool:async(e,r,s={})=>{d("getRepoPool","repoID",e),d("getRepoPool","poolID",r);const o="/repositories/{repoID}/pools/{poolID}".replace("{repoID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"GET",...n,...s},i={},c={};await m(i,"Authorization",t),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},listEnterprisePools:async(e,r={})=>{d("listEnterprisePools","enterpriseID",e);const s="/enterprises/{enterpriseID}/pools".replace("{enterpriseID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listOrgPools:async(e,r={})=>{d("listOrgPools","orgID",e);const s="/organizations/{orgID}/pools".replace("{orgID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listPools:async(e={})=>{const r="/pools",s=new URL(r,b);let o;t&&(o=t.baseOptions);const a={method:"GET",...o,...e},n={},l={};await m(n,"Authorization",t),V(s,l);let i=o&&o.headers?o.headers:{};return a.headers={...n,...i,...e.headers},{url:S(s),options:a}},listRepoPools:async(e,r={})=>{d("listRepoPools","repoID",e);const s="/repositories/{repoID}/pools".replace("{repoID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},updateEnterprisePool:async(e,r,s,o={})=>{d("updateEnterprisePool","enterpriseID",e),d("updateEnterprisePool","poolID",r),d("updateEnterprisePool","body",s);const a="/enterprises/{enterpriseID}/pools/{poolID}".replace("{enterpriseID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),n=new URL(a,b);let l;t&&(l=t.baseOptions);const i={method:"PUT",...l,...o},c={},p={};await m(c,"Authorization",t),c["Content-Type"]="application/json",V(n,p);let R=l&&l.headers?l.headers:{};return i.headers={...c,...R,...o.headers},i.data=x(s,i,t),{url:S(n),options:i}},updateOrgPool:async(e,r,s,o={})=>{d("updateOrgPool","orgID",e),d("updateOrgPool","poolID",r),d("updateOrgPool","body",s);const a="/organizations/{orgID}/pools/{poolID}".replace("{orgID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),n=new URL(a,b);let l;t&&(l=t.baseOptions);const i={method:"PUT",...l,...o},c={},p={};await m(c,"Authorization",t),c["Content-Type"]="application/json",V(n,p);let R=l&&l.headers?l.headers:{};return i.headers={...c,...R,...o.headers},i.data=x(s,i,t),{url:S(n),options:i}},updatePool:async(e,r,s={})=>{d("updatePool","poolID",e),d("updatePool","body",r);const o="/pools/{poolID}".replace("{poolID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"PUT",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},updateRepoPool:async(e,r,s,o={})=>{d("updateRepoPool","repoID",e),d("updateRepoPool","poolID",r),d("updateRepoPool","body",s);const a="/repositories/{repoID}/pools/{poolID}".replace("{repoID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),n=new URL(a,b);let l;t&&(l=t.baseOptions);const i={method:"PUT",...l,...o},c={},p={};await m(c,"Authorization",t),c["Content-Type"]="application/json",V(n,p);let R=l&&l.headers?l.headers:{};return i.headers={...c,...R,...o.headers},i.data=x(s,i,t),{url:S(n),options:i}}}},j=function(t){const e=mo(t);return{async createEnterprisePool(r,s,o){const a=await e.createEnterprisePool(r,s,o),n=t?.serverIndex??0,l=P["PoolsApi.createEnterprisePool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async createOrgPool(r,s,o){const a=await e.createOrgPool(r,s,o),n=t?.serverIndex??0,l=P["PoolsApi.createOrgPool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async createRepoPool(r,s,o){const a=await e.createRepoPool(r,s,o),n=t?.serverIndex??0,l=P["PoolsApi.createRepoPool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async deleteEnterprisePool(r,s,o){const a=await e.deleteEnterprisePool(r,s,o),n=t?.serverIndex??0,l=P["PoolsApi.deleteEnterprisePool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async deleteOrgPool(r,s,o){const a=await e.deleteOrgPool(r,s,o),n=t?.serverIndex??0,l=P["PoolsApi.deleteOrgPool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async deletePool(r,s){const o=await e.deletePool(r,s),a=t?.serverIndex??0,n=P["PoolsApi.deletePool"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async deleteRepoPool(r,s,o){const a=await e.deleteRepoPool(r,s,o),n=t?.serverIndex??0,l=P["PoolsApi.deleteRepoPool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async getEnterprisePool(r,s,o){const a=await e.getEnterprisePool(r,s,o),n=t?.serverIndex??0,l=P["PoolsApi.getEnterprisePool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async getOrgPool(r,s,o){const a=await e.getOrgPool(r,s,o),n=t?.serverIndex??0,l=P["PoolsApi.getOrgPool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async getPool(r,s){const o=await e.getPool(r,s),a=t?.serverIndex??0,n=P["PoolsApi.getPool"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async getRepoPool(r,s,o){const a=await e.getRepoPool(r,s,o),n=t?.serverIndex??0,l=P["PoolsApi.getRepoPool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async listEnterprisePools(r,s){const o=await e.listEnterprisePools(r,s),a=t?.serverIndex??0,n=P["PoolsApi.listEnterprisePools"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listOrgPools(r,s){const o=await e.listOrgPools(r,s),a=t?.serverIndex??0,n=P["PoolsApi.listOrgPools"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listPools(r){const s=await e.listPools(r),o=t?.serverIndex??0,a=P["PoolsApi.listPools"]?.[o]?.url;return(n,l)=>A(s,u,O,t)(n,a||l)},async listRepoPools(r,s){const o=await e.listRepoPools(r,s),a=t?.serverIndex??0,n=P["PoolsApi.listRepoPools"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async updateEnterprisePool(r,s,o,a){const n=await e.updateEnterprisePool(r,s,o,a),l=t?.serverIndex??0,i=P["PoolsApi.updateEnterprisePool"]?.[l]?.url;return(c,p)=>A(n,u,O,t)(c,i||p)},async updateOrgPool(r,s,o,a){const n=await e.updateOrgPool(r,s,o,a),l=t?.serverIndex??0,i=P["PoolsApi.updateOrgPool"]?.[l]?.url;return(c,p)=>A(n,u,O,t)(c,i||p)},async updatePool(r,s,o){const a=await e.updatePool(r,s,o),n=t?.serverIndex??0,l=P["PoolsApi.updatePool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async updateRepoPool(r,s,o,a){const n=await e.updateRepoPool(r,s,o,a),l=t?.serverIndex??0,i=P["PoolsApi.updateRepoPool"]?.[l]?.url;return(c,p)=>A(n,u,O,t)(c,i||p)}}};class $t extends H{createEnterprisePool(e,r,s){return j(this.configuration).createEnterprisePool(e,r,s).then(o=>o(this.axios,this.basePath))}createOrgPool(e,r,s){return j(this.configuration).createOrgPool(e,r,s).then(o=>o(this.axios,this.basePath))}createRepoPool(e,r,s){return j(this.configuration).createRepoPool(e,r,s).then(o=>o(this.axios,this.basePath))}deleteEnterprisePool(e,r,s){return j(this.configuration).deleteEnterprisePool(e,r,s).then(o=>o(this.axios,this.basePath))}deleteOrgPool(e,r,s){return j(this.configuration).deleteOrgPool(e,r,s).then(o=>o(this.axios,this.basePath))}deletePool(e,r){return j(this.configuration).deletePool(e,r).then(s=>s(this.axios,this.basePath))}deleteRepoPool(e,r,s){return j(this.configuration).deleteRepoPool(e,r,s).then(o=>o(this.axios,this.basePath))}getEnterprisePool(e,r,s){return j(this.configuration).getEnterprisePool(e,r,s).then(o=>o(this.axios,this.basePath))}getOrgPool(e,r,s){return j(this.configuration).getOrgPool(e,r,s).then(o=>o(this.axios,this.basePath))}getPool(e,r){return j(this.configuration).getPool(e,r).then(s=>s(this.axios,this.basePath))}getRepoPool(e,r,s){return j(this.configuration).getRepoPool(e,r,s).then(o=>o(this.axios,this.basePath))}listEnterprisePools(e,r){return j(this.configuration).listEnterprisePools(e,r).then(s=>s(this.axios,this.basePath))}listOrgPools(e,r){return j(this.configuration).listOrgPools(e,r).then(s=>s(this.axios,this.basePath))}listPools(e){return j(this.configuration).listPools(e).then(r=>r(this.axios,this.basePath))}listRepoPools(e,r){return j(this.configuration).listRepoPools(e,r).then(s=>s(this.axios,this.basePath))}updateEnterprisePool(e,r,s,o){return j(this.configuration).updateEnterprisePool(e,r,s,o).then(a=>a(this.axios,this.basePath))}updateOrgPool(e,r,s,o){return j(this.configuration).updateOrgPool(e,r,s,o).then(a=>a(this.axios,this.basePath))}updatePool(e,r,s){return j(this.configuration).updatePool(e,r,s).then(o=>o(this.axios,this.basePath))}updateRepoPool(e,r,s,o){return j(this.configuration).updateRepoPool(e,r,s,o).then(a=>a(this.axios,this.basePath))}}const Vo=function(t){return{listProviders:async(e={})=>{const r="/providers",s=new URL(r,b);let o;t&&(o=t.baseOptions);const a={method:"GET",...o,...e},n={},l={};await m(n,"Authorization",t),V(s,l);let i=o&&o.headers?o.headers:{};return a.headers={...n,...i,...e.headers},{url:S(s),options:a}}}},So=function(t){const e=Vo(t);return{async listProviders(r){const s=await e.listProviders(r),o=t?.serverIndex??0,a=P["ProvidersApi.listProviders"]?.[o]?.url;return(n,l)=>A(s,u,O,t)(n,a||l)}}};class Nt extends H{listProviders(e){return So(this.configuration).listProviders(e).then(r=>r(this.axios,this.basePath))}}const Ao=function(t){return{createRepo:async(e,r={})=>{d("createRepo","body",e);const s="/repositories",o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"POST",...a,...r},l={},i={};await m(l,"Authorization",t),l["Content-Type"]="application/json",V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},n.data=x(e,n,t),{url:S(o),options:n}},createRepoPool:async(e,r,s={})=>{d("createRepoPool","repoID",e),d("createRepoPool","body",r);const o="/repositories/{repoID}/pools".replace("{repoID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},createRepoScaleSet:async(e,r,s={})=>{d("createRepoScaleSet","repoID",e),d("createRepoScaleSet","body",r);const o="/repositories/{repoID}/scalesets".replace("{repoID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},deleteRepo:async(e,r,s={})=>{d("deleteRepo","repoID",e);const o="/repositories/{repoID}".replace("{repoID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"DELETE",...n,...s},i={},c={};await m(i,"Authorization",t),r!==void 0&&(c.keepWebhook=r),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},deleteRepoPool:async(e,r,s={})=>{d("deleteRepoPool","repoID",e),d("deleteRepoPool","poolID",r);const o="/repositories/{repoID}/pools/{poolID}".replace("{repoID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"DELETE",...n,...s},i={},c={};await m(i,"Authorization",t),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},getRepo:async(e,r={})=>{d("getRepo","repoID",e);const s="/repositories/{repoID}".replace("{repoID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},getRepoPool:async(e,r,s={})=>{d("getRepoPool","repoID",e),d("getRepoPool","poolID",r);const o="/repositories/{repoID}/pools/{poolID}".replace("{repoID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"GET",...n,...s},i={},c={};await m(i,"Authorization",t),V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},{url:S(a),options:l}},getRepoWebhookInfo:async(e,r={})=>{d("getRepoWebhookInfo","repoID",e);const s="/repositories/{repoID}/webhook".replace("{repoID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},installRepoWebhook:async(e,r,s={})=>{d("installRepoWebhook","repoID",e),d("installRepoWebhook","body",r);const o="/repositories/{repoID}/webhook".replace("{repoID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},listRepoInstances:async(e,r={})=>{d("listRepoInstances","repoID",e);const s="/repositories/{repoID}/instances".replace("{repoID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listRepoPools:async(e,r={})=>{d("listRepoPools","repoID",e);const s="/repositories/{repoID}/pools".replace("{repoID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listRepoScaleSets:async(e,r={})=>{d("listRepoScaleSets","repoID",e);const s="/repositories/{repoID}/scalesets".replace("{repoID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listRepos:async(e,r,s,o={})=>{const a="/repositories",n=new URL(a,b);let l;t&&(l=t.baseOptions);const i={method:"GET",...l,...o},c={},p={};await m(c,"Authorization",t),e!==void 0&&(p.owner=e),r!==void 0&&(p.name=r),s!==void 0&&(p.endpoint=s),V(n,p);let R=l&&l.headers?l.headers:{};return i.headers={...c,...R,...o.headers},{url:S(n),options:i}},uninstallRepoWebhook:async(e,r={})=>{d("uninstallRepoWebhook","repoID",e);const s="/repositories/{repoID}/webhook".replace("{repoID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"DELETE",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},updateRepo:async(e,r,s={})=>{d("updateRepo","repoID",e),d("updateRepo","body",r);const o="/repositories/{repoID}".replace("{repoID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"PUT",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},updateRepoPool:async(e,r,s,o={})=>{d("updateRepoPool","repoID",e),d("updateRepoPool","poolID",r),d("updateRepoPool","body",s);const a="/repositories/{repoID}/pools/{poolID}".replace("{repoID}",encodeURIComponent(String(e))).replace("{poolID}",encodeURIComponent(String(r))),n=new URL(a,b);let l;t&&(l=t.baseOptions);const i={method:"PUT",...l,...o},c={},p={};await m(c,"Authorization",t),c["Content-Type"]="application/json",V(n,p);let R=l&&l.headers?l.headers:{};return i.headers={...c,...R,...o.headers},i.data=x(s,i,t),{url:S(n),options:i}}}},F=function(t){const e=Ao(t);return{async createRepo(r,s){const o=await e.createRepo(r,s),a=t?.serverIndex??0,n=P["RepositoriesApi.createRepo"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async createRepoPool(r,s,o){const a=await e.createRepoPool(r,s,o),n=t?.serverIndex??0,l=P["RepositoriesApi.createRepoPool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async createRepoScaleSet(r,s,o){const a=await e.createRepoScaleSet(r,s,o),n=t?.serverIndex??0,l=P["RepositoriesApi.createRepoScaleSet"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async deleteRepo(r,s,o){const a=await e.deleteRepo(r,s,o),n=t?.serverIndex??0,l=P["RepositoriesApi.deleteRepo"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async deleteRepoPool(r,s,o){const a=await e.deleteRepoPool(r,s,o),n=t?.serverIndex??0,l=P["RepositoriesApi.deleteRepoPool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async getRepo(r,s){const o=await e.getRepo(r,s),a=t?.serverIndex??0,n=P["RepositoriesApi.getRepo"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async getRepoPool(r,s,o){const a=await e.getRepoPool(r,s,o),n=t?.serverIndex??0,l=P["RepositoriesApi.getRepoPool"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async getRepoWebhookInfo(r,s){const o=await e.getRepoWebhookInfo(r,s),a=t?.serverIndex??0,n=P["RepositoriesApi.getRepoWebhookInfo"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async installRepoWebhook(r,s,o){const a=await e.installRepoWebhook(r,s,o),n=t?.serverIndex??0,l=P["RepositoriesApi.installRepoWebhook"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async listRepoInstances(r,s){const o=await e.listRepoInstances(r,s),a=t?.serverIndex??0,n=P["RepositoriesApi.listRepoInstances"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listRepoPools(r,s){const o=await e.listRepoPools(r,s),a=t?.serverIndex??0,n=P["RepositoriesApi.listRepoPools"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listRepoScaleSets(r,s){const o=await e.listRepoScaleSets(r,s),a=t?.serverIndex??0,n=P["RepositoriesApi.listRepoScaleSets"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listRepos(r,s,o,a){const n=await e.listRepos(r,s,o,a),l=t?.serverIndex??0,i=P["RepositoriesApi.listRepos"]?.[l]?.url;return(c,p)=>A(n,u,O,t)(c,i||p)},async uninstallRepoWebhook(r,s){const o=await e.uninstallRepoWebhook(r,s),a=t?.serverIndex??0,n=P["RepositoriesApi.uninstallRepoWebhook"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async updateRepo(r,s,o){const a=await e.updateRepo(r,s,o),n=t?.serverIndex??0,l=P["RepositoriesApi.updateRepo"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async updateRepoPool(r,s,o,a){const n=await e.updateRepoPool(r,s,o,a),l=t?.serverIndex??0,i=P["RepositoriesApi.updateRepoPool"]?.[l]?.url;return(c,p)=>A(n,u,O,t)(c,i||p)}}};class Wt extends H{createRepo(e,r){return F(this.configuration).createRepo(e,r).then(s=>s(this.axios,this.basePath))}createRepoPool(e,r,s){return F(this.configuration).createRepoPool(e,r,s).then(o=>o(this.axios,this.basePath))}createRepoScaleSet(e,r,s){return F(this.configuration).createRepoScaleSet(e,r,s).then(o=>o(this.axios,this.basePath))}deleteRepo(e,r,s){return F(this.configuration).deleteRepo(e,r,s).then(o=>o(this.axios,this.basePath))}deleteRepoPool(e,r,s){return F(this.configuration).deleteRepoPool(e,r,s).then(o=>o(this.axios,this.basePath))}getRepo(e,r){return F(this.configuration).getRepo(e,r).then(s=>s(this.axios,this.basePath))}getRepoPool(e,r,s){return F(this.configuration).getRepoPool(e,r,s).then(o=>o(this.axios,this.basePath))}getRepoWebhookInfo(e,r){return F(this.configuration).getRepoWebhookInfo(e,r).then(s=>s(this.axios,this.basePath))}installRepoWebhook(e,r,s){return F(this.configuration).installRepoWebhook(e,r,s).then(o=>o(this.axios,this.basePath))}listRepoInstances(e,r){return F(this.configuration).listRepoInstances(e,r).then(s=>s(this.axios,this.basePath))}listRepoPools(e,r){return F(this.configuration).listRepoPools(e,r).then(s=>s(this.axios,this.basePath))}listRepoScaleSets(e,r){return F(this.configuration).listRepoScaleSets(e,r).then(s=>s(this.axios,this.basePath))}listRepos(e,r,s,o){return F(this.configuration).listRepos(e,r,s,o).then(a=>a(this.axios,this.basePath))}uninstallRepoWebhook(e,r){return F(this.configuration).uninstallRepoWebhook(e,r).then(s=>s(this.axios,this.basePath))}updateRepo(e,r,s){return F(this.configuration).updateRepo(e,r,s).then(o=>o(this.axios,this.basePath))}updateRepoPool(e,r,s,o){return F(this.configuration).updateRepoPool(e,r,s,o).then(a=>a(this.axios,this.basePath))}}const Ro=function(t){return{createEnterpriseScaleSet:async(e,r,s={})=>{d("createEnterpriseScaleSet","enterpriseID",e),d("createEnterpriseScaleSet","body",r);const o="/enterprises/{enterpriseID}/scalesets".replace("{enterpriseID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},createOrgScaleSet:async(e,r,s={})=>{d("createOrgScaleSet","orgID",e),d("createOrgScaleSet","body",r);const o="/organizations/{orgID}/scalesets".replace("{orgID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},createRepoScaleSet:async(e,r,s={})=>{d("createRepoScaleSet","repoID",e),d("createRepoScaleSet","body",r);const o="/repositories/{repoID}/scalesets".replace("{repoID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"POST",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}},deleteScaleSet:async(e,r={})=>{d("deleteScaleSet","scalesetID",e);const s="/scalesets/{scalesetID}".replace("{scalesetID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"DELETE",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},getScaleSet:async(e,r={})=>{d("getScaleSet","scalesetID",e);const s="/scalesets/{scalesetID}".replace("{scalesetID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listEnterpriseScaleSets:async(e,r={})=>{d("listEnterpriseScaleSets","enterpriseID",e);const s="/enterprises/{enterpriseID}/scalesets".replace("{enterpriseID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listOrgScaleSets:async(e,r={})=>{d("listOrgScaleSets","orgID",e);const s="/organizations/{orgID}/scalesets".replace("{orgID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listRepoScaleSets:async(e,r={})=>{d("listRepoScaleSets","repoID",e);const s="/repositories/{repoID}/scalesets".replace("{repoID}",encodeURIComponent(String(e))),o=new URL(s,b);let a;t&&(a=t.baseOptions);const n={method:"GET",...a,...r},l={},i={};await m(l,"Authorization",t),V(o,i);let c=a&&a.headers?a.headers:{};return n.headers={...l,...c,...r.headers},{url:S(o),options:n}},listScalesets:async(e={})=>{const r="/scalesets",s=new URL(r,b);let o;t&&(o=t.baseOptions);const a={method:"GET",...o,...e},n={},l={};await m(n,"Authorization",t),V(s,l);let i=o&&o.headers?o.headers:{};return a.headers={...n,...i,...e.headers},{url:S(s),options:a}},updateScaleSet:async(e,r,s={})=>{d("updateScaleSet","scalesetID",e),d("updateScaleSet","body",r);const o="/scalesets/{scalesetID}".replace("{scalesetID}",encodeURIComponent(String(e))),a=new URL(o,b);let n;t&&(n=t.baseOptions);const l={method:"PUT",...n,...s},i={},c={};await m(i,"Authorization",t),i["Content-Type"]="application/json",V(a,c);let p=n&&n.headers?n.headers:{};return l.headers={...i,...p,...s.headers},l.data=x(r,l,t),{url:S(a),options:l}}}},X=function(t){const e=Ro(t);return{async createEnterpriseScaleSet(r,s,o){const a=await e.createEnterpriseScaleSet(r,s,o),n=t?.serverIndex??0,l=P["ScalesetsApi.createEnterpriseScaleSet"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async createOrgScaleSet(r,s,o){const a=await e.createOrgScaleSet(r,s,o),n=t?.serverIndex??0,l=P["ScalesetsApi.createOrgScaleSet"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async createRepoScaleSet(r,s,o){const a=await e.createRepoScaleSet(r,s,o),n=t?.serverIndex??0,l=P["ScalesetsApi.createRepoScaleSet"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)},async deleteScaleSet(r,s){const o=await e.deleteScaleSet(r,s),a=t?.serverIndex??0,n=P["ScalesetsApi.deleteScaleSet"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async getScaleSet(r,s){const o=await e.getScaleSet(r,s),a=t?.serverIndex??0,n=P["ScalesetsApi.getScaleSet"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listEnterpriseScaleSets(r,s){const o=await e.listEnterpriseScaleSets(r,s),a=t?.serverIndex??0,n=P["ScalesetsApi.listEnterpriseScaleSets"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listOrgScaleSets(r,s){const o=await e.listOrgScaleSets(r,s),a=t?.serverIndex??0,n=P["ScalesetsApi.listOrgScaleSets"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listRepoScaleSets(r,s){const o=await e.listRepoScaleSets(r,s),a=t?.serverIndex??0,n=P["ScalesetsApi.listRepoScaleSets"]?.[a]?.url;return(l,i)=>A(o,u,O,t)(l,n||i)},async listScalesets(r){const s=await e.listScalesets(r),o=t?.serverIndex??0,a=P["ScalesetsApi.listScalesets"]?.[o]?.url;return(n,l)=>A(s,u,O,t)(n,a||l)},async updateScaleSet(r,s,o){const a=await e.updateScaleSet(r,s,o),n=t?.serverIndex??0,l=P["ScalesetsApi.updateScaleSet"]?.[n]?.url;return(i,c)=>A(a,u,O,t)(i,l||c)}}};class Qt extends H{createEnterpriseScaleSet(e,r,s){return X(this.configuration).createEnterpriseScaleSet(e,r,s).then(o=>o(this.axios,this.basePath))}createOrgScaleSet(e,r,s){return X(this.configuration).createOrgScaleSet(e,r,s).then(o=>o(this.axios,this.basePath))}createRepoScaleSet(e,r,s){return X(this.configuration).createRepoScaleSet(e,r,s).then(o=>o(this.axios,this.basePath))}deleteScaleSet(e,r){return X(this.configuration).deleteScaleSet(e,r).then(s=>s(this.axios,this.basePath))}getScaleSet(e,r){return X(this.configuration).getScaleSet(e,r).then(s=>s(this.axios,this.basePath))}listEnterpriseScaleSets(e,r){return X(this.configuration).listEnterpriseScaleSets(e,r).then(s=>s(this.axios,this.basePath))}listOrgScaleSets(e,r){return X(this.configuration).listOrgScaleSets(e,r).then(s=>s(this.axios,this.basePath))}listRepoScaleSets(e,r){return X(this.configuration).listRepoScaleSets(e,r).then(s=>s(this.axios,this.basePath))}listScalesets(e){return X(this.configuration).listScalesets(e).then(r=>r(this.axios,this.basePath))}updateScaleSet(e,r,s){return X(this.configuration).updateScaleSet(e,r,s).then(o=>o(this.axios,this.basePath))}}class Mt{apiKey;username;password;accessToken;basePath;serverIndex;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.serverIndex=e.serverIndex,this.baseOptions={...e.baseOptions,headers:{...e.baseOptions?.headers}},this.formDataCtor=e.formDataCtor}isJsonMime(e){const r=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return e!==null&&(r.test(e)||e.toLowerCase()==="application/json-patch+json")}}class gr{baseUrl;token;config;isDevelopmentMode(){return typeof window>"u"?!1:window.location.port==="5173"}loginApi;controllerInfoApi;controllerApi;endpointsApi;credentialsApi;repositoriesApi;organizationsApi;enterprisesApi;poolsApi;scaleSetsApi;instancesApi;providersApi;firstRunApi;hooksApi;constructor(e=""){this.baseUrl=e||window.location.origin;const r=this.isDevelopmentMode();this.config=new Mt({basePath:`${this.baseUrl}/api/v1`,accessToken:()=>this.token||"",baseOptions:{withCredentials:!r}}),this.loginApi=new qt(this.config),this.controllerInfoApi=new Lt(this.config),this.controllerApi=new Dt(this.config),this.endpointsApi=new kt(this.config),this.credentialsApi=new jt(this.config),this.repositoriesApi=new Wt(this.config),this.organizationsApi=new Ht(this.config),this.enterprisesApi=new zt(this.config),this.poolsApi=new $t(this.config),this.scaleSetsApi=new Qt(this.config),this.instancesApi=new _t(this.config),this.providersApi=new Nt(this.config),this.firstRunApi=new Ft(this.config),this.hooksApi=new Gt(this.config)}setToken(e){this.token=e;const r=this.isDevelopmentMode();this.config=new Mt({basePath:`${this.baseUrl}/api/v1`,accessToken:()=>e,baseOptions:{withCredentials:!r}}),this.loginApi=new qt(this.config),this.controllerInfoApi=new Lt(this.config),this.controllerApi=new Dt(this.config),this.endpointsApi=new kt(this.config),this.credentialsApi=new jt(this.config),this.repositoriesApi=new Wt(this.config),this.organizationsApi=new Ht(this.config),this.enterprisesApi=new zt(this.config),this.poolsApi=new $t(this.config),this.scaleSetsApi=new Qt(this.config),this.instancesApi=new _t(this.config),this.providersApi=new Nt(this.config),this.firstRunApi=new Ft(this.config),this.hooksApi=new Gt(this.config)}async login(e){const r={username:e.username,password:e.password},o=(await this.loginApi.login(r)).data.token;if(o)return this.setToken(o),{token:o};throw new Error("Login failed")}async getControllerInfo(){return(await this.controllerInfoApi.controllerInfo()).data}async listGithubEndpoints(){return(await this.endpointsApi.listGithubEndpoints()).data||[]}async getGithubEndpoint(e){return(await this.endpointsApi.getGithubEndpoint(e)).data}async createGithubEndpoint(e){return(await this.endpointsApi.createGithubEndpoint(e)).data}async updateGithubEndpoint(e,r){return(await this.endpointsApi.updateGithubEndpoint(e,r)).data}async deleteGithubEndpoint(e){await this.endpointsApi.deleteGithubEndpoint(e)}async listGiteaEndpoints(){return(await this.endpointsApi.listGiteaEndpoints()).data||[]}async getGiteaEndpoint(e){return(await this.endpointsApi.getGiteaEndpoint(e)).data}async createGiteaEndpoint(e){return(await this.endpointsApi.createGiteaEndpoint(e)).data}async updateGiteaEndpoint(e,r){return(await this.endpointsApi.updateGiteaEndpoint(e,r)).data}async deleteGiteaEndpoint(e){await this.endpointsApi.deleteGiteaEndpoint(e)}async listAllEndpoints(){const[e,r]=await Promise.all([this.listGithubEndpoints().catch(()=>[]),this.listGiteaEndpoints().catch(()=>[])]);return[...e.map(s=>({...s,endpoint_type:"github"})),...r.map(s=>({...s,endpoint_type:"gitea"}))]}async listGithubCredentials(){return(await this.credentialsApi.listCredentials()).data||[]}async getGithubCredentials(e){return(await this.credentialsApi.getCredentials(e)).data}async createGithubCredentials(e){return(await this.credentialsApi.createCredentials(e)).data}async updateGithubCredentials(e,r){return(await this.credentialsApi.updateCredentials(e,r)).data}async deleteGithubCredentials(e){await this.credentialsApi.deleteCredentials(e)}async listGiteaCredentials(){return(await this.credentialsApi.listGiteaCredentials()).data||[]}async getGiteaCredentials(e){return(await this.credentialsApi.getGiteaCredentials(e)).data}async createGiteaCredentials(e){return(await this.credentialsApi.createGiteaCredentials(e)).data}async updateGiteaCredentials(e,r){return(await this.credentialsApi.updateGiteaCredentials(e,r)).data}async deleteGiteaCredentials(e){await this.credentialsApi.deleteGiteaCredentials(e)}async listAllCredentials(){const[e,r]=await Promise.all([this.listGithubCredentials().catch(()=>[]),this.listGiteaCredentials().catch(()=>[])]);return[...e,...r]}async installRepositoryWebhook(e,r={}){await this.repositoriesApi.installRepoWebhook(e,r)}async uninstallRepositoryWebhook(e){await this.hooksApi.uninstallRepoWebhook(e)}async getRepositoryWebhookInfo(e){return(await this.hooksApi.getRepoWebhookInfo(e)).data}async listRepositories(){return(await this.repositoriesApi.listRepos()).data||[]}async getRepository(e){return(await this.repositoriesApi.getRepo(e)).data}async createRepository(e){return(await this.repositoriesApi.createRepo(e)).data}async updateRepository(e,r){return(await this.repositoriesApi.updateRepo(e,r)).data}async deleteRepository(e){await this.repositoriesApi.deleteRepo(e)}async installRepoWebhook(e){await this.repositoriesApi.installRepoWebhook(e,{})}async listRepositoryPools(e){return(await this.repositoriesApi.listRepoPools(e)).data||[]}async listRepositoryInstances(e){return(await this.repositoriesApi.listRepoInstances(e)).data||[]}async createRepositoryPool(e,r){return(await this.repositoriesApi.createRepoPool(e,r)).data}async installOrganizationWebhook(e,r={}){await this.organizationsApi.installOrgWebhook(e,r)}async uninstallOrganizationWebhook(e){await this.hooksApi.uninstallOrgWebhook(e)}async getOrganizationWebhookInfo(e){return(await this.hooksApi.getOrgWebhookInfo(e)).data}async listOrganizations(){return(await this.organizationsApi.listOrgs()).data||[]}async getOrganization(e){return(await this.organizationsApi.getOrg(e)).data}async createOrganization(e){return(await this.organizationsApi.createOrg(e)).data}async updateOrganization(e,r){return(await this.organizationsApi.updateOrg(e,r)).data}async deleteOrganization(e){await this.organizationsApi.deleteOrg(e)}async listOrganizationPools(e){return(await this.organizationsApi.listOrgPools(e)).data||[]}async listOrganizationInstances(e){return(await this.organizationsApi.listOrgInstances(e)).data||[]}async createOrganizationPool(e,r){return(await this.organizationsApi.createOrgPool(e,r)).data}async listEnterprises(){return(await this.enterprisesApi.listEnterprises()).data||[]}async getEnterprise(e){return(await this.enterprisesApi.getEnterprise(e)).data}async createEnterprise(e){return(await this.enterprisesApi.createEnterprise(e)).data}async updateEnterprise(e,r){return(await this.enterprisesApi.updateEnterprise(e,r)).data}async deleteEnterprise(e){await this.enterprisesApi.deleteEnterprise(e)}async listEnterprisePools(e){return(await this.enterprisesApi.listEnterprisePools(e)).data||[]}async listEnterpriseInstances(e){return(await this.enterprisesApi.listEnterpriseInstances(e)).data||[]}async createEnterprisePool(e,r){return(await this.enterprisesApi.createEnterprisePool(e,r)).data}async createRepositoryScaleSet(e,r){return(await this.repositoriesApi.createRepoScaleSet(e,r)).data}async listRepositoryScaleSets(e){return(await this.repositoriesApi.listRepoScaleSets(e)).data||[]}async createOrganizationScaleSet(e,r){return(await this.organizationsApi.createOrgScaleSet(e,r)).data}async listOrganizationScaleSets(e){return(await this.organizationsApi.listOrgScaleSets(e)).data||[]}async createEnterpriseScaleSet(e,r){return(await this.enterprisesApi.createEnterpriseScaleSet(e,r)).data}async listEnterpriseScaleSets(e){return(await this.enterprisesApi.listEnterpriseScaleSets(e)).data||[]}async listPools(){return(await this.poolsApi.listPools()).data||[]}async listAllPools(){return this.listPools()}async getPool(e){return(await this.poolsApi.getPool(e)).data}async updatePool(e,r){return(await this.poolsApi.updatePool(e,r)).data}async deletePool(e){await this.poolsApi.deletePool(e)}async listScaleSets(){return(await this.scaleSetsApi.listScalesets()).data||[]}async getScaleSet(e){return(await this.scaleSetsApi.getScaleSet(e.toString())).data}async updateScaleSet(e,r){return(await this.scaleSetsApi.updateScaleSet(e.toString(),r)).data}async deleteScaleSet(e){await this.scaleSetsApi.deleteScaleSet(e.toString())}async listInstances(){return(await this.instancesApi.listInstances()).data||[]}async getInstance(e){return(await this.instancesApi.getInstance(e)).data}async deleteInstance(e){await this.instancesApi.deleteInstance(e)}async listProviders(){return(await this.providersApi.listProviders()).data||[]}async listCredentials(){return this.listAllCredentials()}async listEndpoints(){return this.listAllEndpoints()}async firstRun(e){return(await this.firstRunApi.firstRun(e)).data}async updateController(e){return(await this.controllerApi.updateController(e)).data}}new gr;class fo extends gr{constructor(e=""){super(e)}}const Yo=new fo;var yo=nt(''),wo=nt(''),Io=nt(''),Eo=ps("");function Zo(t,e){const r=bt(e,["children","$$slots","$$events","$$legacy"]),s=bt(r,["variant","size","disabled","loading","type","fullWidth","icon","iconPosition"]);ls(e,!1);const o=te(),a=te(),n=te(),l=te(),i=te(),c=te(),p=te(),R=te(),I=is();let T=se(e,"variant",8,"primary"),f=se(e,"size",8,"md"),y=se(e,"disabled",8,!1),w=se(e,"loading",8,!1),C=se(e,"type",8,"button"),D=se(e,"fullWidth",8,!1),E=se(e,"icon",8,null),v=se(e,"iconPosition",8,"left");function U(){!y()&&!w()&&I("click")}ee(()=>{},()=>{re(o,"inline-flex items-center justify-center font-medium rounded-md transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 dark:focus:ring-offset-gray-900 cursor-pointer disabled:cursor-not-allowed")}),ee(()=>oe(f()),()=>{re(a,{sm:"px-3 py-2 text-sm",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"}[f()])}),ee(()=>oe(T()),()=>{re(n,{primary:"text-white bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 disabled:bg-gray-400 disabled:hover:bg-gray-400",secondary:"text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 border border-gray-300 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-600 focus:ring-blue-500",danger:"text-white bg-red-600 hover:bg-red-700 focus:ring-red-500 disabled:bg-gray-400 disabled:hover:bg-gray-400",ghost:"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 focus:ring-blue-500"}[T()])}),ee(()=>oe(D()),()=>{re(l,D()?"w-full":"")}),ee(()=>oe(y()),()=>{re(i,y()?"opacity-50":"")}),ee(()=>(k(o),k(a),k(n),k(l),k(i)),()=>{re(c,[k(o),k(a),k(n),k(l),k(i)].filter(Boolean).join(" "))}),ee(()=>oe(f()),()=>{re(p,{sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"}[f()])}),ee(()=>(oe(v()),oe(f())),()=>{re(R,{sm:v()==="left"?"-ml-0.5 mr-2":"ml-2 -mr-0.5",md:v()==="left"?"-ml-1 mr-2":"ml-2 -mr-1",lg:v()==="left"?"-ml-1 mr-3":"ml-3 -mr-1"}[f()])}),cs(),Tr();var L=Eo();ws(L,()=>({type:C(),disabled:y(),class:k(c),...s}));var B=qe(L);{var Z=W=>{var Q=yo();Ie(()=>Ee(Q,0,`animate-spin ${k(p)??""} ${v()==="left"?"-ml-1 mr-2":"ml-2 -mr-1"}`)),ue(W,Q)},ce=W=>{var Q=us(),Ge=Os(Q);{var Cr=_e=>{var ye=wo(),Ur=qe(ye);mt(Ur,E,!0),He(ye),Ie(()=>Ee(ye,0,`${k(p)??""} ${k(R)??""}`)),ue(_e,ye)};$e(Ge,_e=>{E()&&v()==="left"&&_e(Cr)},!0)}ue(W,Q)};$e(B,W=>{w()?W(Z):W(ce,!1)})}var dt=Pt(B,2);Ps(dt,e,"default",{});var xr=Pt(dt,2);{var vr=W=>{var Q=Io(),Ge=qe(Q);mt(Ge,E,!0),He(Q),Ie(()=>Ee(Q,0,`${k(p)??""} ${k(R)??""}`)),ue(W,Q)};$e(xr,W=>{E()&&v()==="right"&&!w()&&W(vr)})}He(L),ds("click",L,U),ue(t,L),hs()}export{Zo as B,Bo as a,Uo as b,Ue as c,Ps as d,Vs as e,ws as f,Yo as g,mt as h,Rs as i,To as r,Ee as s}; diff --git a/webapp/assets/_app/immutable/chunks/CoIRRsD9.js b/webapp/assets/_app/immutable/chunks/CoIRRsD9.js new file mode 100644 index 00000000..8cbc8c4b --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/CoIRRsD9.js @@ -0,0 +1 @@ +const s=globalThis.__sveltekit_13hoftk?.base??"/ui",t=globalThis.__sveltekit_13hoftk?.assets??s;export{t as a,s as b}; diff --git a/webapp/assets/_app/immutable/chunks/CwqI2jFH.js b/webapp/assets/_app/immutable/chunks/CwqI2jFH.js new file mode 100644 index 00000000..4cf31304 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/CwqI2jFH.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as Dr}from"./B3Pzt0F_.js";import{p as Lr,E as qr,m as s,o as Gr,f as m,k as r,j as o,g as e,r as a,t as v,e as M,c as b,v as T,b as Jr,z as gr,x as W,u as p,s as d,D as Ie,d as Fr}from"./D8EpLgQ1.js";import{p as vr,i as z}from"./5WA7h8uK.js";import{e as Ae,i as $e}from"./u94nIB4-.js";import{s as Oe,r as h,b as Q,g as C,c as Nr}from"./CiE1LlKV.js";import{b as E,a as Vr}from"./C6k1Q4We.js";import{p as Kr}from"./D4Caz1gY.js";import{M as Ur}from"./qB7B8uiS.js";import{J as Wr}from"./DZblzgqm.js";var Qr=m('

                '),Xr=m('
                '),Yr=m(""),Zr=m(''),et=m('
                '),rt=m(""),tt=m(''),at=m(' '),ot=m('
                '),dt=m('

                Entity & Provider Configuration

                Image & OS Configuration

                Runner Limits & Timing

                Advanced Settings

                Extra Specs (JSON)
                ',1),it=m('
                Creating...
                '),st=m('

                Create New Pool

                Entity Level *
                ');function yt(pr,X){Lr(X,!1);const Y=qr();let He=vr(X,"initialEntityType",8,""),mr=vr(X,"initialEntityId",8,""),G=s(!1),P=s(""),n=s(He()),S=s([]),Z=s([]),ee=s(!1),re=s(!1),k=s(mr()),j=s(""),B=s(""),D=s(""),te=s(void 0),ae=s(void 0),oe=s(void 0),de=s(100),ie=s("garm"),J=s("linux"),F=s("amd64"),se=s(""),le=s(!0),_=s([]),I=s(""),L=s("{}");async function fr(){try{d(re,!0),d(Z,await C.listProviders())}catch(l){d(P,l instanceof Error?l.message:"Failed to load providers")}finally{d(re,!1)}}async function Be(){if(e(n))try{switch(d(ee,!0),d(S,[]),e(n)){case"repository":d(S,await C.listRepositories());break;case"organization":d(S,await C.listOrganizations());break;case"enterprise":d(S,await C.listEnterprises());break}}catch(l){d(P,l instanceof Error?l.message:`Failed to load ${e(n)}s`)}finally{d(ee,!1)}}function ne(l){e(n)!==l&&(d(n,l),d(k,""),Be())}function De(){e(I).trim()&&!e(_).includes(e(I).trim())&&(d(_,[...e(_),e(I).trim()]),d(I,""))}function yr(l){d(_,e(_).filter((A,w)=>w!==l))}function xr(l){l.key==="Enter"&&(l.preventDefault(),De())}async function hr(){if(!e(n)||!e(k)||!e(j)||!e(B)||!e(D)){d(P,"Please fill in all required fields");return}try{d(G,!0),d(P,"");let l={};if(e(L).trim())try{l=JSON.parse(e(L))}catch{throw new Error("Invalid JSON in extra specs")}const A={provider_name:e(j),image:e(B),flavor:e(D),max_runners:e(te)||10,min_idle_runners:e(ae)||0,runner_bootstrap_timeout:e(oe)||20,priority:e(de),runner_prefix:e(ie),os_type:e(J),os_arch:e(F),"github-runner-group":e(se)||void 0,enabled:e(le),tags:e(_),extra_specs:e(L).trim()?l:void 0};let w;switch(e(n)){case"repository":w=await C.createRepositoryPool(e(k),A);break;case"organization":w=await C.createOrganizationPool(e(k),A);break;case"enterprise":w=await C.createEnterprisePool(e(k),A);break;default:throw new Error("Invalid entity level")}Y("submit",A)}catch(l){d(P,l instanceof Error?l.message:"Failed to create pool")}finally{d(G,!1)}}Gr(()=>{fr(),He()&&Be()}),Dr(),Ur(pr,{$$events:{close:()=>Y("close")},children:(l,A)=>{var w=st(),N=r(o(w),2),Le=o(N);{var kr=c=>{var y=Qr(),$=o(y),V=o($,!0);a($),a(y),v(()=>T(V,e(P))),b(c,y)};z(Le,c=>{e(P)&&c(kr)})}var ue=r(Le,2),qe=r(o(ue),2),be=o(qe),ce=r(be,2),Ge=r(ce,2);a(qe),a(ue);var Je=r(ue,2);{var _r=c=>{var y=dt(),$=Jr(y),V=r(o($),2),ve=o(V),pe=o(ve),Pr=o(pe);gr(),a(pe);var Rr=r(pe,2);{var Tr=t=>{var u=Xr();b(t,u)},zr=t=>{var u=Zr();v(()=>{e(k),W(()=>{e(n),e(S)})});var f=o(u),O=o(f);a(f),f.value=f.__value="";var R=r(f);Ae(R,1,()=>e(S),$e,(g,i)=>{var x=Yr(),U=o(x);{var Hr=H=>{var q=Ie();v(()=>T(q,`${e(i),p(()=>e(i).owner)??""}/${e(i),p(()=>e(i).name)??""} (${e(i),p(()=>e(i).endpoint?.name)??""})`)),b(H,q)},Br=H=>{var q=Ie();v(()=>T(q,`${e(i),p(()=>e(i).name)??""} (${e(i),p(()=>e(i).endpoint?.name)??""})`)),b(H,q)};z(U,H=>{e(n)==="repository"?H(Hr):H(Br,!1)})}a(x);var cr={};v(()=>{cr!==(cr=(e(i),p(()=>e(i).id)))&&(x.value=(x.__value=(e(i),p(()=>e(i).id)))??"")}),b(g,x)}),a(u),v(()=>T(O,`Select a ${e(n)??""}`)),Q(u,()=>e(k),g=>d(k,g)),b(t,u)};z(Rr,t=>{e(ee)?t(Tr):t(zr,!1)})}a(ve);var Ve=r(ve,2),Cr=r(o(Ve),2);{var Sr=t=>{var u=et();b(t,u)},jr=t=>{var u=tt();v(()=>{e(j),W(()=>{e(Z)})});var f=o(u);f.value=f.__value="";var O=r(f);Ae(O,1,()=>e(Z),$e,(R,g)=>{var i=rt(),x=o(i,!0);a(i);var U={};v(()=>{T(x,(e(g),p(()=>e(g).name))),U!==(U=(e(g),p(()=>e(g).name)))&&(i.value=(i.__value=(e(g),p(()=>e(g).name)))??"")}),b(R,i)}),a(u),Q(u,()=>e(j),R=>d(j,R)),b(t,u)};z(Cr,t=>{e(re)?t(Sr):t(jr,!1)})}a(Ve),a(V),a($);var me=r($,2),Ke=r(o(me),2),fe=o(Ke),Ue=r(o(fe),2);h(Ue),a(fe);var ye=r(fe,2),We=r(o(ye),2);h(We),a(ye);var xe=r(ye,2),he=r(o(xe),2);v(()=>{e(J),W(()=>{})});var ke=o(he);ke.value=ke.__value="linux";var Qe=r(ke);Qe.value=Qe.__value="windows",a(he),a(xe);var Xe=r(xe,2),_e=r(o(Xe),2);v(()=>{e(F),W(()=>{})});var we=o(_e);we.value=we.__value="amd64";var Ye=r(we);Ye.value=Ye.__value="arm64",a(_e),a(Xe),a(Ke),a(me);var Ee=r(me,2),Ze=r(o(Ee),2),Me=o(Ze),er=r(o(Me),2);h(er),a(Me);var Pe=r(Me,2),rr=r(o(Pe),2);h(rr),a(Pe);var tr=r(Pe,2),ar=r(o(tr),2);h(ar),a(tr),a(Ze),a(Ee);var or=r(Ee,2),Re=r(o(or),2),Te=o(Re),dr=r(o(Te),2);h(dr),a(Te);var ze=r(Te,2),ir=r(o(ze),2);h(ir),a(ze);var sr=r(ze,2),lr=r(o(sr),2);h(lr),a(sr),a(Re);var Ce=r(Re,2),nr=r(o(Ce),2),Se=o(nr),K=o(Se);h(K);var Ir=r(K,2);a(Se);var Ar=r(Se,2);{var $r=t=>{var u=ot();Ae(u,5,()=>e(_),$e,(f,O,R)=>{var g=at(),i=o(g),x=r(i);a(g),v(()=>{T(i,`${e(O)??""} `),Nr(x,"aria-label",`Remove tag ${e(O)}`)}),M("click",x,()=>yr(R)),b(f,g)}),a(u),b(t,u)};z(Ar,t=>{e(_),p(()=>e(_).length>0)&&t($r)})}a(nr),a(Ce);var je=r(Ce,2),Or=r(o(je),2);Wr(Or,{rows:4,placeholder:"{}",get value(){return e(L)},set value(t){d(L,t)},$$legacy:!0}),a(je);var ur=r(je,2),br=o(ur);h(br),gr(2),a(ur),a(or),v(t=>T(Pr,`${t??""} `),[()=>(e(n),p(()=>e(n).charAt(0).toUpperCase()+e(n).slice(1)))]),E(Ue,()=>e(B),t=>d(B,t)),E(We,()=>e(D),t=>d(D,t)),Q(he,()=>e(J),t=>d(J,t)),Q(_e,()=>e(F),t=>d(F,t)),E(er,()=>e(ae),t=>d(ae,t)),E(rr,()=>e(te),t=>d(te,t)),E(ar,()=>e(oe),t=>d(oe,t)),E(dr,()=>e(ie),t=>d(ie,t)),E(ir,()=>e(de),t=>d(de,t)),E(lr,()=>e(se),t=>d(se,t)),E(K,()=>e(I),t=>d(I,t)),M("keydown",K,xr),M("click",Ir,De),Vr(br,()=>e(le),t=>d(le,t)),b(c,y)};z(Je,c=>{e(n)&&c(_r)})}var Fe=r(Je,2),Ne=o(Fe),ge=r(Ne,2),wr=o(ge);{var Er=c=>{var y=it();b(c,y)},Mr=c=>{var y=Ie("Create Pool");b(c,y)};z(wr,c=>{e(G)?c(Er):c(Mr,!1)})}a(ge),a(Fe),a(N),a(w),v(()=>{Oe(be,1,`flex flex-col items-center justify-center p-4 border-2 rounded-lg transition-colors cursor-pointer ${e(n)==="repository"?"border-blue-500 bg-blue-50 dark:bg-blue-900":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`),Oe(ce,1,`flex flex-col items-center justify-center p-4 border-2 rounded-lg transition-colors cursor-pointer ${e(n)==="organization"?"border-blue-500 bg-blue-50 dark:bg-blue-900":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`),Oe(Ge,1,`flex flex-col items-center justify-center p-4 border-2 rounded-lg transition-colors cursor-pointer ${e(n)==="enterprise"?"border-blue-500 bg-blue-50 dark:bg-blue-900":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`),ge.disabled=e(G)||!e(n)||!e(k)||!e(j)||!e(B)||!e(D)}),M("click",be,()=>ne("repository")),M("click",ce,()=>ne("organization")),M("click",Ge,()=>ne("enterprise")),M("click",Ne,()=>Y("close")),M("submit",N,Kr(hr)),b(l,w)},$$slots:{default:!0}}),Fr()}export{yt as C}; diff --git a/webapp/assets/_app/immutable/chunks/D4Caz1gY.js b/webapp/assets/_app/immutable/chunks/D4Caz1gY.js new file mode 100644 index 00000000..85ca9d43 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/D4Caz1gY.js @@ -0,0 +1 @@ +function r(t){return function(...e){var n=e[0];return n.preventDefault(),t?.apply(this,e)}}export{r as p}; diff --git a/webapp/assets/_app/immutable/chunks/D8EpLgQ1.js b/webapp/assets/_app/immutable/chunks/D8EpLgQ1.js new file mode 100644 index 00000000..b9d9b59c --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/D8EpLgQ1.js @@ -0,0 +1,2 @@ +var Je=Array.isArray,wn=Array.prototype.indexOf,yn=Array.from,$e=Object.defineProperty,be=Object.getOwnPropertyDescriptor,gn=Object.getOwnPropertyDescriptors,bn=Object.prototype,mn=Array.prototype,At=Object.getPrototypeOf,dt=Object.isExtensible;function Mr(e){return typeof e=="function"}const Ne=()=>{};function Lr(e){return e()}function St(e){for(var t=0;t{e=r,t=s});return{promise:n,resolve:e,reject:t}}const k=2,Qe=4,qe=8,Ae=16,Y=32,ae=64,kt=128,O=256,De=512,m=1024,P=2048,H=4096,W=8192,de=16384,et=32768,Ct=65536,ht=1<<17,Rt=1<<18,tt=1<<19,nt=1<<20,Be=1<<21,rt=1<<22,X=1<<23,Z=Symbol("$state"),Fr=Symbol("legacy props"),qr=Symbol(""),at=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},st=3,me=8;function Tn(){throw new Error("https://svelte.dev/e/await_outside_boundary")}function he(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function xn(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function An(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Sn(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function kn(e){throw new Error("https://svelte.dev/e/effect_orphan")}function Cn(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Rn(){throw new Error("https://svelte.dev/e/get_abort_signal_outside_reaction")}function On(){throw new Error("https://svelte.dev/e/hydration_failed")}function Ot(e){throw new Error("https://svelte.dev/e/lifecycle_legacy_only")}function Vr(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function Nn(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Pn(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Dn(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}const Yr=1,Hr=2,Ur=4,$r=8,Br=16,Wr=1,zr=2,Gr=4,Kr=8,Xr=16,Nt=1,In=2,it="[",Mn="[!",Pt="]",oe={},E=Symbol(),Zr="http://www.w3.org/1999/xhtml",Jr="@attach";function je(e){console.warn("https://svelte.dev/e/hydration_mismatch")}function Qr(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}let g=!1;function fe(e){g=e}let w;function I(e){if(e===null)throw je(),oe;return w=e}function ut(){return I(M(w))}function ea(e){if(g){if(M(w)!==null)throw je(),oe;w=e}}function ta(e=1){if(g){for(var t=e,n=w;t--;)n=M(n);w=n}}function na(){for(var e=0,t=w;;){if(t.nodeType===me){var n=t.data;if(n===Pt){if(e===0)return t;e-=1}else(n===it||n===Mn)&&(e+=1)}var r=M(t);t.remove(),t=r}}function ra(e){if(!e||e.nodeType!==me)throw je(),oe;return e.data}function Dt(e){return e===this.v}function It(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function aa(e,t){return e!==t}function Mt(e){return!It(e,this.v)}let Se=!1;function sa(){Se=!0}let p=null;function Ie(e){p=e}function Ln(e){return Ve().get(e)}function Fn(e,t){return Ve().set(e,t),t}function qn(e){return Ve().has(e)}function jn(){return Ve()}function Vn(e,t=!1,n){p={p,c:null,e:null,s:e,x:null,l:Se&&!t?{s:null,u:null,$:[]}:null}}function Yn(e){var t=p,n=t.e;if(n!==null){t.e=null;for(var r of n)Jt(r)}return p=t.p,{}}function ke(){return!Se||p!==null&&p.l===null}function Ve(e){return p===null&&he(),p.c??=new Map(Hn(p)||void 0)}function Hn(e){let t=e.p;for(;t!==null;){const n=t.c;if(n!==null)return n;t=t.p}return null}const Un=new WeakMap;function $n(e){var t=h;if(t===null)return d.f|=X,e;if((t.f&et)===0){if((t.f&kt)===0)throw!t.parent&&e instanceof Error&&Lt(e),e;t.b.error(e)}else lt(e,t)}function lt(e,t){for(;t!==null;){if((t.f&kt)!==0)try{t.b.error(e);return}catch(n){e=n}t=t.parent}throw e instanceof Error&&Lt(e),e}function Lt(e){const t=Un.get(e);t&&($e(e,"message",{value:t.message}),$e(e,"stack",{value:t.stack}))}const Bn=typeof requestIdleCallback>"u"?e=>setTimeout(e,1):requestIdleCallback;let Ee=[],Te=[];function Ft(){var e=Ee;Ee=[],St(e)}function qt(){var e=Te;Te=[],St(e)}function jt(e){Ee.length===0&&queueMicrotask(Ft),Ee.push(e)}function ia(e){Te.length===0&&Bn(qt),Te.push(e)}function Wn(){Ee.length>0&&Ft(),Te.length>0&&qt()}function zn(){for(var e=h.b;e!==null&&!e.has_pending_snippet();)e=e.parent;return e===null&&Tn(),e}function ft(e){var t=k|P,n=d!==null&&(d.f&k)!==0?d:null;return h===null||n!==null&&(n.f&O)!==0?t|=O:h.f|=tt,{ctx:p,deps:null,effects:null,equals:Dt,f:t,fn:e,reactions:null,rv:0,v:E,wv:0,parent:n??h,ac:null}}function Gn(e,t){let n=h;n===null&&xn();var r=n.b,s=void 0,a=ct(E),i=null,f=!d;return ar(()=>{try{var u=e()}catch(_){u=Promise.reject(_)}var l=()=>u;s=i?.then(l,l)??Promise.resolve(u),i=s;var o=y,v=r.pending;f&&(r.update_pending_count(1),v||o.increment());const c=(_,b=void 0)=>{i=null,v||o.activate(),b?b!==at&&(a.f|=X,Le(a,b)):((a.f&X)!==0&&(a.f^=X),Le(a,_)),f&&(r.update_pending_count(-1),v||o.decrement()),Ht()};if(s.then(c,_=>c(null,_||"unknown")),o)return()=>{queueMicrotask(()=>o.neuter())}}),new Promise(u=>{function l(o){function v(){o===s?u(a):l(s)}o.then(v,v)}l(s)})}function ua(e){const t=ft(e);return sn(t),t}function Kn(e){const t=ft(e);return t.equals=Mt,t}function Vt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;nGn(u))).then(u=>{s?.activate(),i();try{n([...e.map(r),...u])}catch(l){(a.f&de)===0&<(l,a)}s?.deactivate(),Ht()}).catch(u=>{f.error(u)})}function Jn(){var e=h,t=d,n=p;return function(){G(e),L(t),Ie(n)}}function Ht(){G(null),L(null),Ie(null)}const we=new Set;let y=null,He=null,ve=null,pt=new Set,Me=[];function Ut(){const e=Me.shift();Me.length>0&&queueMicrotask(Ut),e()}let ee=[],Ye=null,We=!1,Pe=!1;class te{current=new Map;#a=new Map;#s=new Set;#e=0;#f=null;#o=!1;#n=[];#i=[];#r=[];#t=[];#u=[];#c=[];#_=[];skipped_effects=new Set;process(t){ee=[],He=null;var n=null;if(we.size>1){n=new Map,ve=new Map;for(const[a,i]of this.current)n.set(a,{v:a.v,wv:a.wv}),a.v=i;for(const a of we)if(a!==this)for(const[i,f]of a.#a)n.has(i)||(n.set(i,{v:i.v,wv:i.wv}),i.v=f)}for(const a of t)this.#d(a);if(this.#n.length===0&&this.#e===0){this.#v();var r=this.#r,s=this.#t;this.#r=[],this.#t=[],this.#u=[],He=y,y=null,wt(r),wt(s),y===null?y=this:we.delete(this),this.#f?.resolve()}else this.#l(this.#r),this.#l(this.#t),this.#l(this.#u);if(n){for(const[a,{v:i,wv:f}]of n)a.wv<=f&&(a.v=i);ve=null}for(const a of this.#n)_e(a);for(const a of this.#i)_e(a);this.#n=[],this.#i=[]}#d(t){t.f^=m;for(var n=t.first;n!==null;){var r=n.f,s=(r&(Y|ae))!==0,a=s&&(r&m)!==0,i=a||(r&W)!==0||this.skipped_effects.has(n);if(!i&&n.fn!==null){if(s)n.f^=m;else if((r&m)===0)if((r&Qe)!==0)this.#t.push(n);else if((r&rt)!==0){var f=n.b?.pending?this.#i:this.#n;f.push(n)}else Ce(n)&&((n.f&Ae)!==0&&this.#u.push(n),_e(n));var u=n.first;if(u!==null){n=u;continue}}var l=n.parent;for(n=n.next;n===null&&l!==null;)n=l.next,l=l.parent}}#l(t){for(const n of t)((n.f&P)!==0?this.#c:this.#_).push(n),x(n,m);t.length=0}capture(t,n){this.#a.has(t)||this.#a.set(t,n),this.current.set(t,t.v)}activate(){y=this}deactivate(){y=null,He=null;for(const t of pt)if(pt.delete(t),t(),y!==null)break}neuter(){this.#o=!0}flush(){ee.length>0?ze():this.#v(),y===this&&(this.#e===0&&we.delete(this),this.deactivate())}#v(){if(!this.#o)for(const t of this.#s)t();this.#s.clear()}increment(){this.#e+=1}decrement(){if(this.#e-=1,this.#e===0){for(const t of this.#c)x(t,P),ne(t);for(const t of this.#_)x(t,H),ne(t);this.#r=[],this.#t=[],this.flush()}else this.deactivate()}add_callback(t){this.#s.add(t)}settled(){return(this.#f??=En()).promise}static ensure(){if(y===null){const t=y=new te;we.add(y),Pe||te.enqueue(()=>{y===t&&t.flush()})}return y}static enqueue(t){Me.length===0&&queueMicrotask(Ut),Me.unshift(t)}}function $t(e){var t=Pe;Pe=!0;try{var n;for(e&&(ze(),n=e());;){if(Wn(),ee.length===0&&(y?.flush(),ee.length===0))return Ye=null,n;ze()}}finally{Pe=t}}function ze(){var e=ce;We=!0;try{var t=0;for(bt(!0);ee.length>0;){var n=te.ensure();if(t++>1e3){var r,s;Qn()}n.process(ee),J.clear()}}finally{We=!1,bt(e),Ye=null}}function Qn(){try{Cn()}catch(e){lt(e,Ye)}}function wt(e){var t=e.length;if(t!==0){for(var n=0;ns&&(r.f&nt)!==0)break}}for(;nK(e))),t}function j(e,t,n=!1){d!==null&&(!D||(d.f&ht)!==0)&&ke()&&(d.f&(k|Ae|rt|ht))!==0&&!V?.includes(e)&&Dn();let r=n?ye(t):t;return Le(e,r)}function Le(e,t){if(!e.equals(t)){var n=e.v;pe?J.set(e,t):J.set(e,n),e.v=t;var r=te.ensure();r.capture(e,n),(e.f&k)!==0&&((e.f&P)!==0&&ot(e),x(e,(e.f&O)===0?m:H)),e.wv=ln(),Bt(e,P),ke()&&h!==null&&(h.f&m)!==0&&(h.f&(Y|ae))===0&&(R===null?_r([e]):R.push(e))}return t}function oa(e,t=1){var n=K(e),r=t===1?n++:n--;return j(e,n),r}function Ue(e){j(e,e.v+1)}function Bt(e,t){var n=e.reactions;if(n!==null)for(var r=ke(),s=n.length,a=0;a{if(Q===a)return f();var u=d,l=Q;L(null),Et(a);var o=f();return L(u),Et(l),o};return r&&n.set("length",$(e.length)),new Proxy(e,{defineProperty(f,u,l){(!("value"in l)||l.configurable===!1||l.enumerable===!1||l.writable===!1)&&Nn();var o=n.get(u);return o===void 0?o=i(()=>{var v=$(l.value);return n.set(u,v),v}):j(o,l.value,!0),!0},deleteProperty(f,u){var l=n.get(u);if(l===void 0){if(u in f){const o=i(()=>$(E));n.set(u,o),Ue(s)}}else j(l,E),Ue(s);return!0},get(f,u,l){if(u===Z)return e;var o=n.get(u),v=u in f;if(o===void 0&&(!v||be(f,u)?.writable)&&(o=i(()=>{var _=ye(v?f[u]:E),b=$(_);return b}),n.set(u,o)),o!==void 0){var c=K(o);return c===E?void 0:c}return Reflect.get(f,u,l)},getOwnPropertyDescriptor(f,u){var l=Reflect.getOwnPropertyDescriptor(f,u);if(l&&"value"in l){var o=n.get(u);o&&(l.value=K(o))}else if(l===void 0){var v=n.get(u),c=v?.v;if(v!==void 0&&c!==E)return{enumerable:!0,configurable:!0,value:c,writable:!0}}return l},has(f,u){if(u===Z)return!0;var l=n.get(u),o=l!==void 0&&l.v!==E||Reflect.has(f,u);if(l!==void 0||h!==null&&(!o||be(f,u)?.writable)){l===void 0&&(l=i(()=>{var c=o?ye(f[u]):E,_=$(c);return _}),n.set(u,l));var v=K(l);if(v===E)return!1}return o},set(f,u,l,o){var v=n.get(u),c=u in f;if(r&&u==="length")for(var _=l;_$(E)),n.set(_+"",b))}if(v===void 0)(!c||be(f,u)?.writable)&&(v=i(()=>$(void 0)),j(v,ye(l)),n.set(u,v));else{c=v.v!==E;var q=i(()=>ye(l));j(v,q)}var Re=Reflect.getOwnPropertyDescriptor(f,u);if(Re?.set&&Re.set.call(o,l),!c){if(r&&typeof u=="string"){var Oe=n.get("length"),U=Number(u);Number.isInteger(U)&&U>=Oe.v&&j(Oe,U+1)}Ue(s)}return!0},ownKeys(f){K(s);var u=Reflect.ownKeys(f).filter(v=>{var c=n.get(v);return c===void 0||c.v!==E});for(var[l,o]of n)o.v!==E&&!(l in f)&&u.push(l);return u},setPrototypeOf(){Pn()}})}function yt(e){try{if(e!==null&&typeof e=="object"&&Z in e)return e[Z]}catch{}return e}function ca(e,t){return Object.is(yt(e),yt(t))}var gt,er,Wt,zt,Gt;function Ge(){if(gt===void 0){gt=window,er=document,Wt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;zt=be(t,"firstChild").get,Gt=be(t,"nextSibling").get,dt(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),dt(n)&&(n.__t=void 0)}}function z(e=""){return document.createTextNode(e)}function A(e){return zt.call(e)}function M(e){return Gt.call(e)}function _a(e,t){if(!g)return A(e);var n=A(w);if(n===null)n=w.appendChild(z());else if(t&&n.nodeType!==st){var r=z();return n?.before(r),I(r),r}return I(n),n}function va(e,t){if(!g){var n=A(e);return n instanceof Comment&&n.data===""?M(n):n}return w}function da(e,t=1,n=!1){let r=g?w:e;for(var s;t--;)s=r,r=M(r);if(!g)return r;if(n&&r?.nodeType!==st){var a=z();return r===null?s?.after(a):r.before(a),I(a),a}return I(r),r}function Kt(e){e.textContent=""}function ha(){return!1}function Xt(e){h===null&&d===null&&kn(),d!==null&&(d.f&O)!==0&&h===null&&Sn(),pe&&An()}function tr(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function F(e,t,n,r=!0){var s=h;s!==null&&(s.f&W)!==0&&(e|=W);var a={ctx:p,deps:null,nodes_start:null,nodes_end:null,f:e|P,first:null,fn:t,last:null,next:null,parent:s,b:s&&s.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(n)try{_e(a),a.f|=et}catch(u){throw re(a),u}else t!==null&&ne(a);var i=n&&a.deps===null&&a.first===null&&a.nodes_start===null&&a.teardown===null&&(a.f&tt)===0;if(!i&&r&&(s!==null&&tr(a,s),d!==null&&(d.f&k)!==0&&(e&ae)===0)){var f=d;(f.effects??=[]).push(a)}return a}function Zt(e){const t=F(qe,null,!1);return x(t,m),t.teardown=e,t}function nr(e){Xt();var t=h.f,n=!d&&(t&Y)!==0&&(t&et)===0;if(n){var r=p;(r.e??=[]).push(e)}else return Jt(e)}function Jt(e){return F(Qe|nt,e,!1)}function pa(e){return Xt(),F(qe|nt,e,!0)}function rr(e){te.ensure();const t=F(ae,e,!0);return(n={})=>new Promise(r=>{n.outro?fr(t,()=>{re(t),r(void 0)}):(re(t),r(void 0))})}function wa(e){return F(Qe,e,!1)}function ya(e,t){var n=p,r={effect:null,ran:!1,deps:e};n.l.$.push(r),r.effect=Qt(()=>{e(),!r.ran&&(r.ran=!0,se(t))})}function ga(){var e=p;Qt(()=>{for(var t of e.l.$){t.deps();var n=t.effect;(n.f&m)!==0&&x(n,H),Ce(n)&&_e(n),t.ran=!1}})}function ar(e){return F(rt|tt,e,!0)}function Qt(e,t=0){return F(qe|t,e,!0)}function ba(e,t=[],n=[]){Zn(t,n,r=>{F(qe,()=>e(...r.map(K)),!0)})}function sr(e,t=0){var n=F(Ae|t,e,!0);return n}function ir(e,t=!0){return F(Y,e,!0,t)}function en(e){var t=e.teardown;if(t!==null){const n=pe,r=d;mt(!0),L(null);try{t.call(null)}finally{mt(n),L(r)}}}function tn(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){n.ac?.abort(at);var r=n.next;(n.f&ae)!==0?n.parent=null:re(n,t),n=r}}function ur(e){for(var t=e.first;t!==null;){var n=t.next;(t.f&Y)===0&&re(t),t=n}}function re(e,t=!0){var n=!1;(t||(e.f&Rt)!==0)&&e.nodes_start!==null&&e.nodes_end!==null&&(lr(e.nodes_start,e.nodes_end),n=!0),tn(e,t&&!n),Fe(e,0),x(e,de);var r=e.transitions;if(r!==null)for(const a of r)a.stop();en(e);var s=e.parent;s!==null&&s.first!==null&&nn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes_start=e.nodes_end=e.ac=null}function lr(e,t){for(;e!==null;){var n=e===t?null:M(e);e.remove(),e=n}}function nn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function fr(e,t){var n=[];rn(e,n,!0),or(n,()=>{re(e),t&&t()})}function or(e,t){var n=e.length;if(n>0){var r=()=>--n||t();for(var s of e)s.out(r)}else t()}function rn(e,t,n){if((e.f&W)===0){if(e.f^=W,e.transitions!==null)for(const i of e.transitions)(i.is_global||n)&&t.push(i);for(var r=e.first;r!==null;){var s=r.next,a=(r.f&Ct)!==0||(r.f&Y)!==0;rn(r,t,a?n:!1),r=s}}}function ma(e){an(e,!0)}function an(e,t){if((e.f&W)!==0){e.f^=W,(e.f&m)===0&&(x(e,P),ne(e));for(var n=e.first;n!==null;){var r=n.next,s=(n.f&Ct)!==0||(n.f&Y)!==0;an(n,s?t:!1),n=r}if(e.transitions!==null)for(const a of e.transitions)(a.is_global||t)&&a.in()}}let le=null;function cr(e){var t=le;try{if(le=new Set,se(e),t!==null)for(var n of le)t.add(n);return le}finally{le=t}}function Ea(e){for(var t of cr(e))Le(t,t.v)}let ce=!1;function bt(e){ce=e}let pe=!1;function mt(e){pe=e}let d=null,D=!1;function L(e){d=e}let h=null;function G(e){h=e}let V=null;function sn(e){d!==null&&(V===null?V=[e]:V.push(e))}let T=null,S=0,R=null;function _r(e){R=e}let un=1,xe=0,Q=xe;function Et(e){Q=e}let B=!1;function ln(){return++un}function Ce(e){var t=e.f;if((t&P)!==0)return!0;if((t&H)!==0){var n=e.deps,r=(t&O)!==0;if(n!==null){var s,a,i=(t&De)!==0,f=r&&h!==null&&!B,u=n.length;if((i||f)&&(h===null||(h.f&de)===0)){var l=e,o=l.parent;for(s=0;se.wv)return!0}(!r||h!==null&&!B)&&x(e,m)}return!1}function fn(e,t,n=!0){var r=e.reactions;if(r!==null&&!V?.includes(e))for(var s=0;s0)for(c.length=S+T.length,_=0;_{document.activeElement===n&&e.focus()})}}function Ca(e){g&&A(e)!==null&&Kt(e)}let Tt=!1;function mr(){Tt||(Tt=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{if(!e.defaultPrevented)for(const t of e.target.elements)t.__on_r?.()})},{capture:!0}))}function _n(e){var t=d,n=h;L(null),G(null);try{return e()}finally{L(t),G(n)}}function Ra(e,t,n,r=n){e.addEventListener(t,()=>_n(n));const s=e.__on_r;s?e.__on_r=()=>{s(),r(!0)}:e.__on_r=()=>r(!0),mr()}const vn=new Set,Xe=new Set;function Er(e,t,n,r={}){function s(a){if(r.capture||ge.call(t,a),!a.cancelBubble)return _n(()=>n?.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?jt(()=>{t.addEventListener(e,s,r)}):t.addEventListener(e,s,r),s}function Oa(e,t,n,r,s){var a={capture:r,passive:s},i=Er(e,t,n,a);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&Zt(()=>{t.removeEventListener(e,i,a)})}function Na(e){for(var t=0;t{throw U});throw c}}finally{e.__root=t,delete e.currentTarget,L(o),G(v)}}}let C;function Tr(){C=void 0}function Pa(e){let t=null,n=g;var r;if(g){for(t=w,C===void 0&&(C=A(document.head));C!==null&&(C.nodeType!==me||C.data!==it);)C=M(C);C===null?fe(!1):C=I(M(C))}g||(r=document.head.appendChild(z()));try{sr(()=>e(r),Rt)}finally{n&&(fe(!0),C=w,I(t))}}function _t(e){var t=document.createElement("template");return t.innerHTML=e.replaceAll("",""),t.content}function N(e,t){var n=h;n.nodes_start===null&&(n.nodes_start=e,n.nodes_end=t)}function Da(e,t){var n=(t&Nt)!==0,r=(t&In)!==0,s,a=!e.startsWith("");return()=>{if(g)return N(w,null),w;s===void 0&&(s=_t(a?e:""+e),n||(s=A(s)));var i=r||Wt?document.importNode(s,!0):s.cloneNode(!0);if(n){var f=A(i),u=i.lastChild;N(f,u)}else N(i,i);return i}}function xr(e,t,n="svg"){var r=!e.startsWith(""),s=(t&Nt)!==0,a=`<${n}>${r?e:""+e}`,i;return()=>{if(g)return N(w,null),w;if(!i){var f=_t(a),u=A(f);if(s)for(i=document.createDocumentFragment();A(u);)i.appendChild(A(u));else i=A(u)}var l=i.cloneNode(!0);if(s){var o=A(l),v=l.lastChild;N(o,v)}else N(l,l);return l}}function Ia(e,t){return xr(e,t,"svg")}function Ma(e=""){if(!g){var t=z(e+"");return N(t,t),t}var n=w;return n.nodeType!==st&&(n.before(n=z()),I(n)),N(n,n),n}function La(){if(g)return N(w,null),w;var e=document.createDocumentFragment(),t=document.createComment(""),n=z();return e.append(t,n),N(t,n),e}function Fa(e,t){if(g){h.nodes_end=w,ut();return}e!==null&&e.before(t)}function qa(e,t){var n=t==null?"":typeof t=="object"?t+"":t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=n+"")}function dn(e,t){return hn(e,t)}function Ar(e,t){Ge(),t.intro=t.intro??!1;const n=t.target,r=g,s=w;try{for(var a=A(n);a&&(a.nodeType!==me||a.data!==it);)a=M(a);if(!a)throw oe;fe(!0),I(a),ut();const i=hn(e,{...t,anchor:a});if(w===null||w.nodeType!==me||w.data!==Pt)throw je(),oe;return fe(!1),i}catch(i){if(i instanceof Error&&i.message.split(` +`).some(f=>f.startsWith("https://svelte.dev/e/")))throw i;return i!==oe&&console.warn("Failed to hydrate: ",i),t.recover===!1&&On(),Ge(),Kt(n),fe(!1),dn(e,t)}finally{fe(r),I(s),Tr()}}const ie=new Map;function hn(e,{target:t,anchor:n,props:r={},events:s,context:a,intro:i=!0}){Ge();var f=new Set,u=v=>{for(var c=0;c{var v=n??t.appendChild(z());return ir(()=>{if(a){Vn({});var c=p;c.c=a}s&&(r.$$events=s),g&&N(v,null),l=e(v,r)||{},g&&(h.nodes_end=w),a&&Yn()}),()=>{for(var c of f){t.removeEventListener(c,ge);var _=ie.get(c);--_===0?(document.removeEventListener(c,ge),ie.delete(c)):ie.set(c,_)}Xe.delete(u),v!==n&&v.parentNode?.removeChild(v)}});return Ze.set(l,o),l}let Ze=new WeakMap;function Sr(e,t){const n=Ze.get(e);return n?(Ze.delete(e),n(t)):Promise.resolve()}function kr(e){return(t,...n)=>{var r=e(...n),s;if(g)s=w,ut();else{var a=r.render().trim(),i=_t(a);s=A(i),t.before(s)}const f=r.setup?.(s);N(s,s),typeof f=="function"&&Zt(f)}}function Cr(e,t,n){if(e==null)return t(void 0),Ne;const r=se(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}const ue=[];function ja(e,t=Ne){let n=null;const r=new Set;function s(f){if(It(e,f)&&(e=f,n)){const u=!ue.length;for(const l of r)l[1](),ue.push(l,e);if(u){for(let l=0;l{r.delete(l),r.size===0&&n&&(n(),n=null)}}return{set:s,update:a,subscribe:i}}function Va(e){let t;return Cr(e,n=>t=n)(),t}function Rr(){return d===null&&Rn(),(d.ac??=new AbortController).signal}function pn(e){p===null&&he(),Se&&p.l!==null?vt(p).m.push(e):nr(()=>{const t=se(e);if(typeof t=="function")return t})}function Or(e){p===null&&he(),pn(()=>()=>se(e))}function Nr(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function Pr(){const e=p;return e===null&&he(),(t,n,r)=>{const s=e.s.$$events?.[t];if(s){const a=Je(s)?s.slice():[s],i=Nr(t,n,r);for(const f of a)f.call(e.x,i);return!i.defaultPrevented}return!0}}function Dr(e){p===null&&he(),p.l===null&&Ot(),vt(p).b.push(e)}function Ir(e){p===null&&he(),p.l===null&&Ot(),vt(p).a.push(e)}function vt(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}const Ya=Object.freeze(Object.defineProperty({__proto__:null,afterUpdate:Ir,beforeUpdate:Dr,createEventDispatcher:Pr,createRawSnippet:kr,flushSync:$t,getAbortSignal:Rr,getAllContexts:jn,getContext:Ln,hasContext:qn,hydrate:Ar,mount:dn,onDestroy:Or,onMount:pn,setContext:Fn,settled:hr,tick:dr,unmount:Sr,untrack:se},Symbol.toStringTag,{value:"Module"}));export{er as $,Or as A,La as B,Ia as C,Ma as D,Pr as E,wa as F,Qt as G,jt as H,ja as I,Va as J,g as K,ut as L,sr as M,Ct as N,z as O,ir as P,y as Q,ha as R,Z as S,w as T,fr as U,ke as V,Ra as W,He as X,I as Y,A as Z,ra as _,ga as a,Qr as a$,Mn as a0,na as a1,fe as a2,me as a3,Pt as a4,Le as a5,ct as a6,yn as a7,Je as a8,Hr as a9,Gr as aA,ye as aB,de as aC,Kr as aD,Se as aE,zr as aF,Wr as aG,oa as aH,G as aI,Xr as aJ,pe as aK,Fr as aL,Mr as aM,Ar as aN,dn as aO,$t as aP,Sr as aQ,$ as aR,dr as aS,ua as aT,aa as aU,It as aV,lr as aW,je as aX,oe as aY,N as aZ,_t as a_,ma as aa,Yr as ab,Br as ac,W as ad,re as ae,M as af,rn as ag,Kt as ah,or as ai,h as aj,Ur as ak,$r as al,p as am,pa as an,nr as ao,Lr as ap,St as aq,ft as ar,sa as as,E as at,Ne as au,Cr as av,Zt as aw,$e as ax,be as ay,Vr as az,va as b,ca as b0,Zn as b1,Zr as b2,At as b3,Jr as b4,gn as b5,xa as b6,Er as b7,Na as b8,ka as b9,Sa as ba,ia as bb,mr as bc,qr as bd,Aa as be,Ya as bf,Fa as c,Yn as d,Oa as e,Da as f,K as g,Pa as h,gt as i,_a as j,da as k,ya as l,la as m,Ta as n,pn as o,Vn as p,Kn as q,ea as r,j as s,ba as t,se as u,qa as v,Ca as w,Ea as x,fa as y,ta as z}; diff --git a/webapp/assets/_app/immutable/chunks/DDhBTdDt.js b/webapp/assets/_app/immutable/chunks/DDhBTdDt.js new file mode 100644 index 00000000..7f2ab6df --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/DDhBTdDt.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as U}from"./B3Pzt0F_.js";import{f as I,j as t,k as p,r as a,t as P,v as b,c as u,z as N,D as A,p as W,u as z,n as H,d as X}from"./D8EpLgQ1.js";import{p as s,i as T}from"./5WA7h8uK.js";import{s as Y,h as Z,B as F,c as $}from"./CiE1LlKV.js";import{b as ee}from"./CoIRRsD9.js";import{D as te,G as ae,a as se}from"./C9DJVOi1.js";import{E as ne}from"./B7ITzBt8.js";import{S as B}from"./BE4wujub.js";var le=I('
                '),ie=I('
                '),re=I('

                ');function ye(L,e){let n=s(e,"title",8),S=s(e,"subtitle",8),_=s(e,"forgeIcon",8,""),f=s(e,"onEdit",8,null),h=s(e,"onDelete",8,null),k=s(e,"editLabel",8,"Edit"),j=s(e,"deleteLabel",8,"Delete"),g=s(e,"titleClass",8,"");var c=re(),v=t(c),m=t(v),y=t(m),C=t(y);{var E=i=>{var r=le(),w=t(r);Z(w,_),a(r),u(i,r)};T(C,i=>{_()&&i(E)})}var l=p(C,2),D=t(l),G=t(D,!0);a(D);var M=p(D,2),V=t(M,!0);a(M),a(l),a(y);var R=p(y,2);{var q=i=>{var r=ie(),w=t(r);{var J=o=>{F(o,{variant:"secondary",size:"md",icon:"",$$events:{click(...d){f()?.apply(this,d)}},children:(d,Q)=>{N();var x=A();P(()=>b(x,k())),u(d,x)},$$slots:{default:!0}})};T(w,o=>{f()&&o(J)})}var K=p(w,2);{var O=o=>{F(o,{variant:"danger",size:"md",icon:"",$$events:{click(...d){h()?.apply(this,d)}},children:(d,Q)=>{N();var x=A();P(()=>b(x,j())),u(d,x)},$$slots:{default:!0}})};T(K,o=>{h()&&o(O)})}a(r),u(i,r)};T(R,i=>{(f()||h())&&i(q)})}a(m),a(v),a(c),P(()=>{Y(D,1,`text-2xl font-bold text-gray-900 dark:text-white ${g()??""}`),b(G,n()),b(V,S())}),u(L,c)}var oe=I('');function xe(L,e){W(e,!1);let n=s(e,"instances",8),S=s(e,"entityType",8),_=s(e,"onDeleteInstance",8);const f=[{key:"name",title:"Name",cellComponent:ne,cellProps:{entityType:"instance",nameField:"name"}},{key:"status",title:"Status",cellComponent:B,cellProps:{statusType:"instance",statusField:"status"}},{key:"runner_status",title:"Runner Status",cellComponent:B,cellProps:{statusType:"instance",statusField:"runner_status"}},{key:"created",title:"Created",cellComponent:ae,cellProps:{field:"created_at",type:"date"}},{key:"actions",title:"Actions",align:"right",cellComponent:se,cellProps:{actions:[{type:"delete",label:"Delete",title:"Delete instance",ariaLabel:"Delete instance",action:"delete"}]}}],h={entityType:"instance",primaryText:{field:"name",isClickable:!0,href:"/instances/{name}"},secondaryText:{field:"provider_id"},badges:[{type:"status",field:"status"}],actions:[{type:"delete",handler:l=>k(l)}]};function k(l){_()(l)}function j(l){k(l.detail.item)}U();var g=oe(),c=t(g),v=t(c),m=t(v),y=t(m);a(m);var C=p(m,2);a(v);var E=p(v,2);te(E,{get columns(){return f},get data(){return n()},loading:!1,error:"",searchTerm:"",showSearch:!1,showPagination:!1,currentPage:1,get perPage(){return H(n()),z(()=>n().length)},totalPages:1,get totalItems(){return H(n()),z(()=>n().length)},itemName:"instances",emptyTitle:"No instances running",get emptyMessage(){return`No instances running for this ${S()??""}.`},emptyIconType:"cog",get mobileCardConfig(){return h},$$events:{delete:j}}),a(c),a(g),P(()=>{b(y,`Instances (${H(n()),z(()=>n().length)??""})`),$(C,"href",`${ee}/instances`)}),u(L,g),X()}export{ye as D,xe as I}; diff --git a/webapp/assets/_app/immutable/chunks/DQP15tlf.js b/webapp/assets/_app/immutable/chunks/DQP15tlf.js new file mode 100644 index 00000000..73a0c7e8 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/DQP15tlf.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as cr}from"./B3Pzt0F_.js";import{p as pr,E as vr,m as u,o as fr,s as n,f as E,j as d,r as t,k as a,g as e,t as _,x as He,u as h,z as mr,n as D,v as k,e as w,c as m,D as yr,d as xr}from"./D8EpLgQ1.js";import{p as _r,i as ge,s as hr,a as kr}from"./5WA7h8uK.js";import{e as wr,i as Er}from"./u94nIB4-.js";import{r as c,b as Ke,c as Rr}from"./CiE1LlKV.js";import{b as p,a as $r}from"./C6k1Q4We.js";import{p as Sr}from"./D4Caz1gY.js";import{M as Tr}from"./qB7B8uiS.js";import{J as Or}from"./DZblzgqm.js";import{e as Pr}from"./wyaP0EDu.js";var Jr=E('

                '),Mr=E(' '),Nr=E('
                '),Ur=E('
                Updating...
                '),Ar=E('

                Pool Information (Read-only)

                Provider:
                Entity:

                Image & OS Configuration

                Runner Limits & Timing

                Advanced Settings

                Tags
                Extra Specs (JSON)
                ');function Wr(We,ce){pr(ce,!1);const[qe,Qe]=hr(),B=()=>kr(Pr,"$eagerCache",qe);let o=_r(ce,"pool",8);const G=vr();let R=u(!1),$=u(""),S=u(o().image||""),T=u(o().flavor||""),O=u(o().max_runners),P=u(o().min_idle_runners),J=u(o().runner_bootstrap_timeout),M=u(o().priority),N=u(o().runner_prefix||""),y=u(o().os_type||"linux"),x=u(o().os_arch||"amd64"),U=u(o()["github-runner-group"]||""),A=u(o().enabled),g=u((o().tags||[]).map(i=>i.name||"").filter(Boolean)),f=u(""),v=u("{}");function Ve(i){if(i.repo_id){const s=B().repositories.find(l=>l.id===i.repo_id);return s?`${s.owner}/${s.name}`:"Unknown Entity"}if(i.org_id){const s=B().organizations.find(l=>l.id===i.org_id);return s&&s.name?s.name:"Unknown Entity"}if(i.enterprise_id){const s=B().enterprises.find(l=>l.id===i.enterprise_id);return s&&s.name?s.name:"Unknown Entity"}return"Unknown Entity"}function Xe(i){return i.repo_id?"Repository":i.org_id?"Organization":i.enterprise_id?"Enterprise":"Unknown"}fr(()=>{if(o().extra_specs)try{if(typeof o().extra_specs=="object")n(v,JSON.stringify(o().extra_specs,null,2));else{const i=JSON.parse(o().extra_specs);n(v,JSON.stringify(i,null,2))}}catch{n(v,o().extra_specs||"{}")}});function pe(){e(f).trim()&&!e(g).includes(e(f).trim())&&(n(g,[...e(g),e(f).trim()]),n(f,""))}function Ye(i){n(g,e(g).filter((s,l)=>l!==i))}function Ze(i){i.key==="Enter"&&(i.preventDefault(),pe())}async function er(){try{n(R,!0),n($,"");let i={};if(e(v).trim())try{i=JSON.parse(e(v))}catch{throw new Error("Invalid JSON in extra specs")}const s={image:e(S)!==o().image?e(S):void 0,flavor:e(T)!==o().flavor?e(T):void 0,max_runners:e(O)!==o().max_runners?e(O):void 0,min_idle_runners:e(P)!==o().min_idle_runners?e(P):void 0,runner_bootstrap_timeout:e(J)!==o().runner_bootstrap_timeout?e(J):void 0,priority:e(M)!==o().priority?e(M):void 0,runner_prefix:e(N)!==o().runner_prefix?e(N):void 0,os_type:e(y)!==o().os_type?e(y):void 0,os_arch:e(x)!==o().os_arch?e(x):void 0,"github-runner-group":e(U)!==o()["github-runner-group"]&&e(U)||void 0,enabled:e(A)!==o().enabled?e(A):void 0,tags:JSON.stringify(e(g))!==JSON.stringify((o().tags||[]).map(l=>l.name||"").filter(Boolean))?e(g):void 0,extra_specs:e(v).trim()!==JSON.stringify(o().extra_specs||{},null,2).trim()?i:void 0};Object.keys(s).forEach(l=>{s[l]===void 0&&delete s[l]}),G("submit",s)}catch(i){n($,i instanceof Error?i.message:"Failed to update pool")}finally{n(R,!1)}}cr(),Tr(We,{$$events:{close:()=>G("close")},children:(i,s)=>{var l=Ar(),z=d(l),ve=d(z),rr=d(ve);t(ve),t(z);var L=a(z,2),fe=d(L);{var tr=r=>{var b=Jr(),j=d(b),C=d(j,!0);t(j),t(b),_(()=>k(C,e($))),m(r,b)};ge(fe,r=>{e($)&&r(tr)})}var F=a(fe,2),me=a(d(F),2),H=d(me),ye=a(d(H),2),ar=d(ye,!0);t(ye),t(H);var xe=a(H,2),_e=a(d(xe),2),dr=d(_e);t(_e),t(xe),t(me),t(F);var K=a(F,2),he=a(d(K),2),W=d(he),ke=a(d(W),2);c(ke),t(W);var q=a(W,2),we=a(d(q),2);c(we),t(q);var Q=a(q,2),V=a(d(Q),2);_(()=>{e(y),He(()=>{})});var X=d(V);X.value=X.__value="linux";var Ee=a(X);Ee.value=Ee.__value="windows",t(V),t(Q);var Re=a(Q,2),Y=a(d(Re),2);_(()=>{e(x),He(()=>{})});var Z=d(Y);Z.value=Z.__value="amd64";var $e=a(Z);$e.value=$e.__value="arm64",t(Y),t(Re),t(he),t(K);var ee=a(K,2),Se=a(d(ee),2),re=d(Se),Te=a(d(re),2);c(Te),t(re);var te=a(re,2),Oe=a(d(te),2);c(Oe),t(te);var Pe=a(te,2),Je=a(d(Pe),2);c(Je),t(Pe),t(Se),t(ee);var ae=a(ee,2),de=a(d(ae),2),oe=d(de),Me=a(d(oe),2);c(Me),t(oe);var ie=a(oe,2),Ne=a(d(ie),2);c(Ne),t(ie);var Ue=a(ie,2),Ae=a(d(Ue),2);c(Ae),t(Ue),t(de);var ne=a(de,2),Ie=d(ne),je=a(d(Ie),2),se=d(je),I=d(se);c(I);var or=a(I,2);t(se);var ir=a(se,2);{var nr=r=>{var b=Nr();wr(b,5,()=>e(g),Er,(j,C,gr)=>{var be=Mr(),Le=d(be),Fe=a(Le);t(be),_(()=>{k(Le,`${e(C)??""} `),Rr(Fe,"aria-label",`Remove tag ${e(C)??""}`)}),w("click",Fe,()=>Ye(gr)),m(j,be)}),t(b),m(r,b)};ge(ir,r=>{e(g),h(()=>e(g).length>0)&&r(nr)})}t(je),t(Ie),t(ne);var le=a(ne,2),Ce=d(le),sr=a(d(Ce),2);Or(sr,{rows:4,placeholder:"{}",get value(){return e(v)},set value(r){n(v,r)},$$legacy:!0}),t(Ce),t(le);var De=a(le,2),Be=d(De);c(Be),mr(2),t(De),t(ae);var Ge=a(ae,2),ze=d(Ge),ue=a(ze,2),lr=d(ue);{var ur=r=>{var b=Ur();m(r,b)},br=r=>{var b=yr("Update Pool");m(r,b)};ge(lr,r=>{e(R)?r(ur):r(br,!1)})}t(ue),t(Ge),t(L),t(l),_((r,b)=>{k(rr,`Update Pool ${D(o()),h(()=>o().id)??""}`),k(ar,(D(o()),h(()=>o().provider_name))),k(dr,`${r??""}: ${b??""}`),ue.disabled=e(R)},[()=>(D(o()),h(()=>Xe(o()))),()=>(D(o()),h(()=>Ve(o())))]),p(ke,()=>e(S),r=>n(S,r)),p(we,()=>e(T),r=>n(T,r)),Ke(V,()=>e(y),r=>n(y,r)),Ke(Y,()=>e(x),r=>n(x,r)),p(Te,()=>e(P),r=>n(P,r)),p(Oe,()=>e(O),r=>n(O,r)),p(Je,()=>e(J),r=>n(J,r)),p(Me,()=>e(N),r=>n(N,r)),p(Ne,()=>e(M),r=>n(M,r)),p(Ae,()=>e(U),r=>n(U,r)),p(I,()=>e(f),r=>n(f,r)),w("keydown",I,Ze),w("click",or,pe),$r(Be,()=>e(A),r=>n(A,r)),w("click",ze,()=>G("close")),w("submit",L,Sr(er)),m(i,l)},$$slots:{default:!0}}),xr(),Qe()}export{Wr as U}; diff --git a/webapp/assets/_app/immutable/chunks/DZblzgqm.js b/webapp/assets/_app/immutable/chunks/DZblzgqm.js new file mode 100644 index 00000000..3b77c940 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/DZblzgqm.js @@ -0,0 +1,4 @@ +import"./DsnmJJEf.js";import{i as g}from"./B3Pzt0F_.js";import{p as k,l as x,s as d,m as w,n as y,a as J,f as m,j as z,w as j,k as L,g as c,r as B,t as C,c as n,d as E}from"./D8EpLgQ1.js";import{p as o,i as M}from"./5WA7h8uK.js";import{c as f,s as N}from"./CiE1LlKV.js";import{b as O}from"./C6k1Q4We.js";var S=m('
                '),V=m('
                ');function I(p,r){k(r,!1);let t=o(r,"value",12,""),u=o(r,"placeholder",8,"{}"),b=o(r,"rows",8,4),i=o(r,"disabled",8,!1),a=w(!0);x(()=>y(t()),()=>{if(t().trim())try{JSON.parse(t()),d(a,!0)}catch{d(a,!1)}else d(a,!0)}),J(),g();var l=V(),e=z(l);j(e);var v=L(e,2);{var h=s=>{var _=S();n(s,_)};M(v,s=>{c(a)||s(h)})}B(l),C(()=>{f(e,"placeholder",u()),f(e,"rows",b()),e.disabled=i(),N(e,1,`w-full px-3 py-2 border rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 font-mono text-sm resize-none + ${c(a)?"border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-900 dark:text-white":"border-red-300 dark:border-red-600 bg-red-50 dark:bg-red-900/20 text-red-900 dark:text-red-100"} + ${i()?"opacity-50 cursor-not-allowed":""} + `)}),O(e,t),n(p,l),E()}export{I as J}; diff --git a/webapp/assets/_app/immutable/chunks/Dbd6PPbz.js b/webapp/assets/_app/immutable/chunks/Dbd6PPbz.js new file mode 100644 index 00000000..cca64cf0 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/Dbd6PPbz.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as ae}from"./B3Pzt0F_.js";import{p as se,E as re,l as P,n as ie,s as r,g as t,m as k,a as le,f as p,j as v,k as U,r as f,c as l,d as oe,B as T,b as $,z as V,D as q,t as E,v as N,u as ne}from"./D8EpLgQ1.js";import{p as R,i as m}from"./5WA7h8uK.js";import{g as u,B as G}from"./CiE1LlKV.js";import{t as y}from"./BEkVdVE1.js";var de=p('
                Checking...
                '),ce=p('
                '),ve=p('
                Webhook installed
                ',1),fe=p('
                No webhook installed
                '),ue=p('

                Webhook Status

                ');function ye(H,g){se(g,!1);const x=k();let h=R(g,"entityType",8),s=R(g,"entityId",8),j=R(g,"entityName",8),i=k(null),o=k(!1),b=k(!0);const O=re();async function _(){if(s())try{r(b,!0),h()==="repository"?r(i,await u.getRepositoryWebhookInfo(s())):r(i,await u.getOrganizationWebhookInfo(s()))}catch(e){e&&typeof e=="object"&&"response"in e&&e.response?.status===404?r(i,null):(console.warn("Failed to check webhook status:",e),r(i,null))}finally{r(b,!1)}}async function J(){if(s())try{r(o,!0),h()==="repository"?await u.installRepositoryWebhook(s()):await u.installOrganizationWebhook(s()),y.success("Webhook Installed",`Webhook for ${h()} ${j()} has been installed successfully.`),await _(),O("webhookStatusChanged",{installed:!0})}catch(e){y.error("Webhook Installation Failed",e instanceof Error?e.message:"Failed to install webhook.")}finally{r(o,!1)}}async function K(){if(s())try{r(o,!0),h()==="repository"?await u.uninstallRepositoryWebhook(s()):await u.uninstallOrganizationWebhook(s()),y.success("Webhook Uninstalled",`Webhook for ${h()} ${j()} has been uninstalled successfully.`),await _(),O("webhookStatusChanged",{installed:!1})}catch(e){y.error("Webhook Uninstall Failed",e instanceof Error?e.message:"Failed to uninstall webhook.")}finally{r(o,!1)}}P(()=>ie(s()),()=>{s()&&_()}),P(()=>t(i),()=>{r(x,t(i)&&t(i).active)}),le(),ae();var w=ue(),A=v(w),D=v(A),W=v(D),L=U(v(W),2),Q=v(L);{var X=e=>{var d=de();l(e,d)},Y=e=>{var d=T(),z=$(d);{var I=a=>{var n=ve(),B=U($(n),2);{var c=C=>{var F=ce(),te=v(F);f(F),E(()=>N(te,`URL: ${t(i),ne(()=>t(i).url||"N/A")??""}`)),l(C,F)};m(B,C=>{t(i)&&C(c)})}l(a,n)},S=a=>{var n=fe();l(a,n)};m(z,a=>{t(x)?a(I):a(S,!1)},!0)}l(e,d)};m(Q,e=>{t(b)?e(X):e(Y,!1)})}f(L),f(W);var M=U(W,2),Z=v(M);{var ee=e=>{var d=T(),z=$(d);{var I=a=>{G(a,{variant:"danger",size:"sm",get disabled(){return t(o)},$$events:{click:K},children:(n,B)=>{V();var c=q();E(()=>N(c,t(o)?"Uninstalling...":"Uninstall")),l(n,c)},$$slots:{default:!0}})},S=a=>{G(a,{variant:"primary",size:"sm",get disabled(){return t(o)},$$events:{click:J},children:(n,B)=>{V();var c=q();E(()=>N(c,t(o)?"Installing...":"Install Webhook")),l(n,c)},$$slots:{default:!0}})};m(z,a=>{t(x)?a(I):a(S,!1)})}l(e,d)};m(Z,e=>{t(b)||e(ee)})}f(M),f(D),f(A),f(w),l(H,w),oe()}export{ye as W}; diff --git a/webapp/assets/_app/immutable/chunks/DsnmJJEf.js b/webapp/assets/_app/immutable/chunks/DsnmJJEf.js new file mode 100644 index 00000000..ca27dc73 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/DsnmJJEf.js @@ -0,0 +1 @@ +typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5"); diff --git a/webapp/assets/_app/immutable/chunks/KQ2xQpA3.js b/webapp/assets/_app/immutable/chunks/KQ2xQpA3.js new file mode 100644 index 00000000..c94aef62 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/KQ2xQpA3.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as q}from"./B3Pzt0F_.js";import{p as A,E as F,f as y,k as l,j as e,r as a,z as $,D as b,c as o,t as p,v as n,d as G}from"./D8EpLgQ1.js";import{p as v,i as H}from"./5WA7h8uK.js";import{M as I}from"./qB7B8uiS.js";import{B as w}from"./CiE1LlKV.js";var J=y('

                '),K=y('

                ');function W(D,s){A(s,!1);let j=v(s,"title",8),M=v(s,"message",8),g=v(s,"itemName",8,""),d=v(s,"loading",8,!1);const c=F();function B(){c("confirm")}q(),I(D,{$$events:{close:()=>c("close")},children:(C,O)=>{var m=K(),f=l(e(m),2),u=e(f),P=e(u,!0);a(u);var h=l(u,2),x=e(h),z=e(x,!0);a(x);var E=l(x,2);{var L=t=>{var i=J(),r=e(i,!0);a(i),p(()=>n(r,g())),o(t,i)};H(E,t=>{g()&&t(L)})}a(h),a(f);var _=l(f,2),k=e(_);w(k,{variant:"secondary",get disabled(){return d()},$$events:{click:()=>c("close")},children:(t,i)=>{$();var r=b("Cancel");o(t,r)},$$slots:{default:!0}});var N=l(k,2);w(N,{variant:"danger",get disabled(){return d()},get loading(){return d()},$$events:{click:B},children:(t,i)=>{$();var r=b();p(()=>n(r,d()?"Deleting...":"Delete")),o(t,r)},$$slots:{default:!0}}),a(_),a(m),p(()=>{n(P,j()),n(z,M())}),o(C,m)},$$slots:{default:!0}}),G()}export{W as D}; diff --git a/webapp/assets/_app/immutable/chunks/duD3WMbl.js b/webapp/assets/_app/immutable/chunks/duD3WMbl.js new file mode 100644 index 00000000..50fdf414 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/duD3WMbl.js @@ -0,0 +1 @@ +import{I as w}from"./D8EpLgQ1.js";import{g as r}from"./CiE1LlKV.js";const m=!0,z=m,I=()=>window.location.port==="5173",b={isAuthenticated:!1,user:null,loading:!0,needsInitialization:!1},n=w(b);function f(t,a,e=7){const i=new Date;i.setTime(i.getTime()+e*24*60*60*1e3),document.cookie=`${t}=${a};expires=${i.toUTCString()};path=/;SameSite=Lax`}function d(t){const a=t+"=",e=document.cookie.split(";");for(let i=0;i({...i,loading:!0}));const e=await r.login({username:t,password:a});z&&(f("garm_token",e.token),f("garm_user",t)),r.setToken(e.token),n.set({isAuthenticated:!0,user:t,loading:!1,needsInitialization:!1})}catch(e){throw n.update(i=>({...i,loading:!1})),e}},logout(){g("garm_token"),g("garm_user"),n.set({isAuthenticated:!1,user:null,loading:!1,needsInitialization:!1})},async init(){try{n.update(e=>({...e,loading:!0})),await c.checkInitializationStatus();const t=d("garm_token"),a=d("garm_user");if(t&&a&&(r.setToken(t),await c.checkAuth())){n.set({isAuthenticated:!0,user:a,loading:!1,needsInitialization:!1});return}n.update(e=>({...e,loading:!1,needsInitialization:!1}))}catch{n.update(a=>({...a,loading:!1}))}},async checkInitializationStatus(){try{const t={Accept:"application/json"},a=d("garm_token"),e=I();e&&a&&(t.Authorization=`Bearer ${a}`);const i=await fetch("/api/v1/login",{method:"GET",headers:t,credentials:e?"omit":"include"});if(!i.ok){if(i.status===409&&(await i.json()).error==="init_required")throw n.update(s=>({...s,needsInitialization:!0,loading:!1})),new Error("Initialization required");return}return}catch(t){if(t instanceof Error&&t.message==="Initialization required")throw t;return}},async checkAuth(){try{return await c.checkInitializationStatus(),await r.getControllerInfo(),!0}catch(t){return t instanceof Error&&t.message==="Initialization required"?!1:t?.response?.status===409&&t?.response?.data?.error==="init_required"?(n.update(a=>({...a,needsInitialization:!0,loading:!1})),!1):(c.logout(),!1)}},async initialize(t,a,e,i,o){try{n.update(u=>({...u,loading:!0}));const s=await r.firstRun({username:t,email:a,password:e,full_name:i||t});await c.login(t,e);const l=window.location.origin,h=o?.metadataUrl||`${l}/api/v1/metadata`,p=o?.callbackUrl||`${l}/api/v1/callbacks`,k=o?.webhookUrl||`${l}/webhooks`;await r.updateController({metadata_url:h,callback_url:p,webhook_url:k}),n.update(u=>({...u,needsInitialization:!1}))}catch(s){throw n.update(l=>({...l,loading:!1})),s}}};export{n as a,c as b}; diff --git a/webapp/assets/_app/immutable/chunks/ow_oMtSd.js b/webapp/assets/_app/immutable/chunks/ow_oMtSd.js new file mode 100644 index 00000000..a2bd2eaf --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/ow_oMtSd.js @@ -0,0 +1 @@ +function a(e){return e?e.replace(/_/g," ").toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" "):""}function g(e){if(!e)return"bg-gray-50 text-gray-700 ring-gray-600/20 dark:bg-gray-500/10 dark:text-gray-400 dark:ring-gray-500/20";switch(e.toLowerCase()){case"running":case"online":return"bg-green-50 text-green-700 ring-green-600/20 dark:bg-green-500/10 dark:text-green-400 dark:ring-green-500/20";case"idle":case"stopped":return"bg-blue-50 text-blue-700 ring-blue-600/20 dark:bg-blue-500/10 dark:text-blue-400 dark:ring-blue-500/20";case"active":return"bg-yellow-50 text-yellow-700 ring-yellow-600/20 dark:bg-yellow-500/10 dark:text-yellow-400 dark:ring-yellow-500/20";case"creating":case"installing":case"pending_create":case"provisioning":return"bg-purple-50 text-purple-700 ring-purple-600/20 dark:bg-purple-500/10 dark:text-purple-400 dark:ring-purple-500/20 animate-pulse";case"deleting":case"terminating":case"pending_delete":case"destroying":return"bg-orange-50 text-orange-700 ring-orange-600/20 dark:bg-orange-500/10 dark:text-orange-400 dark:ring-orange-500/20 animate-pulse";case"failed":case"error":case"terminated":case"offline":return"bg-red-50 text-red-700 ring-red-600/20 dark:bg-red-500/10 dark:text-red-400 dark:ring-red-500/20";case"pending":case"unknown":return"bg-gray-50 text-gray-700 ring-gray-600/20 dark:bg-gray-500/10 dark:text-gray-400 dark:ring-gray-500/20 animate-pulse";default:return"bg-gray-50 text-gray-700 ring-gray-600/20 dark:bg-gray-500/10 dark:text-gray-400 dark:ring-gray-500/20"}}export{a as f,g}; diff --git a/webapp/assets/_app/immutable/chunks/qB7B8uiS.js b/webapp/assets/_app/immutable/chunks/qB7B8uiS.js new file mode 100644 index 00000000..b4282e10 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/qB7B8uiS.js @@ -0,0 +1 @@ +import"./DsnmJJEf.js";import{i as u}from"./B3Pzt0F_.js";import{p as v,E as m,f as h,j as r,r as d,e as t,c as k,d as g}from"./D8EpLgQ1.js";import{d as b}from"./CiE1LlKV.js";var w=h('');function j(s,i){v(i,!1);const l=m();function n(){l("close")}function c(o){o.stopPropagation()}function f(o){o.key==="Escape"&&l("close")}u();var a=w(),e=r(a),p=r(e);b(p,i,"default",{}),d(e),d(a),t("click",e,c),t("click",a,n),t("keydown",a,f),k(s,a),g()}export{j as M}; diff --git a/webapp/assets/_app/immutable/chunks/u94nIB4-.js b/webapp/assets/_app/immutable/chunks/u94nIB4-.js new file mode 100644 index 00000000..0d15509c --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/u94nIB4-.js @@ -0,0 +1 @@ +import{O as K,M as te,Y as F,K as M,Z as ae,L as re,g as $,q as oe,_ as ie,a0 as se,a1 as J,a2 as G,T as L,a3 as le,a4 as ce,P as q,R as fe,Q as ue,a5 as V,m as de,a6 as B,a7 as Q,a8 as ve,a9 as D,aa as X,U as he,ab as R,ac as Se,ad as P,ae as Z,af as me,ag as _e,ah as we,ai as Ee,aj as pe,ak as z,H as be,al as ge,I as Ie}from"./D8EpLgQ1.js";function Te(c,o){return o}function Ne(c,o,n){for(var t=c.items,u=[],S=o.length,s=0;s0&&u.length===0&&n!==null;if(d){var N=n.parentNode;we(N),N.append(n),t.clear(),T(c,o[0].prev,o[S-1].next)}Ee(u,()=>{for(var m=0;m{var _=n();return ve(_)?_:_==null?[]:Q(_)}),r,v;function f(){ke(v,r,d,E,s,u,o,t,n),S!==null&&(r.length===0?i?X(i):i=q(()=>S(s)):i!==null&&he(i,()=>{i=null}))}te(()=>{v??=pe,r=$(x);var _=r.length;if(g&&_===0)return;g=_===0;let p=!1;if(M){var k=ie(s)===se;k!==(_===0)&&(s=J(),F(s),G(!1),p=!0)}if(M){for(var C=null,b,e=0;e<_;e++){if(L.nodeType===le&&L.data===ce){s=L,p=!0,G(!1);break}var a=r[e],l=t(a,e);b=Y(L,d,C,null,a,l,e,u,o,n),d.items.set(l,b),C=b}_>0&&F(J())}if(M)_===0&&S&&(i=q(()=>S(s)));else if(fe()){var w=new Set,O=ue;for(e=0;e<_;e+=1){a=r[e],l=t(a,e);var h=d.items.get(l)??E.get(l);h?(o&(R|D))!==0&&j(h,a,e,o):(b=Y(null,d,null,null,a,l,e,u,o,n,!0),E.set(l,b)),w.add(l)}for(const[I,W]of d.items)w.has(I)||O.skipped_effects.add(W.e);O.add_callback(f)}else f();p&&G(!0),$(x)}),M&&(s=L)}function ke(c,o,n,t,u,S,s,d,N){var m=(s&ge)!==0,i=(s&(R|D))!==0,g=o.length,E=n.items,x=n.first,r=x,v,f=null,_,p=[],k=[],C,b,e,a;if(m)for(a=0;a0){var ee=(s&z)!==0&&g===0?u:null;if(m){for(a=0;a{if(_!==void 0)for(e of _)e.a?.apply()}),c.first=n.first&&n.first.e,c.last=f&&f.e;for(var ne of t.values())Z(ne.e);t.clear()}function j(c,o,n,t){(t&R)!==0&&V(c.v,o),(t&D)!==0?V(c.i,n):c.i=n}function Y(c,o,n,t,u,S,s,d,N,m,i){var g=(N&R)!==0,E=(N&Se)===0,x=g?E?de(u,!1,!1):B(u):u,r=(N&D)===0?s:B(s),v={i:r,v:x,k:S,a:null,e:null,prev:n,next:t};try{if(c===null){var f=document.createDocumentFragment();f.append(c=K())}return v.e=q(()=>d(c,x,r,m),M),v.e.prev=n&&n.e,v.e.next=t&&t.e,n===null?i||(o.first=v):(n.next=v,n.e.next=v.e),t!==null&&(t.prev=v,t.e.prev=v.e),v}finally{}}function U(c,o,n){for(var t=c.next?c.next.e.nodes_start:n,u=o?o.e.nodes_start:n,S=c.e.nodes_start;S!==null&&S!==t;){var s=me(S);u.before(S),S=s}}function T(c,o,n){o===null?c.first=n:(o.next=n,o.e.next=n&&n.e),n!==null&&(n.prev=o,n.e.prev=o&&o.e)}function Ce(){const{subscribe:c,set:o,update:n}=Ie({connected:!1,connecting:!1,error:null,lastEvent:null});let t=null,u=0,S=50,s=1e3,d=1e3,N=3e4,m=null,i=[],g=!1;const E=new Map;function x(){const e=window.location.protocol==="https:"?"wss:":"ws:",a=window.location.host;return`${e}//${a}/api/v1/ws/events`}function r(){if(!(t&&(t.readyState===WebSocket.CONNECTING||t.readyState===WebSocket.OPEN))){g=!1,n(e=>({...e,connecting:!0,error:null}));try{const e=x();t=new WebSocket(e);const a=setTimeout(()=>{t&&t.readyState===WebSocket.CONNECTING&&t.close()},1e4);t.onopen=()=>{clearTimeout(a),u=0,d=s,n(l=>({...l,connected:!0,connecting:!1,error:null})),i.length>0&&p(i)},t.onmessage=l=>{try{const w=JSON.parse(l.data);n(h=>({...h,lastEvent:w})),(E.get(w["entity-type"])||[]).forEach(h=>{try{h(w)}catch(I){console.error("[WebSocket] Error in event callback:",I)}})}catch(w){console.error("[WebSocket] Error parsing message:",w)}},t.onclose=l=>{clearTimeout(a);const w=l.code===1e3&&g,O=l.code!==1e3?`Connection closed: ${l.reason||"Unknown reason"}`:null;n(h=>({...h,connected:!1,connecting:!1,error:O})),w||_()},t.onerror=l=>{clearTimeout(a),n(w=>({...w,connected:!1,connecting:!1,error:"WebSocket connection error"})),g||_()}}catch(e){n(a=>({...a,connected:!1,connecting:!1,error:e instanceof Error?e.message:"Failed to connect"}))}}}function v(){}function f(){}function _(){if(g)return;m&&clearTimeout(m),u++,u>S&&(u=1,d=s);const e=Math.min(d,N);m=window.setTimeout(()=>{if(!g){r();const a=Math.random()*1e3;d=Math.min(d*1.5+a,N)}},e)}function p(e){if(t&&t.readyState===WebSocket.OPEN){const a={"send-everything":!1,filters:e};t.send(JSON.stringify(a)),i=[...e]}}function k(){g=!0,m&&(clearTimeout(m),m=null),t&&(t.close(1e3,"Manual disconnect"),t=null),E.clear(),i=[],n(e=>({...e,connected:!1,connecting:!1,error:null,lastEvent:null}))}function C(){navigator.onLine&&!g&&setTimeout(()=>{(!t||t.readyState===WebSocket.CLOSED||t.readyState===WebSocket.CLOSING)&&(u=0,d=s,r())},2e3)}typeof window<"u"&&(window.addEventListener("online",C),window.addEventListener("offline",()=>{n(e=>({...e,error:"Network offline"}))}),setInterval(()=>{g||(!t||t.readyState===WebSocket.CLOSED||t.readyState===WebSocket.CLOSING)&&r()},1e4));function b(e,a,l){E.has(e)||E.set(e,[]),E.get(e).push(l);const w=i.findIndex(h=>h["entity-type"]===e),O={"entity-type":e,operations:a};if(w>=0){const h=i[w].operations;O.operations=Array.from(new Set([...h,...a])),i[w]=O}else i.push(O);return t&&t.readyState===WebSocket.OPEN&&p(i),(!t||t.readyState===WebSocket.CLOSED||t.readyState===WebSocket.CLOSING)&&r(),()=>{const h=E.get(e);if(h){const I=h.indexOf(l);if(I>-1&&h.splice(I,1),h.length===0){E.delete(e);const W=i.findIndex(A=>A["entity-type"]===e);W>-1&&(i.splice(W,1),t&&t.readyState===WebSocket.OPEN&&p(i))}}}}return typeof window<"u"&&r(),{subscribe:c,connect:r,disconnect:k,subscribeToEntity:b}}const We=Ce();export{xe as e,Te as i,We as w}; diff --git a/webapp/assets/_app/immutable/chunks/wyaP0EDu.js b/webapp/assets/_app/immutable/chunks/wyaP0EDu.js new file mode 100644 index 00000000..7650f5b9 --- /dev/null +++ b/webapp/assets/_app/immutable/chunks/wyaP0EDu.js @@ -0,0 +1 @@ +import{I as p,J as l}from"./D8EpLgQ1.js";import{g as d}from"./CiE1LlKV.js";import{w as r}from"./u94nIB4-.js";const f={repositories:[],organizations:[],enterprises:[],pools:[],scalesets:[],credentials:[],endpoints:[],controllerInfo:null,loading:{repositories:!1,organizations:!1,enterprises:!1,pools:!1,scalesets:!1,credentials:!1,endpoints:!1,controllerInfo:!1},loaded:{repositories:!1,organizations:!1,enterprises:!1,pools:!1,scalesets:!1,credentials:!1,endpoints:!1,controllerInfo:!1},errorMessages:{repositories:"",organizations:"",enterprises:"",pools:"",scalesets:"",credentials:"",endpoints:"",controllerInfo:""}},a=p(f);class u{unsubscribers=[];loadingPromises=new Map;retryAttempts=new Map;MAX_RETRIES=3;RETRY_DELAY_MS=1e3;websocketStatusUnsubscriber=null;async loadResource(e,t=!1){if(this.loadingPromises.has(e))return this.loadingPromises.get(e);a.update(o=>({...o,loading:{...o.loading,[e]:!0},errorMessages:{...o.errorMessages,[e]:""}}));const s=this.attemptLoad(e);this.loadingPromises.set(e,s);try{const o=await s;return a.update(n=>({...n,[e]:o,loading:{...n.loading,[e]:!1},loaded:{...n.loaded,[e]:!0},errorMessages:{...n.errorMessages,[e]:""}})),this.retryAttempts.delete(e),t&&this.startBackgroundLoading(e),o}catch(o){const n=o instanceof Error?o.message:"Failed to load data";throw a.update(i=>({...i,loading:{...i.loading,[e]:!1},errorMessages:{...i.errorMessages,[e]:n}})),console.error(`Failed to load ${e}:`,o),o}finally{this.loadingPromises.delete(e)}}async attemptLoad(e){const t=(this.retryAttempts.get(e)||0)+1;this.retryAttempts.set(e,t);try{let s;switch(e){case"repositories":s=d.listRepositories();break;case"organizations":s=d.listOrganizations();break;case"enterprises":s=d.listEnterprises();break;case"pools":s=d.listAllPools();break;case"scalesets":s=d.listScaleSets();break;case"credentials":s=d.listAllCredentials();break;case"endpoints":s=d.listAllEndpoints();break;case"controllerInfo":s=d.getControllerInfo();break;default:throw new Error(`Unknown resource type: ${e}`)}return await s}catch(s){if(tsetTimeout(n,o)),this.attemptLoad(e)}else throw console.error(`All ${this.MAX_RETRIES} attempts failed for ${e}:`,s),s}}async startBackgroundLoading(e){const s=["repositories","organizations","enterprises","pools","scalesets","credentials","endpoints"].filter(o=>o!==e);for(const o of s)setTimeout(()=>{this.loadResource(o,!1).catch(n=>{console.warn(`Background loading failed for ${o}:`,n)})},100*s.indexOf(o))}retryResource(e){return this.retryAttempts.delete(e),this.loadResource(e,!0)}setupWebSocketSubscriptions(){this.cleanup();const e=[r.subscribeToEntity("repository",["create","update","delete"],this.handleRepositoryEvent.bind(this)),r.subscribeToEntity("organization",["create","update","delete"],this.handleOrganizationEvent.bind(this)),r.subscribeToEntity("enterprise",["create","update","delete"],this.handleEnterpriseEvent.bind(this)),r.subscribeToEntity("pool",["create","update","delete"],this.handlePoolEvent.bind(this)),r.subscribeToEntity("scaleset",["create","update","delete"],this.handleScaleSetEvent.bind(this)),r.subscribeToEntity("controller",["update"],this.handleControllerEvent.bind(this)),r.subscribeToEntity("github_credentials",["create","update","delete"],this.handleCredentialsEvent.bind(this)),r.subscribeToEntity("gitea_credentials",["create","update","delete"],this.handleCredentialsEvent.bind(this)),r.subscribeToEntity("github_endpoint",["create","update","delete"],this.handleEndpointEvent.bind(this))];this.unsubscribers=e,this.setupWebSocketStatusMonitoring()}setupWebSocketStatusMonitoring(){this.websocketStatusUnsubscriber&&this.websocketStatusUnsubscriber();let e=!1;this.websocketStatusUnsubscriber=r.subscribe(t=>{t.connected&&!e&&(console.log("[EagerCache] WebSocket connected - reinitializing cache"),this.initializeAllResources()),e=t.connected})}async initializeAllResources(){const t=["repositories","organizations","enterprises","pools","scalesets","credentials","endpoints","controllerInfo"].map(s=>this.loadResource(s,!0).catch(o=>{console.warn(`Failed to reload ${s} on WebSocket reconnect:`,o)}));await Promise.allSettled(t)}handleRepositoryEvent(e){a.update(t=>{if(!t.loaded.repositories)return t;const s=[...t.repositories],o=e.payload;if(e.operation==="create")s.push(o);else if(e.operation==="update"){const n=s.findIndex(i=>i.id===o.id);n!==-1&&(s[n]=o)}else if(e.operation==="delete"){const n=typeof o=="object"?o.id:o,i=s.findIndex(c=>c.id===n);i!==-1&&s.splice(i,1)}return{...t,repositories:s}})}handleOrganizationEvent(e){a.update(t=>{if(!t.loaded.organizations)return t;const s=[...t.organizations],o=e.payload;if(e.operation==="create")s.push(o);else if(e.operation==="update"){const n=s.findIndex(i=>i.id===o.id);n!==-1&&(s[n]=o)}else if(e.operation==="delete"){const n=typeof o=="object"?o.id:o,i=s.findIndex(c=>c.id===n);i!==-1&&s.splice(i,1)}return{...t,organizations:s}})}handleEnterpriseEvent(e){a.update(t=>{if(!t.loaded.enterprises)return t;const s=[...t.enterprises],o=e.payload;if(e.operation==="create")s.push(o);else if(e.operation==="update"){const n=s.findIndex(i=>i.id===o.id);n!==-1&&(s[n]=o)}else if(e.operation==="delete"){const n=typeof o=="object"?o.id:o,i=s.findIndex(c=>c.id===n);i!==-1&&s.splice(i,1)}return{...t,enterprises:s}})}handlePoolEvent(e){a.update(t=>{if(!t.loaded.pools)return t;const s=[...t.pools],o=e.payload;if(e.operation==="create")s.push(o);else if(e.operation==="update"){const n=s.findIndex(i=>i.id===o.id);n!==-1&&(s[n]=o)}else if(e.operation==="delete"){const n=typeof o=="object"?o.id:o,i=s.findIndex(c=>c.id===n);i!==-1&&s.splice(i,1)}return{...t,pools:s}})}handleScaleSetEvent(e){a.update(t=>{if(!t.loaded.scalesets)return t;const s=[...t.scalesets],o=e.payload;if(e.operation==="create")s.push(o);else if(e.operation==="update"){const n=s.findIndex(i=>i.id===o.id);n!==-1&&(s[n]=o)}else if(e.operation==="delete"){const n=typeof o=="object"?o.id:o,i=s.findIndex(c=>c.id===n);i!==-1&&s.splice(i,1)}return{...t,scalesets:s}})}handleCredentialsEvent(e){a.update(t=>{if(!t.loaded.credentials)return t;const s=[...t.credentials],o=e.payload;if(e.operation==="create")s.push(o);else if(e.operation==="update"){const n=s.findIndex(i=>i.id===o.id);n!==-1&&(s[n]=o)}else if(e.operation==="delete"){const n=typeof o=="object"?o.id:o,i=s.findIndex(c=>c.id===n);i!==-1&&s.splice(i,1)}return{...t,credentials:s}})}handleEndpointEvent(e){a.update(t=>{if(!t.loaded.endpoints)return t;const s=[...t.endpoints],o=e.payload;if(e.operation==="create")s.push(o);else if(e.operation==="update"){const n=s.findIndex(i=>i.name===o.name);n!==-1&&(s[n]=o)}else if(e.operation==="delete"){const n=typeof o=="object"?o.name:o,i=s.findIndex(c=>c.name===n);i!==-1&&s.splice(i,1)}return{...t,endpoints:s}})}cleanup(){this.unsubscribers.forEach(e=>e()),this.unsubscribers=[],this.websocketStatusUnsubscriber&&(this.websocketStatusUnsubscriber(),this.websocketStatusUnsubscriber=null)}shouldUseCache(){return l(r).connected}async getRepositories(){if(!l(r).connected)return console.log("[EagerCache] WebSocket disconnected - fetching repositories directly from API"),await d.listRepositories();const t=l(a);return t.loaded.repositories?t.repositories:this.loadResource("repositories",!0)}async getOrganizations(){if(!l(r).connected)return console.log("[EagerCache] WebSocket disconnected - fetching organizations directly from API"),await d.listOrganizations();const t=l(a);return t.loaded.organizations?t.organizations:this.loadResource("organizations",!0)}async getEnterprises(){if(!l(r).connected)return console.log("[EagerCache] WebSocket disconnected - fetching enterprises directly from API"),await d.listEnterprises();const t=l(a);return t.loaded.enterprises?t.enterprises:this.loadResource("enterprises",!0)}async getPools(){if(!l(r).connected)return console.log("[EagerCache] WebSocket disconnected - fetching pools directly from API"),await d.listAllPools();const t=l(a);return t.loaded.pools?t.pools:this.loadResource("pools",!0)}async getScaleSets(){if(!l(r).connected)return console.log("[EagerCache] WebSocket disconnected - fetching scalesets directly from API"),await d.listScaleSets();const t=l(a);return t.loaded.scalesets?t.scalesets:this.loadResource("scalesets",!0)}async getCredentials(){if(!l(r).connected)return console.log("[EagerCache] WebSocket disconnected - fetching credentials directly from API"),await d.listAllCredentials();const t=l(a);return t.loaded.credentials?t.credentials:this.loadResource("credentials",!0)}async getEndpoints(){if(!l(r).connected)return console.log("[EagerCache] WebSocket disconnected - fetching endpoints directly from API"),await d.listAllEndpoints();const t=l(a);return t.loaded.endpoints?t.endpoints:this.loadResource("endpoints",!0)}async getControllerInfo(){if(!l(r).connected)return console.log("[EagerCache] WebSocket disconnected - fetching controller info directly from API"),await d.getControllerInfo();const t=l(a);return t.loaded.controllerInfo?t.controllerInfo:this.loadResource("controllerInfo",!0)}handleControllerEvent(e){a.update(t=>{if(!t.loaded.controllerInfo)return t;const s=e.payload;return e.operation==="update"?{...t,controllerInfo:s}:t})}}const h=new u;typeof window<"u"&&h.setupWebSocketSubscriptions();export{h as a,a as e}; diff --git a/webapp/assets/_app/immutable/entry/app.kAVAdeq9.js b/webapp/assets/_app/immutable/entry/app.kAVAdeq9.js new file mode 100644 index 00000000..f6063c71 --- /dev/null +++ b/webapp/assets/_app/immutable/entry/app.kAVAdeq9.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.DINiyk_8.js","../chunks/DsnmJJEf.js","../chunks/B3Pzt0F_.js","../chunks/D8EpLgQ1.js","../chunks/5WA7h8uK.js","../chunks/CiE1LlKV.js","../chunks/C41YH50Q.js","../chunks/CTf6mQoE.js","../chunks/CoIRRsD9.js","../chunks/duD3WMbl.js","../chunks/u94nIB4-.js","../chunks/BEkVdVE1.js","../assets/0.BPrCR_r7.css","../nodes/1.DcR4nNsi.js","../nodes/2.CiT4lj0D.js","../chunks/wyaP0EDu.js","../chunks/C6k1Q4We.js","../chunks/D4Caz1gY.js","../chunks/qB7B8uiS.js","../nodes/3.BSFz0YHn.js","../chunks/CO4LUyTP.js","../chunks/CNMHKIIK.js","../chunks/BGVHQGl-.js","../chunks/C9DJVOi1.js","../chunks/CCSWcuVN.js","../chunks/CGpPw4EW.js","../chunks/BE4wujub.js","../chunks/ow_oMtSd.js","../nodes/4.XnVoh6ca.js","../nodes/5.rvsSG-AQ.js","../chunks/CclkODgu.js","../chunks/KQ2xQpA3.js","../chunks/B7ITzBt8.js","../nodes/6.CtGX0qgG.js","../chunks/BmGWMSQm.js","../chunks/BAg1iRPq.js","../chunks/DDhBTdDt.js","../chunks/CwqI2jFH.js","../chunks/DZblzgqm.js","../nodes/7.0w3i9VHx.js","../nodes/8.BiZNKYxk.js","../nodes/9.DpSfMRgo.js","../nodes/10.LnrIJgIa.js","../nodes/11.Bsn67lBa.js","../nodes/12.B-vC_cmu.js","../chunks/Dbd6PPbz.js","../nodes/13.Br7HzjXP.js","../chunks/DQP15tlf.js","../chunks/CLYUNKnN.js","../nodes/14.Cd0DOn96.js","../nodes/15.CkHQugXH.js","../nodes/16.B35VVkOd.js","../nodes/17.CCltcs-Z.js","../chunks/C89fcOde.js","../nodes/18.iVIhGVtu.js"])))=>i.map(i=>d[i]); +import{s as A,aL as z,g as f,aN as U,aO as G,aP as Q,ax as W,aQ as Y,m as F,p as H,an as J,ao as K,o as X,aR as b,aS as Z,f as C,b as L,k as $,c as g,d as tt,B as T,j as et,r as rt,aT as D,D as st,t as ot,v as at}from"../chunks/D8EpLgQ1.js";import"../chunks/DsnmJJEf.js";import{p as I,i as V}from"../chunks/5WA7h8uK.js";import{c as w}from"../chunks/CCSWcuVN.js";import{b as k}from"../chunks/BAg1iRPq.js";function nt(c){return class extends it{constructor(t){super({component:c,...t})}}}class it{#e;#t;constructor(t){var a=new Map,u=(r,e)=>{var s=F(e,!1,!1);return a.set(r,s),s};const l=new Proxy({...t.props||{},$$events:{}},{get(r,e){return f(a.get(e)??u(e,Reflect.get(r,e)))},has(r,e){return e===z?!0:(f(a.get(e)??u(e,Reflect.get(r,e))),Reflect.has(r,e))},set(r,e,s){return A(a.get(e)??u(e,s),s),Reflect.set(r,e,s)}});this.#t=(t.hydrate?U:G)(t.component,{target:t.target,anchor:t.anchor,props:l,context:t.context,intro:t.intro??!1,recover:t.recover}),(!t?.props?.$$host||t.sync===!1)&&Q(),this.#e=l.$$events;for(const r of Object.keys(this.#t))r==="$set"||r==="$destroy"||r==="$on"||W(this,r,{get(){return this.#t[r]},set(e){this.#t[r]=e},enumerable:!0});this.#t.$set=r=>{Object.assign(l,r)},this.#t.$destroy=()=>{Y(this.#t)}}$set(t){this.#t.$set(t)}$on(t,a){this.#e[t]=this.#e[t]||[];const u=(...l)=>a.call(this,...l);return this.#e[t].push(u),()=>{this.#e[t]=this.#e[t].filter(l=>l!==u)}}$destroy(){this.#t.$destroy()}}const ct="modulepreload",ut=function(c,t){return new URL(c,t).href},j={},o=function(t,a,u){let l=Promise.resolve();if(a&&a.length>0){let O=function(i){return Promise.all(i.map(d=>Promise.resolve(d).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const e=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),y=s?.nonce||s?.getAttribute("nonce");l=O(a.map(i=>{if(i=ut(i,u),i in j)return;j[i]=!0;const d=i.endsWith(".css"),v=d?'[rel="stylesheet"]':"";if(!!u)for(let n=e.length-1;n>=0;n--){const _=e[n];if(_.href===i&&(!d||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${v}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":ct,d||(m.as="script"),m.crossOrigin="",m.href=i,y&&m.setAttribute("nonce",y),document.head.appendChild(m),d)return new Promise((n,_)=>{m.addEventListener("load",n),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${i}`)))})}))}function r(e){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=e,window.dispatchEvent(s),!s.defaultPrevented)throw e}return l.then(e=>{for(const s of e||[])s.status==="rejected"&&r(s.reason);return t().catch(r)})},Rt={};var lt=C('
                '),_t=C(" ",1);function mt(c,t){H(t,!0);let a=I(t,"components",23,()=>[]),u=I(t,"data_0",3,null),l=I(t,"data_1",3,null);J(()=>t.stores.page.set(t.page)),K(()=>{t.stores,t.page,t.constructors,a(),t.form,u(),l(),t.stores.page.notify()});let r=b(!1),e=b(!1),s=b(null);X(()=>{const n=t.stores.page.subscribe(()=>{f(r)&&(A(e,!0),Z().then(()=>{A(s,document.title||"untitled page",!0)}))});return A(r,!0),n});const y=D(()=>t.constructors[1]);var O=_t(),i=L(O);{var d=n=>{const _=D(()=>t.constructors[0]);var h=T(),P=L(h);w(P,()=>f(_),(E,p)=>{k(p(E,{get data(){return u()},get form(){return t.form},get params(){return t.page.params},children:(R,vt)=>{var S=T(),B=L(S);w(B,()=>f(y),(N,M)=>{k(M(N,{get data(){return l()},get form(){return t.form},get params(){return t.page.params}}),q=>a()[1]=q,()=>a()?.[1])}),g(R,S)},$$slots:{default:!0}}),R=>a()[0]=R,()=>a()?.[0])}),g(n,h)},v=n=>{const _=D(()=>t.constructors[0]);var h=T(),P=L(h);w(P,()=>f(_),(E,p)=>{k(p(E,{get data(){return u()},get form(){return t.form},get params(){return t.page.params}}),R=>a()[0]=R,()=>a()?.[0])}),g(n,h)};V(i,n=>{t.constructors[1]?n(d):n(v,!1)})}var x=$(i,2);{var m=n=>{var _=lt(),h=et(_);{var P=E=>{var p=st();ot(()=>at(p,f(s))),g(E,p)};V(h,E=>{f(e)&&E(P)})}rt(_),g(n,_)};V(x,n=>{f(r)&&n(m)})}g(c,O),tt()}const yt=nt(mt),Ot=[()=>o(()=>import("../nodes/0.DINiyk_8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url),()=>o(()=>import("../nodes/1.DcR4nNsi.js"),__vite__mapDeps([13,1,2,3,7,8]),import.meta.url),()=>o(()=>import("../nodes/2.CiT4lj0D.js"),__vite__mapDeps([14,1,2,3,4,10,5,8,15,16,17,18,11]),import.meta.url),()=>o(()=>import("../nodes/3.BSFz0YHn.js"),__vite__mapDeps([19,1,2,3,4,10,5,16,17,20,21,22,23,24,8,15,11,25,26,27]),import.meta.url),()=>o(()=>import("../nodes/4.XnVoh6ca.js"),__vite__mapDeps([28,1,2,3,4,5,16,17,20,21,22,23,10,24,8,15,11,25]),import.meta.url),()=>o(()=>import("../nodes/5.rvsSG-AQ.js"),__vite__mapDeps([29,1,2,3,4,5,8,20,10,16,17,18,15,30,31,11,22,23,24,32,25,26,27]),import.meta.url),()=>o(()=>import("../nodes/6.CtGX0qgG.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,30,10,16,17,18,31,34,22,15,23,24,32,26,27,35,36,11,37,38]),import.meta.url),()=>o(()=>import("../nodes/7.0w3i9VHx.js"),__vite__mapDeps([39,1,2,3,4,5,16,17,7,8,9,11]),import.meta.url),()=>o(()=>import("../nodes/8.BiZNKYxk.js"),__vite__mapDeps([40,1,2,3,4,5,31,18,20,10,11,23,24,16,8,22,32,26,27]),import.meta.url),()=>o(()=>import("../nodes/9.DpSfMRgo.js"),__vite__mapDeps([41,1,2,3,4,10,5,35,6,7,8,31,18,27,22]),import.meta.url),()=>o(()=>import("../nodes/10.LnrIJgIa.js"),__vite__mapDeps([42,1,2,3,4,5,16,17,7,8,9]),import.meta.url),()=>o(()=>import("../nodes/11.Bsn67lBa.js"),__vite__mapDeps([43,1,2,3,4,5,8,10,16,17,18,21,22,15,30,31,20,11,23,24,32,25,26,27]),import.meta.url),()=>o(()=>import("../nodes/12.B-vC_cmu.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,8,30,10,16,17,18,31,34,22,15,23,24,32,26,27,35,36,45,11,37,38]),import.meta.url),()=>o(()=>import("../nodes/13.Br7HzjXP.js"),__vite__mapDeps([46,1,2,3,4,5,8,20,37,10,16,17,18,38,47,15,31,11,22,23,24,32,25,26,27,48]),import.meta.url),()=>o(()=>import("../nodes/14.Cd0DOn96.js"),__vite__mapDeps([49,1,2,3,4,10,5,6,7,8,47,16,17,18,38,15,31,36,23,24,22,32,26,27,11]),import.meta.url),()=>o(()=>import("../nodes/15.CkHQugXH.js"),__vite__mapDeps([50,1,2,3,4,5,10,16,17,18,21,22,15,30,31,20,11,23,24,8,32,25,26,27]),import.meta.url),()=>o(()=>import("../nodes/16.B35VVkOd.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,8,30,10,16,17,18,31,34,22,15,23,24,32,26,27,35,36,45,11,37,38]),import.meta.url),()=>o(()=>import("../nodes/17.CCltcs-Z.js"),__vite__mapDeps([52,1,2,3,4,5,8,20,10,16,17,18,38,53,31,15,11,22,23,24,32,25,26,27,48]),import.meta.url),()=>o(()=>import("../nodes/18.iVIhGVtu.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,8,53,16,17,18,38,31,36,23,10,24,22,32,26,27,11]),import.meta.url)],Lt=[],At={"/":[2],"/credentials":[3],"/endpoints":[4],"/enterprises":[5],"/enterprises/[id]":[6],"/init":[7],"/instances":[8],"/instances/[id]":[9],"/login":[10],"/organizations":[11],"/organizations/[id]":[12],"/pools":[13],"/pools/[id]":[14],"/repositories":[15],"/repositories/[id]":[16],"/scalesets":[17],"/scalesets/[id]":[18]},dt={handleError:({error:c})=>{console.error(c)},reroute:()=>{},transport:{}},ft=Object.fromEntries(Object.entries(dt.transport).map(([c,t])=>[c,t.decode])),bt=!1,Tt=(c,t)=>ft[c](t);export{Tt as decode,ft as decoders,At as dictionary,bt as hash,dt as hooks,Rt as matchers,Ot as nodes,yt as root,Lt as server_loads}; diff --git a/webapp/assets/_app/immutable/entry/start.CI0Cdear.js b/webapp/assets/_app/immutable/entry/start.CI0Cdear.js new file mode 100644 index 00000000..b4e2a9f4 --- /dev/null +++ b/webapp/assets/_app/immutable/entry/start.CI0Cdear.js @@ -0,0 +1 @@ +import{l as o,a as r}from"../chunks/CTf6mQoE.js";export{o as load_css,r as start}; diff --git a/webapp/assets/_app/immutable/nodes/0.DINiyk_8.js b/webapp/assets/_app/immutable/nodes/0.DINiyk_8.js new file mode 100644 index 00000000..d50c7e62 --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/0.DINiyk_8.js @@ -0,0 +1,13 @@ +import"../chunks/DsnmJJEf.js";import{i as He}from"../chunks/B3Pzt0F_.js";import{p as Se,o as De,s as h,m as F,g as e,l as X,a as Le,f as c,b as E,j as o,k as n,r as t,u as i,t as P,v as ge,c as s,B as U,C as Y,e as I,d as Be,q as cr,h as gr,$ as hr}from"../chunks/D8EpLgQ1.js";import{a as me,i as w,s as Ae}from"../chunks/5WA7h8uK.js";import{c as _,s as Q,h as ur,B as fr,d as Ge}from"../chunks/CiE1LlKV.js";import{p as qe}from"../chunks/C41YH50Q.js";import{g as fe}from"../chunks/CTf6mQoE.js";import{b as l}from"../chunks/CoIRRsD9.js";import{b as Ne,a as mr}from"../chunks/duD3WMbl.js";import{e as ne,i as ce,w as xr}from"../chunks/u94nIB4-.js";import{t as Oe}from"../chunks/BEkVdVE1.js";const pr=async({url:Z})=>({url:Z.pathname}),kr=!1,br=!1,va=Object.freeze(Object.defineProperty({__proto__:null,load:pr,prerender:kr,ssr:br},Symbol.toStringTag,{value:"Module"}));var yr=c('
                Live Updates
                '),_r=c('
                Connecting
                '),wr=c('
                Updates Unavailable
                '),Mr=c('
                Manual Refresh
                '),$r=Y(''),jr=Y(''),zr=Y(''),Cr=Y(''),Hr=c(' '),Sr=c(' '),Lr=c('
                '),Br=c('
                '),Ar=c('
                '),Vr=c('
                '),Ir=Y(''),Rr=Y(''),Tr=Y(''),Pr=Y(''),Er=c(' '),Gr=c(' '),Or=c('
                '),Dr=c('
                '),qr=c('
                GARM GARM

                GARM

                ',1);function Nr(Z,ee){Se(ee,!1);const[re,he]=Ae(),M=()=>me(xr,"$websocketStore",re),m=()=>me(qe,"$page",re),u=F(),y=F();let $=F(!1),G=F(!1),f=F(!1);De(()=>{j(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",v)});function j(){const a=localStorage.getItem("theme");a==="dark"?h(f,!0):a==="light"?h(f,!1):h(f,window.matchMedia("(prefers-color-scheme: dark)").matches),p()}function v(a){(!localStorage.getItem("theme")||localStorage.getItem("theme")==="system")&&(h(f,a.matches),p())}function O(){h(f,!e(f)),localStorage.setItem("theme",e(f)?"dark":"light"),p()}function p(){e(f)?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}function z(){Ne.logout(),h(G,!1)}const le=[{href:`${l}/`,label:"Dashboard",icon:["M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z","M8 5a2 2 0 012-2h4a2 2 0 012 2v2H8V5z"]},{href:`${l}/repositories`,label:"Repositories",icon:["M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z","M8 5a2 2 0 012-2h4a2 2 0 012 2v2H8V5z"]},{href:`${l}/organizations`,label:"Organizations",icon:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"},{href:`${l}/enterprises`,label:"Enterprises",icon:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"},{href:`${l}/pools`,label:"Pools",icon:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},{href:`${l}/scalesets`,label:"Scale Sets",icon:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"},{href:`${l}/instances`,label:"Runners",icon:"M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"}],J=[{href:`${l}/credentials`,label:"Credentials",icon:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},{href:`${l}/endpoints`,label:"Endpoints",icon:"M13 10V3L4 14h7v7l9-11h-7z"}];X(()=>M(),()=>{h(u,M())}),X(()=>m(),()=>{m().url.pathname&&h($,!1)}),X(()=>m(),()=>{h(y,m().url.pathname)}),Le(),He();var D=qr(),V=E(D),q=o(V),ae=o(q),K=o(ae),te=o(K),b=o(te),C=n(b,2);t(te),t(K);var N=n(K,2),oe=o(N),de=o(oe),xe=o(de);{var ke=a=>{var r=yr();s(a,r)},Ue=a=>{var r=U(),g=E(r);{var H=x=>{var S=_r();s(x,S)},R=x=>{var S=U(),W=E(S);{var L=k=>{var T=wr();s(k,T)},B=k=>{var T=Mr();s(k,T)};w(W,k=>{e(u),i(()=>e(u).error)?k(L):k(B,!1)},!0)}s(x,S)};w(g,x=>{e(u),i(()=>e(u).connecting)?x(H):x(R,!1)},!0)}s(a,r)};w(xe,a=>{e(u),i(()=>e(u).connected)?a(ke):a(Ue,!1)})}t(de);var pe=n(de,2),Qe=o(pe);{var Fe=a=>{var r=$r();s(a,r)},Je=a=>{var r=jr();s(a,r)};w(Qe,a=>{e(f)?a(Fe):a(Je,!1)})}t(pe),t(oe),t(N),t(ae);var Ve=n(ae,2),Ie=o(Ve);ne(Ie,1,()=>le,ce,(a,r)=>{var g=Hr(),H=o(g),R=o(H);{var x=L=>{var B=U(),k=E(B);ne(k,1,()=>(e(r),i(()=>e(r).icon)),ce,(T,se)=>{var d=zr();P(()=>_(d,"d",e(se))),s(T,d)}),s(L,B)},S=L=>{var B=Cr();P(()=>_(B,"d",(e(r),i(()=>e(r).icon)))),s(L,B)};w(R,L=>{e(r),i(()=>Array.isArray(e(r).icon))?L(x):L(S,!1)})}t(H);var W=n(H);t(g),P(()=>{_(g,"href",(e(r),i(()=>e(r).href))),Q(g,1,`group flex items-center px-2 py-2 text-sm font-medium rounded-md transition-colors duration-200 + ${e(y),e(r),i(()=>e(y)===e(r).href?"bg-gray-100 text-gray-900 dark:bg-gray-700 dark:text-white":"text-gray-600 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white")??""}`),ge(W,` ${e(r),i(()=>e(r).label)??""}`)}),s(a,g)});var be=n(Ie,2);ne(be,5,()=>J,ce,(a,r)=>{var g=Sr(),H=o(g),R=o(H);t(H);var x=n(H);t(g),P(()=>{_(g,"href",(e(r),i(()=>e(r).href))),Q(g,1,`group flex items-center px-2 py-2 text-sm font-medium rounded-md transition-colors duration-200 + ${e(y),e(r),i(()=>e(y)===e(r).href?"bg-gray-100 text-gray-900 dark:bg-gray-700 dark:text-white":"text-gray-600 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white")??""}`),_(R,"d",(e(r),i(()=>e(r).icon))),ge(x,` ${e(r),i(()=>e(r).label)??""}`)}),s(a,g)}),t(be);var Re=n(be,2),Ke=o(Re);t(Re),t(Ve),t(q),t(V);var ye=n(V,2),_e=o(ye),Te=o(_e),we=n(Te,2),Me=o(we),$e=n(Me,2),Pe=n($e,4),We=o(Pe);{var Xe=a=>{var r=Lr();s(a,r)},Ye=a=>{var r=U(),g=E(r);{var H=x=>{var S=Br();s(x,S)},R=x=>{var S=U(),W=E(S);{var L=k=>{var T=Ar();s(k,T)},B=k=>{var T=Vr();s(k,T)};w(W,k=>{e(u),i(()=>e(u).error)?k(L):k(B,!1)},!0)}s(x,S)};w(g,x=>{e(u),i(()=>e(u).connecting)?x(H):x(R,!1)},!0)}s(a,r)};w(We,a=>{e(u),i(()=>e(u).connected)?a(Xe):a(Ye,!1)})}t(Pe),t(we);var je=n(we,2),Ze=o(je);{var er=a=>{var r=Ir();s(a,r)},rr=a=>{var r=Rr();s(a,r)};w(Ze,a=>{e(f)?a(er):a(rr,!1)})}t(je),t(_e);var ar=n(_e,2);{var tr=a=>{var r=Or(),g=o(r),H=n(g,2),R=o(H),x=o(R);t(R);var S=n(R,2),W=o(S),L=o(W);ne(L,1,()=>le,ce,(se,d)=>{var A=Er(),ie=o(A),ze=o(ie);{var Ce=ve=>{var ue=U(),lr=E(ue);ne(lr,1,()=>(e(d),i(()=>e(d).icon)),ce,(dr,vr)=>{var Ee=Tr();P(()=>_(Ee,"d",e(vr))),s(dr,Ee)}),s(ve,ue)},ir=ve=>{var ue=Pr();P(()=>_(ue,"d",(e(d),i(()=>e(d).icon)))),s(ve,ue)};w(ze,ve=>{e(d),i(()=>Array.isArray(e(d).icon))?ve(Ce):ve(ir,!1)})}t(ie);var nr=n(ie);t(A),P(()=>{_(A,"href",(e(d),i(()=>e(d).href))),Q(A,1,`group flex items-center px-2 py-2 text-base font-medium rounded-md transition-colors duration-200 + ${e(y),e(d),i(()=>e(y)===e(d).href?"bg-gray-100 dark:bg-gray-700 text-gray-900 dark:text-white":"text-gray-600 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white")??""}`),ge(nr,` ${e(d),i(()=>e(d).label)??""}`)}),I("click",A,()=>h($,!1)),s(se,A)});var B=n(L,2);ne(B,5,()=>J,ce,(se,d)=>{var A=Gr(),ie=o(A),ze=o(ie);t(ie);var Ce=n(ie);t(A),P(()=>{_(A,"href",(e(d),i(()=>e(d).href))),Q(A,1,`group flex items-center px-2 py-2 text-base font-medium rounded-md transition-colors duration-200 + ${e(y),e(d),i(()=>e(y)===e(d).href?"bg-gray-100 dark:bg-gray-700 text-gray-900 dark:text-white":"text-gray-600 hover:bg-gray-50 hover:text-gray-900 dark:text-gray-300 dark:hover:bg-gray-700 dark:hover:text-white")??""}`),_(ze,"d",(e(d),i(()=>e(d).icon))),ge(Ce,` ${e(d),i(()=>e(d).label)??""}`)}),I("click",A,()=>h($,!1)),s(se,A)}),t(B);var k=n(B,2),T=o(k);t(k),t(W),t(S),t(H),t(r),I("click",g,()=>h($,!1)),I("keydown",g,se=>{se.key==="Escape"&&h($,!1)}),I("click",x,()=>h($,!1)),I("click",T,z),s(a,r)};w(ar,a=>{e($)&&a(tr)})}t(ye);var or=n(ye,2);{var sr=a=>{var r=Dr();I("click",r,()=>h(G,!1)),I("keydown",r,g=>{g.key==="Escape"&&h(G,!1)}),s(a,r)};w(or,a=>{e(G)&&a(sr)})}P(()=>{_(te,"href",`${l}/`),_(b,"src",`${l??""}/assets/garm-light.svg`),_(C,"src",`${l??""}/assets/garm-dark.svg`),_(pe,"title",e(f)?"Switch to Light Mode":"Switch to Dark Mode"),_(Me,"src",`${l??""}/assets/garm-light.svg`),Q(Me,1,`${e(f)?"hidden":"block"} h-8 w-8`),_($e,"src",`${l??""}/assets/garm-dark.svg`),Q($e,1,`${e(f)?"block":"hidden"} h-8 w-8`)}),I("click",pe,O),I("click",Ke,z),I("click",Te,()=>h($,!e($))),I("click",je,O),s(Z,D),Be(),he()}var Ur=c("
                "),Qr=c('

                '),Fr=c('
                ');function Jr(Z,ee){Se(ee,!1);const[re,he]=Ae(),M=()=>me(Oe,"$toastStore",re),m=F();function u(j){switch(j){case"success":return` + + `;case"error":return` + + `;case"warning":return` + + `;case"info":default:return` + + `}}function y(j){switch(j){case"success":return"bg-green-50 dark:bg-green-900 border-green-200 dark:border-green-700";case"error":return"bg-red-50 dark:bg-red-900 border-red-200 dark:border-red-700";case"warning":return"bg-yellow-50 dark:bg-yellow-900 border-yellow-200 dark:border-yellow-700";case"info":default:return"bg-blue-50 dark:bg-blue-900 border-blue-200 dark:border-blue-700"}}function $(j){switch(j){case"success":return"text-green-800 dark:text-green-200";case"error":return"text-red-800 dark:text-red-200";case"warning":return"text-yellow-800 dark:text-yellow-200";case"info":default:return"text-blue-800 dark:text-blue-200"}}function G(j){switch(j){case"success":return"text-green-700 dark:text-green-300";case"error":return"text-red-700 dark:text-red-300";case"warning":return"text-yellow-700 dark:text-yellow-300";case"info":default:return"text-blue-700 dark:text-blue-300"}}X(()=>M(),()=>{h(m,M())}),Le(),He();var f=Fr();ne(f,5,()=>e(m),j=>j.id,(j,v)=>{var O=Qr(),p=o(O),z=o(p),le=o(z);ur(le,()=>(e(v),i(()=>u(e(v).type)))),t(z);var J=n(z,2),D=o(J),V=o(D,!0);t(D);var q=n(D,2);{var ae=b=>{var C=Ur(),N=o(C,!0);t(C),P(oe=>{Q(C,1,`mt-1 text-sm ${oe??""}`),ge(N,(e(v),i(()=>e(v).message)))},[()=>(e(v),i(()=>G(e(v).type)))]),s(b,C)};w(q,b=>{e(v),i(()=>e(v).message)&&b(ae)})}t(J);var K=n(J,2),te=o(K);{let b=cr(()=>(e(v),i(()=>e(v).type==="success"?"text-green-400 hover:text-green-500 focus:ring-green-500":e(v).type==="error"?"text-red-400 hover:text-red-500 focus:ring-red-500":e(v).type==="warning"?"text-yellow-400 hover:text-yellow-500 focus:ring-yellow-500":"text-blue-400 hover:text-blue-500 focus:ring-blue-500")));fr(te,{variant:"ghost",size:"sm","aria-label":"Dismiss notification",icon:"",get class(){return e(b)},$$events:{click:()=>Oe.remove(e(v).id)}})}t(K),t(p),t(O),P((b,C)=>{Q(O,1,`relative rounded-lg border p-4 shadow-lg transition-all duration-300 ease-in-out ${b??""}`),Q(D,1,`text-sm font-medium ${C??""}`),ge(V,(e(v),i(()=>e(v).title)))},[()=>(e(v),i(()=>y(e(v).type))),()=>(e(v),i(()=>$(e(v).type)))]),s(j,O)}),t(f),s(Z,f),Be(),he()}var Kr=c('

                Loading...

                '),Wr=c('

                Redirecting to login...

                '),Xr=c('
                '),Yr=c(" ",1);function ca(Z,ee){Se(ee,!1);const[re,he]=Ae(),M=()=>me(qe,"$page",re),m=()=>me(mr,"$authStore",re),u=F(),y=F(),$=F();De(()=>{Ne.init(),setTimeout(()=>{const p=M().url.pathname===`${l}/login`,z=M().url.pathname===`${l}/init`;!p&&!z&&!m().isAuthenticated&&!m().loading&&(m().needsInitialization?fe(`${l}/init`):fe(`${l}/login`))},200)}),X(()=>(m(),M(),fe),()=>{if(!m().loading){const p=M().url.pathname===`${l}/login`,z=M().url.pathname===`${l}/init`;!p&&!z&&!m().isAuthenticated&&(m().needsInitialization?fe(`${l}/init`):fe(`${l}/login`))}}),X(()=>(M(),l),()=>{h(u,M().url.pathname===`${l}/login`)}),X(()=>(M(),l),()=>{h(y,M().url.pathname===`${l}/init`)}),X(()=>(e(u),e(y)),()=>{h($,!e(u)&&!e(y))}),Le(),He();var G=Yr();gr(p=>{hr.title="GARM - GitHub Actions Runner Manager"});var f=E(G);{var j=p=>{var z=Kr();s(p,z)},v=p=>{var z=U(),le=E(z);{var J=V=>{var q=Wr();s(V,q)},D=V=>{var q=U(),ae=E(q);{var K=b=>{var C=U(),N=E(C);Ge(N,ee,"default",{}),s(b,C)},te=b=>{var C=Xr(),N=o(C);Nr(N,{});var oe=n(N,2),de=o(oe),xe=o(de),ke=o(xe);Ge(ke,ee,"default",{}),t(xe),t(de),t(oe),t(C),s(b,C)};w(ae,b=>{e(u)||e(y)?b(K):b(te,!1)},!0)}s(V,q)};w(le,V=>{e($),m(),i(()=>e($)&&!m().isAuthenticated)?V(J):V(D,!1)},!0)}s(p,z)};w(f,p=>{m(),i(()=>m().loading)?p(j):p(v,!1)})}var O=n(f,2);Jr(O,{}),s(Z,G),Be(),he()}export{ca as component,va as universal}; diff --git a/webapp/assets/_app/immutable/nodes/1.DcR4nNsi.js b/webapp/assets/_app/immutable/nodes/1.DcR4nNsi.js new file mode 100644 index 00000000..820e3848 --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/1.DcR4nNsi.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as u}from"../chunks/B3Pzt0F_.js";import{p as h,f as g,b as v,t as d,c as l,d as _,j as s,r as a,k as x,v as o}from"../chunks/D8EpLgQ1.js";import{s as k,p}from"../chunks/CTf6mQoE.js";const $={get error(){return p.error},get status(){return p.status}};k.updated.check;const i=$;var b=g("

                ",1);function y(m,c){h(c,!1),u();var r=b(),t=v(r),n=s(t,!0);a(t);var e=x(t,2),f=s(e,!0);a(e),d(()=>{o(n,i.status),o(f,i.error?.message)}),l(m,r),_()}export{y as component}; diff --git a/webapp/assets/_app/immutable/nodes/10.LnrIJgIa.js b/webapp/assets/_app/immutable/nodes/10.LnrIJgIa.js new file mode 100644 index 00000000..d1f479c8 --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/10.LnrIJgIa.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as X}from"../chunks/B3Pzt0F_.js";import{p as Y,o as Z,l as ee,a as ae,f as H,h as re,t as _,g as a,e as k,c as w,d as te,$ as se,k as d,D as de,m as f,j as r,s as i,r as t,z as B,v as D}from"../chunks/D8EpLgQ1.js";import{i as oe,s as ie,a as le}from"../chunks/5WA7h8uK.js";import{B as ne,r as q,c as T}from"../chunks/CiE1LlKV.js";import{b as U}from"../chunks/C6k1Q4We.js";import{p as ce}from"../chunks/D4Caz1gY.js";import{g as C}from"../chunks/CTf6mQoE.js";import{b as c}from"../chunks/CoIRRsD9.js";import{a as me,b as ue}from"../chunks/duD3WMbl.js";var pe=H('

                '),ve=H('
                GARM

                Sign in to GARM

                GitHub Actions Runner Manager

                ');function Le(I,K){Y(K,!1);const[W,F]=ie(),$=()=>le(me,"$authStore",W);let m=f(""),u=f(""),o=f(!1),l=f("");Z(()=>{J()});function J(){const e=localStorage.getItem("theme");let s=!1;e==="dark"?s=!0:e==="light"?s=!1:s=window.matchMedia("(prefers-color-scheme: dark)").matches,s?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}async function L(){if(!a(m)||!a(u)){i(l,"Please enter both username and password");return}i(o,!0),i(l,"");try{await ue.login(a(m),a(u)),C(`${c}/`)}catch(e){i(l,e instanceof Error?e.message:"Login failed")}finally{i(o,!1)}}function M(e){e.key==="Enter"&&L()}ee(()=>($(),c),()=>{$().isAuthenticated&&C(`${c}/`)}),ae(),X();var g=ve();re(e=>{se.title="Login - GARM"});var z=r(g),h=r(z),S=r(h),A=r(S),N=d(A,2);t(S),B(4),t(h);var b=d(h,2),x=r(b),y=r(x),p=d(r(y),2);q(p),t(y);var G=d(y,2),v=d(r(G),2);q(v),t(G),t(x);var P=d(x,2);{var O=e=>{var s=pe(),n=r(s),E=d(r(n),2),j=r(E),V=r(j,!0);t(j),t(E),t(n),t(s),_(()=>D(V,a(l))),w(e,s)};oe(P,e=>{a(l)&&e(O)})}var R=d(P,2),Q=r(R);ne(Q,{type:"submit",variant:"primary",size:"md",fullWidth:!0,get disabled(){return a(o)},get loading(){return a(o)},children:(e,s)=>{B();var n=de();_(()=>D(n,a(o)?"Signing in...":"Sign in")),w(e,n)},$$slots:{default:!0}}),t(R),t(b),t(z),t(g),_(()=>{T(A,"src",`${c??""}/assets/garm-light.svg`),T(N,"src",`${c??""}/assets/garm-dark.svg`),p.disabled=a(o),v.disabled=a(o)}),U(p,()=>a(m),e=>i(m,e)),k("keypress",p,M),U(v,()=>a(u),e=>i(u,e)),k("keypress",v,M),k("submit",b,ce(L)),w(I,g),te(),F()}export{Le as component}; diff --git a/webapp/assets/_app/immutable/nodes/11.Bsn67lBa.js b/webapp/assets/_app/immutable/nodes/11.Bsn67lBa.js new file mode 100644 index 00000000..2a8fb7cb --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/11.Bsn67lBa.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as Ie}from"../chunks/B3Pzt0F_.js";import{p as Be,E as Ve,o as Le,l as x,s as a,m as s,g as e,y as W,a as Ne,f as T,k as i,j as o,r as n,c as M,t as V,v as se,x as De,u as v,z as Fe,e as $e,d as je,h as Ye,b as Ke,$ as Qe,n as E,q as ue}from"../chunks/D8EpLgQ1.js";import{a as qe,i as Y,s as Ge}from"../chunks/5WA7h8uK.js";import{r as ge,b as Se,h as Xe,c as Ze,g as me}from"../chunks/CiE1LlKV.js";import{b as Ae}from"../chunks/CoIRRsD9.js";import{e as et,i as tt}from"../chunks/u94nIB4-.js";import{b as Ue,a as Re}from"../chunks/C6k1Q4We.js";import{p as at}from"../chunks/D4Caz1gY.js";import{M as rt}from"../chunks/qB7B8uiS.js";import{F as ot}from"../chunks/CNMHKIIK.js";import{e as He,a as Pe}from"../chunks/wyaP0EDu.js";import{U as nt}from"../chunks/CclkODgu.js";import{D as it}from"../chunks/KQ2xQpA3.js";import{P as st}from"../chunks/CO4LUyTP.js";import{t as ie}from"../chunks/BEkVdVE1.js";import{B as lt,k as Ce,g as Oe,l as dt}from"../chunks/BGVHQGl-.js";import{D as ct,A as We,G as ut,a as gt}from"../chunks/C9DJVOi1.js";import{E as mt}from"../chunks/B7ITzBt8.js";import{E as pt}from"../chunks/CGpPw4EW.js";import{S as ft}from"../chunks/BE4wujub.js";var bt=T('

                '),vt=T('

                Loading...

                '),yt=T(""),ht=T(''),_t=T('

                Webhook secret will be automatically generated

                '),xt=T('
                '),kt=T('

                Create Organization

                ');function wt(pe,fe){Be(fe,!1);const[be,ve]=Ge(),p=()=>qe(He,"$eagerCache",be),D=s(),w=s(),z=s(),K=s(),$=Ve();let C=s(!1),f=s(""),y=s("github"),r=s({name:"",credentials_name:"",webhook_secret:"",pool_balancer_type:"roundrobin"}),k=s(!0),b=s(!0);async function I(){if(!p().loaded.credentials&&!p().loading.credentials)try{await Pe.getCredentials()}catch(d){a(f,d instanceof Error?d.message:"Failed to load credentials")}}function B(d){a(y,d.detail),W(r,e(r).credentials_name="")}function c(){if(e(r).credentials_name){const d=e(D).find(L=>L.name===e(r).credentials_name);d&&d.forge_type&&a(y,d.forge_type)}}function ye(){const d=new Uint8Array(32);return crypto.getRandomValues(d),Array.from(d,L=>L.toString(16).padStart(2,"0")).join("")}async function he(){if(!e(r).name?.trim()){a(f,"Organization name is required");return}if(!e(r).credentials_name){a(f,"Please select credentials");return}try{a(C,!0),a(f,"");const d={...e(r),install_webhook:e(k),auto_generate_secret:e(b)};$("submit",d)}catch(d){a(f,d instanceof Error?d.message:"Failed to create organization"),a(C,!1)}}Le(()=>{I()}),x(()=>p(),()=>{a(D,p().credentials)}),x(()=>p(),()=>{a(w,p().loading.credentials)}),x(()=>(e(D),e(y)),()=>{a(z,e(D).filter(d=>e(y)?d.forge_type===e(y):!0))}),x(()=>e(b),()=>{e(b)?W(r,e(r).webhook_secret=ye()):e(b)||W(r,e(r).webhook_secret="")}),x(()=>(e(r),e(b)),()=>{a(K,e(r).name?.trim()!==""&&e(r).credentials_name!==""&&(e(b)||e(r).webhook_secret&&e(r).webhook_secret.trim()!==""))}),Ne(),Ie(),rt(pe,{$$events:{close:()=>$("close")},children:(d,L)=>{var F=kt(),N=i(o(F),2);{var _e=h=>{var _=bt(),S=o(_),A=o(S,!0);n(S),n(_),V(()=>se(A,e(f))),M(h,_)};Y(N,h=>{e(f)&&h(_e)})}var xe=i(N,2);{var ke=h=>{var _=vt();M(h,_)},we=h=>{var _=xt(),S=o(_);ot(S,{get selectedForgeType(){return e(y)},set selectedForgeType(l){a(y,l)},$$events:{select:B},$$legacy:!0});var A=i(S,2),Q=i(o(A),2);ge(Q),n(A);var U=i(A,2),R=i(o(U),2);V(()=>{e(r),De(()=>{e(z)})});var X=o(R);X.value=X.__value="";var le=i(X);et(le,1,()=>e(z),tt,(l,m)=>{var P=yt(),ze=o(P);n(P);var ne={};V(()=>{se(ze,`${e(m),v(()=>e(m).name)??""} (${e(m),v(()=>e(m).endpoint?.name||"Unknown endpoint")??""})`),ne!==(ne=(e(m),v(()=>e(m).name)))&&(P.value=(P.__value=(e(m),v(()=>e(m).name)))??"")}),M(l,P)}),n(R),n(U);var Z=i(U,2),j=i(o(Z),2);V(()=>{e(r),De(()=>{})});var ee=o(j);ee.value=ee.__value="roundrobin";var de=i(ee);de.value=de.__value="pack",n(j),n(Z);var te=i(Z,2),t=o(te),g=o(t);ge(g),Fe(2),n(t);var q=i(t,2),O=o(q),u=o(O);ge(u),Fe(2),n(O);var G=i(O,2);{var ae=l=>{var m=ht();ge(m),Ue(m,()=>e(r).webhook_secret,P=>W(r,e(r).webhook_secret=P)),M(l,m)},re=l=>{var m=_t();M(l,m)};Y(G,l=>{e(b)?l(re,!1):l(ae)})}n(q),n(te);var H=i(te,2),J=o(H),oe=i(J,2),ce=o(oe,!0);n(oe),n(H),n(_),V(()=>{oe.disabled=e(C)||e(w)||!e(K),se(ce,e(C)?"Creating...":"Create Organization")}),Ue(Q,()=>e(r).name,l=>W(r,e(r).name=l)),Se(R,()=>e(r).credentials_name,l=>W(r,e(r).credentials_name=l)),$e("change",R,c),Se(j,()=>e(r).pool_balancer_type,l=>W(r,e(r).pool_balancer_type=l)),Re(g,()=>e(k),l=>a(k,l)),Re(u,()=>e(b),l=>a(b,l)),$e("click",J,()=>$("close")),$e("submit",_,at(he)),M(h,_)};Y(xe,h=>{e(C)?h(ke):h(we,!1)})}n(F),M(d,F)},$$slots:{default:!0}}),je(),ve()}var zt=T(''),$t=T('
                ',1);function Jt(pe,fe){Be(fe,!1);const[be,ve]=Ge(),p=()=>qe(He,"$eagerCache",be),D=s(),w=s(),z=s(),K=s();let $=s([]),C=s(!0),f=s(""),y=s(""),r=s(1),k=s(25),b=s(!1),I=s(!1),B=s(!1),c=s(null);async function ye(t){try{a(f,"");const g=t.detail,q={name:g.name,credentials_name:g.credentials_name,webhook_secret:g.webhook_secret,pool_balancer_type:g.pool_balancer_type},O=await me.createOrganization(q);if(g.install_webhook&&O.id)try{await me.installOrganizationWebhook(O.id),ie.success("Webhook Installed",`Webhook for organization ${O.name} has been installed successfully.`)}catch(u){console.warn("Organization created but webhook installation failed:",u),ie.error("Webhook Installation Failed",u instanceof Error?u.message:"Failed to install webhook. You can try installing it manually from the organization details page.")}ie.success("Organization Created",`Organization ${O.name} has been created successfully.`),a(b,!1)}catch(g){throw a(f,g instanceof Error?g.message:"Failed to create organization"),g}}async function he(t){if(e(c))try{await me.updateOrganization(e(c).id,t),ie.success("Organization Updated",`Organization ${e(c).name} has been updated successfully.`),a(I,!1),a(c,null)}catch(g){throw g}}async function d(){if(e(c))try{a(f,""),await me.deleteOrganization(e(c).id),ie.success("Organization Deleted",`Organization ${e(c).name} has been deleted successfully.`),a(B,!1),a(c,null)}catch(t){a(f,t instanceof Error?t.message:"Failed to delete organization")}}function L(){a(b,!0)}function F(t){a(c,t),a(I,!0)}function N(t){a(c,t),a(B,!0)}Le(async()=>{try{a(C,!0);const t=await Pe.getOrganizations();t&&Array.isArray(t)&&a($,t)}catch(t){console.error("Failed to load organizations:",t),a(f,t instanceof Error?t.message:"Failed to load organizations")}finally{a(C,!1)}});async function _e(){try{await Pe.retryResource("organizations")}catch(t){console.error("Retry failed:",t)}}const xe=[{key:"name",title:"Name",cellComponent:mt,cellProps:{entityType:"organization"}},{key:"endpoint",title:"Endpoint",cellComponent:pt},{key:"credentials",title:"Credentials",cellComponent:ut,cellProps:{field:"credentials_name"}},{key:"status",title:"Status",cellComponent:ft,cellProps:{statusType:"entity"}},{key:"actions",title:"Actions",align:"right",cellComponent:gt}],ke={entityType:"organization",primaryText:{field:"name",isClickable:!0,href:"/organizations/{id}"},customInfo:[{icon:t=>Oe(t?.endpoint?.endpoint_type||"unknown"),text:t=>t?.endpoint?.name||"Unknown"}],badges:[{type:"custom",value:t=>Ce(t)}],actions:[{type:"edit",handler:t=>F(t)},{type:"delete",handler:t=>N(t)}]};function we(t){a(y,t.detail.term),a(r,1)}function h(t){a(r,t.detail.page)}function _(t){a(k,t.detail.perPage),a(r,1)}function S(t){F(t.detail.item)}function A(t){N(t.detail.item)}x(()=>(e($),p()),()=>{(!e($).length||p().loaded.organizations)&&a($,p().organizations)}),x(()=>p(),()=>{a(C,p().loading.organizations)}),x(()=>p(),()=>{a(D,p().errorMessages.organizations)}),x(()=>(e($),e(y)),()=>{a(w,dt(e($),e(y)))}),x(()=>(e(w),e(k)),()=>{a(z,Math.ceil(e(w).length/e(k)))}),x(()=>(e(r),e(z)),()=>{e(r)>e(z)&&e(z)>0&&a(r,e(z))}),x(()=>(e(w),e(r),e(k)),()=>{a(K,e(w).slice((e(r)-1)*e(k),e(r)*e(k)))}),Ne(),Ie();var Q=$t();Ye(t=>{Qe.title="Organizations - GARM"});var U=Ke(Q),R=o(U);st(R,{title:"Organizations",description:"Manage GitHub and Gitea organizations",actionLabel:"Add Organization",$$events:{action:L}});var X=i(R,2);{let t=ue(()=>e(D)||e(f)),g=ue(()=>!!e(D));ct(X,{get columns(){return xe},get data(){return e(K)},get loading(){return e(C)},get error(){return e(t)},get searchTerm(){return e(y)},searchPlaceholder:"Search organizations...",get currentPage(){return e(r)},get perPage(){return e(k)},get totalPages(){return e(z)},get totalItems(){return e(w),v(()=>e(w).length)},itemName:"organizations",emptyIconType:"building",get showRetry(){return e(g)},get mobileCardConfig(){return ke},$$events:{search:we,pageChange:h,perPageChange:_,retry:_e,edit:S,delete:A},$$slots:{"mobile-card":(q,O)=>{const u=ue(()=>O.item),G=ue(()=>(E(Ce),E(e(u)),v(()=>Ce(e(u)))));var ae=zt(),re=o(ae),H=o(re),J=o(H),oe=o(J,!0);n(J);var ce=i(J,2),l=o(ce),m=o(l);Xe(m,()=>(E(Oe),E(e(u)),v(()=>Oe(e(u).endpoint?.endpoint_type||"unknown"))));var P=i(m,2),ze=o(P,!0);n(P),n(l),n(ce),n(H),n(re);var ne=i(re,2),Ee=o(ne);lt(Ee,{get variant(){return E(e(G)),v(()=>e(G).variant)},get text(){return E(e(G)),v(()=>e(G).text)}});var Me=i(Ee,2),Te=o(Me);We(Te,{action:"edit",size:"sm",title:"Edit organization",ariaLabel:"Edit organization",$$events:{click:()=>F(e(u))}});var Je=i(Te,2);We(Je,{action:"delete",size:"sm",title:"Delete organization",ariaLabel:"Delete organization",$$events:{click:()=>N(e(u))}}),n(Me),n(ne),n(ae),V(()=>{Ze(H,"href",(E(Ae),E(e(u)),v(()=>`${Ae}/organizations/${e(u).id}`))),se(oe,(E(e(u)),v(()=>e(u).name))),se(ze,(E(e(u)),v(()=>e(u).endpoint?.name||"Unknown")))}),M(q,ae)}}})}n(U);var le=i(U,2);{var Z=t=>{wt(t,{$$events:{close:()=>a(b,!1),submit:ye}})};Y(le,t=>{e(b)&&t(Z)})}var j=i(le,2);{var ee=t=>{nt(t,{get entity(){return e(c)},entityType:"organization",$$events:{close:()=>{a(I,!1),a(c,null)},submit:g=>he(g.detail)}})};Y(j,t=>{e(I)&&e(c)&&t(ee)})}var de=i(j,2);{var te=t=>{it(t,{title:"Delete Organization",message:"Are you sure you want to delete this organization? This action cannot be undone.",get itemName(){return e(c),v(()=>e(c).name)},$$events:{close:()=>{a(B,!1),a(c,null)},confirm:d}})};Y(de,t=>{e(B)&&e(c)&&t(te)})}M(pe,Q),je(),ve()}export{Jt as component}; diff --git a/webapp/assets/_app/immutable/nodes/12.B-vC_cmu.js b/webapp/assets/_app/immutable/nodes/12.B-vC_cmu.js new file mode 100644 index 00000000..2fef2926 --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/12.B-vC_cmu.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as Le}from"../chunks/B3Pzt0F_.js";import{p as Ne,o as We,A as qe,l as He,a as je,f as A,h as Ge,b as M,t as q,c as x,d as Re,g as e,m as l,s as o,u as s,$ as Ve,j as f,r as g,k as d,v as le,y as Je,B as de,q as m,n as Ke}from"../chunks/D8EpLgQ1.js";import{i as h,s as Qe,a as Xe}from"../chunks/5WA7h8uK.js";import{c as Ye,g as _}from"../chunks/CiE1LlKV.js";import{p as Ze}from"../chunks/C41YH50Q.js";import{g as ce}from"../chunks/CTf6mQoE.js";import{b as H}from"../chunks/CoIRRsD9.js";import{U as et}from"../chunks/CclkODgu.js";import{D as ue}from"../chunks/KQ2xQpA3.js";import{E as tt,P as at,a as nt}from"../chunks/BmGWMSQm.js";import{D as ot,I as rt}from"../chunks/DDhBTdDt.js";import{g as fe}from"../chunks/BGVHQGl-.js";import{W as it}from"../chunks/Dbd6PPbz.js";import{C as st}from"../chunks/CwqI2jFH.js";import{w as j}from"../chunks/u94nIB4-.js";import{t as C}from"../chunks/BEkVdVE1.js";var lt=A('

                Loading organization...

                '),dt=A('

                '),ct=A(" ",1),ut=A(' ',1);function Tt(ge,me){Ne(me,!1);const[pe,ve]=Qe(),G=()=>Xe(Ze,"$page",pe),w=l();let a=l(null),c=l([]),p=l([]),F=l(!0),I=l(""),O=l(!1),D=l(!1),E=l(!1),T=l(!1),u=l(null),P=null,b=l();async function R(){if(e(w))try{o(F,!0),o(I,"");const[t,n,r]=await Promise.all([_.getOrganization(e(w)),_.listOrganizationPools(e(w)).catch(()=>[]),_.listOrganizationInstances(e(w)).catch(()=>[])]);o(a,t),o(c,n),o(p,r)}catch(t){o(I,t instanceof Error?t.message:"Failed to load organization")}finally{o(F,!1)}}function ye(t,n){const{events:r}=t;return{...n,events:r}}async function he(t){if(e(a))try{await _.updateOrganization(e(a).id,t),await R(),C.success("Organization Updated",`Organization ${e(a).name} has been updated successfully.`),o(O,!1)}catch(n){throw n}}async function _e(){if(e(a)){try{await _.deleteOrganization(e(a).id),ce(`${H}/organizations`)}catch(t){o(I,t instanceof Error?t.message:"Failed to delete organization")}o(D,!1)}}async function be(){if(e(u))try{await _.deleteInstance(e(u).name),C.success("Instance Deleted",`Instance ${e(u).name} has been deleted successfully.`),o(E,!1),o(u,null)}catch(t){const n=t instanceof Error?t.message:"Failed to delete instance";C.error("Delete Failed",n),o(E,!1),o(u,null)}}function ze(t){o(u,t),o(E,!0)}function $e(){o(T,!0)}async function xe(t){try{if(!e(a))return;await _.createOrganizationPool(e(a).id,t.detail),C.success("Pool Created",`Pool has been created successfully for organization ${e(a).name}.`),o(T,!1)}catch(n){throw n}}function V(){e(b)&&Je(b,e(b).scrollTop=e(b).scrollHeight)}function we(t){if(t.operation==="update"){const n=t.payload;if(e(a)&&n.id===e(a).id){const r=e(a).events?.length||0,i=n.events?.length||0;o(a,ye(e(a),n)),i>r&&setTimeout(()=>{V()},100)}}else if(t.operation==="delete"){const n=t.payload.id||t.payload;e(a)&&e(a).id===n&&ce(`${H}/organizations`)}}function Ie(t){if(!e(a))return;const n=t.payload;if(n.org_id===e(a).id){if(t.operation==="create")o(c,[...e(c),n]);else if(t.operation==="update")o(c,e(c).map(r=>r.id===n.id?n:r));else if(t.operation==="delete"){const r=n.id||n;o(c,e(c).filter(i=>i.id!==r))}}}function Ee(t){if(!e(a)||!e(c))return;const n=t.payload;if(e(c).some(i=>i.id===n.pool_id)){if(t.operation==="create")o(p,[...e(p),n]);else if(t.operation==="update")o(p,e(p).map(i=>i.id===n.id?n:i));else if(t.operation==="delete"){const i=n.id||n;o(p,e(p).filter(L=>L.id!==i))}}}We(()=>{R().then(()=>{e(a)?.events?.length&&setTimeout(()=>{V()},100)});const t=j.subscribeToEntity("organization",["update","delete"],we),n=j.subscribeToEntity("pool",["create","update","delete"],Ie),r=j.subscribeToEntity("instance",["create","update","delete"],Ee);P=()=>{t(),n(),r()}}),qe(()=>{P&&(P(),P=null)}),He(()=>G(),()=>{o(w,G().params.id)}),je(),Le();var J=ut();Ge(t=>{q(()=>Ve.title=`${e(a),s(()=>e(a)?`${e(a).name} - Organization Details`:"Organization Details")??""} - GARM`)});var S=M(J),B=f(S),K=f(B),U=f(K),Oe=f(U);g(U);var Q=d(U,2),X=f(Q),Y=d(f(X),2),De=f(Y,!0);g(Y),g(X),g(Q),g(K),g(B);var Te=d(B,2);{var Pe=t=>{var n=lt();x(t,n)},ke=t=>{var n=de(),r=M(n);{var i=z=>{var $=dt(),k=f($),N=f(k,!0);g(k),g($),q(()=>le(N,e(I))),x(z,$)},L=z=>{var $=de(),k=M($);{var N=W=>{var ae=ct(),ne=M(ae);{let v=m(()=>(e(a),s(()=>e(a).name||"Organization"))),y=m(()=>(e(a),s(()=>e(a).endpoint?.name))),Ue=m(()=>(Ke(fe),e(a),s(()=>fe(e(a).endpoint?.endpoint_type||"unknown"))));ot(ne,{get title(){return e(v)},get subtitle(){return`Endpoint: ${e(y)??""}`},get forgeIcon(){return e(Ue)},onEdit:()=>o(O,!0),onDelete:()=>o(D,!0)})}var oe=d(ne,2);tt(oe,{get entity(){return e(a)},entityType:"organization"});var re=d(oe,2);{let v=m(()=>(e(a),s(()=>e(a).id||""))),y=m(()=>(e(a),s(()=>e(a).name||"")));it(re,{entityType:"organization",get entityId(){return e(v)},get entityName(){return e(y)}})}var ie=d(re,2);{let v=m(()=>(e(a),s(()=>e(a).id||""))),y=m(()=>(e(a),s(()=>e(a).name||"")));at(ie,{get pools(){return e(c)},entityType:"organization",get entityId(){return e(v)},get entityName(){return e(y)},$$events:{addPool:$e}})}var se=d(ie,2);rt(se,{get instances(){return e(p)},entityType:"organization",onDeleteInstance:ze});var Be=d(se,2);{let v=m(()=>(e(a),s(()=>e(a)?.events)));nt(Be,{get events(){return e(v)},get eventsContainer(){return e(b)},set eventsContainer(y){o(b,y)},$$legacy:!0})}x(W,ae)};h(k,W=>{e(a)&&W(N)},!0)}x(z,$)};h(r,z=>{e(I)?z(i):z(L,!1)},!0)}x(t,n)};h(Te,t=>{e(F)?t(Pe):t(ke,!1)})}g(S);var Z=d(S,2);{var Me=t=>{et(t,{get entity(){return e(a)},entityType:"organization",$$events:{close:()=>o(O,!1),submit:n=>he(n.detail)}})};h(Z,t=>{e(O)&&e(a)&&t(Me)})}var ee=d(Z,2);{var Ce=t=>{ue(t,{title:"Delete Organization",message:"Are you sure you want to delete this organization? This action cannot be undone and will remove all associated pools and instances.",get itemName(){return e(a),s(()=>e(a).name)},$$events:{close:()=>o(D,!1),confirm:_e}})};h(ee,t=>{e(D)&&e(a)&&t(Ce)})}var te=d(ee,2);{var Ae=t=>{ue(t,{title:"Delete Instance",message:"Are you sure you want to delete this instance? This action cannot be undone.",get itemName(){return e(u),s(()=>e(u).name)},$$events:{close:()=>{o(E,!1),o(u,null)},confirm:be}})};h(te,t=>{e(E)&&e(u)&&t(Ae)})}var Fe=d(te,2);{var Se=t=>{{let n=m(()=>(e(a),s(()=>e(a).id||"")));st(t,{initialEntityType:"organization",get initialEntityId(){return e(n)},$$events:{close:()=>o(T,!1),submit:xe}})}};h(Fe,t=>{e(T)&&e(a)&&t(Se)})}q(()=>{Ye(Oe,"href",`${H}/organizations`),le(De,(e(a),s(()=>e(a)?e(a).name:"Loading...")))}),x(ge,J),Re(),ve()}export{Tt as component}; diff --git a/webapp/assets/_app/immutable/nodes/13.Br7HzjXP.js b/webapp/assets/_app/immutable/nodes/13.Br7HzjXP.js new file mode 100644 index 00000000..7a557f43 --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/13.Br7HzjXP.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as re}from"../chunks/B3Pzt0F_.js";import{p as se,o as ne,l as d,a as ie,f as ce,h as de,b as pe,c as me,d as ue,g as t,m as r,$ as fe,j as ge,q as E,u as S,k as v,s as o,r as ye,n as he}from"../chunks/D8EpLgQ1.js";import{i as w,s as Pe,a as Ce}from"../chunks/5WA7h8uK.js";import{g as N}from"../chunks/CiE1LlKV.js";import"../chunks/CoIRRsD9.js";import{P as ve}from"../chunks/CO4LUyTP.js";import{C as $e}from"../chunks/CwqI2jFH.js";import{U as be}from"../chunks/DQP15tlf.js";import{D as _e}from"../chunks/KQ2xQpA3.js";import{e as Me,a as R}from"../chunks/wyaP0EDu.js";import{t as $}from"../chunks/BEkVdVE1.js";import{e as b,h as Ee}from"../chunks/BGVHQGl-.js";import{D as we,G as D,a as De}from"../chunks/C9DJVOi1.js";import{E as Te}from"../chunks/B7ITzBt8.js";import{E as ke}from"../chunks/CGpPw4EW.js";import{S as Ae}from"../chunks/BE4wujub.js";import{P as Fe}from"../chunks/CLYUNKnN.js";var Ue=ce('
                ',1);function Xe(G,q){se(q,!1);const[L,j]=Pe(),s=()=>Ce(Me,"$eagerCache",L),_=r(),i=r(),p=r(),T=r();let m=r([]),g=r(!0),u=r(""),y=r(""),n=r(1),c=r(25),h=r(!1),P=r(!1),f=r(!1),a=r(null);async function H(e){try{o(u,""),o(h,!1)}catch(l){throw o(u,l instanceof Error?l.message:"Failed to create pool"),l}}async function V(e){if(t(a))try{await N.updatePool(t(a).id,e),o(P,!1),$.add({type:"success",title:"Pool Updated",message:`Pool ${t(a).id.slice(0,8)}... has been updated successfully.`}),o(a,null)}catch(l){const C=l instanceof Error?l.message:"Failed to update pool";throw $.add({type:"error",title:"Update Failed",message:C}),l}}async function z(){if(!t(a))return;const e=`Pool ${t(a).id.slice(0,8)}...`;try{await N.deletePool(t(a).id),o(f,!1),$.add({type:"success",title:"Pool Deleted",message:`${e} has been deleted successfully.`}),o(a,null)}catch(l){const C=l instanceof Error?l.message:"Failed to delete pool";o(u,C),$.add({type:"error",title:"Delete Failed",message:C})}o(f,!1),o(a,null)}function B(){o(h,!0)}function k(e){o(a,e),o(P,!0)}function A(e){o(a,e),o(f,!0)}ne(async()=>{try{o(g,!0);const e=await R.getPools();e&&Array.isArray(e)&&o(m,e)}catch(e){console.error("Failed to load pools:",e),o(u,e instanceof Error?e.message:"Failed to load pools")}finally{o(g,!1)}});async function J(){try{await R.retryResource("pools")}catch(e){console.error("Retry failed:",e)}}const K=[{key:"id",title:"ID",flexible:!0,cellComponent:Te,cellProps:{entityType:"pool",showId:!0,fontMono:!0}},{key:"image",title:"Image",flexible:!0,cellComponent:D,cellProps:{field:"image",type:"code",showTitle:!0}},{key:"provider",title:"Provider",cellComponent:D,cellProps:{field:"provider_name"}},{key:"flavor",title:"Flavor",cellComponent:D,cellProps:{field:"flavor"}},{key:"entity",title:"Entity",cellComponent:Fe},{key:"endpoint",title:"Endpoint",cellComponent:ke},{key:"status",title:"Status",cellComponent:Ae,cellProps:{statusType:"enabled"}},{key:"actions",title:"Actions",align:"right",cellComponent:De}],O={entityType:"pool",primaryText:{field:"id",isClickable:!0,href:"/pools/{id}",useId:!0,isMonospace:!0},secondaryText:{field:"entity_name",computedValue:e=>b(e,s())},badges:[{type:"custom",value:e=>({variant:e.enabled?"success":"error",text:e.enabled?"Enabled":"Disabled"})}],actions:[{type:"edit",handler:e=>k(e)},{type:"delete",handler:e=>A(e)}]};function Q(e){o(y,e.detail.term),o(n,1)}function W(e){o(n,e.detail.page)}function X(e){o(c,e.detail.perPage),o(n,1)}function Y(e){k(e.detail.item)}function Z(e){A(e.detail.item)}d(()=>(t(m),s()),()=>{(!t(m).length||s().loaded.pools)&&o(m,s().pools)}),d(()=>s(),()=>{o(g,s().loading.pools)}),d(()=>s(),()=>{o(_,s().errorMessages.pools)}),d(()=>(t(m),t(y),s()),()=>{o(i,Ee(t(m),t(y),e=>b(e,s())))}),d(()=>(t(i),t(c)),()=>{o(p,Math.ceil(t(i).length/t(c)))}),d(()=>(t(n),t(p)),()=>{t(n)>t(p)&&t(p)>0&&o(n,t(p))}),d(()=>(t(i),t(n),t(c)),()=>{o(T,t(i).slice((t(n)-1)*t(c),t(n)*t(c)))}),ie(),re();var F=Ue();de(e=>{fe.title="Pools - GARM"});var M=pe(F),U=ge(M);ve(U,{title:"Pools",description:"Manage runner pools across all entities",actionLabel:"Add Pool",$$events:{action:B}});var ee=v(U,2);{let e=E(()=>t(_)||t(u)),l=E(()=>!!t(_));we(ee,{get columns(){return K},get data(){return t(T)},get loading(){return t(g)},get error(){return t(e)},get searchTerm(){return t(y)},searchPlaceholder:"Search by entity name...",get currentPage(){return t(n)},get perPage(){return t(c)},get totalPages(){return t(p)},get totalItems(){return t(i),S(()=>t(i).length)},itemName:"pools",emptyIconType:"cog",get showRetry(){return t(l)},get mobileCardConfig(){return O},$$events:{search:Q,pageChange:W,perPageChange:X,retry:J,edit:Y,delete:Z}})}ye(M);var x=v(M,2);{var te=e=>{$e(e,{$$events:{close:()=>o(h,!1),submit:l=>H(l.detail)}})};w(x,e=>{t(h)&&e(te)})}var I=v(x,2);{var oe=e=>{be(e,{get pool(){return t(a)},$$events:{close:()=>{o(P,!1),o(a,null)},submit:l=>V(l.detail)}})};w(I,e=>{t(P)&&t(a)&&e(oe)})}var ae=v(I,2);{var le=e=>{{let l=E(()=>(t(a),he(b),s(),S(()=>`Pool ${t(a).id.slice(0,8)}... (${b(t(a),s())})`)));_e(e,{title:"Delete Pool",message:"Are you sure you want to delete this pool? This action cannot be undone and will remove all associated runners.",get itemName(){return t(l)},$$events:{close:()=>{o(f,!1),o(a,null)},confirm:z}})}};w(ae,e=>{t(f)&&t(a)&&e(le)})}me(G,F),ue(),j()}export{Xe as component}; diff --git a/webapp/assets/_app/immutable/nodes/14.Cd0DOn96.js b/webapp/assets/_app/immutable/nodes/14.Cd0DOn96.js new file mode 100644 index 00000000..c682684d --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/14.Cd0DOn96.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as ze}from"../chunks/B3Pzt0F_.js";import{p as He,o as Ve,A as We,l as Ke,a as Qe,f as h,h as Xe,b as S,t as b,c as u,d as Ye,s as n,m as y,u as i,$ as Ze,g as t,j as r,r as a,k as s,v as l,y as mt,B as Wt,q as B,n as f}from"../chunks/D8EpLgQ1.js";import{i as g,s as ta,a as ea}from"../chunks/5WA7h8uK.js";import{w as Kt,e as aa,i as ra}from"../chunks/u94nIB4-.js";import{c as Qt,g as N,s as da}from"../chunks/CiE1LlKV.js";import{p as sa}from"../chunks/C41YH50Q.js";import{g as Xt}from"../chunks/CTf6mQoE.js";import{b as xt}from"../chunks/CoIRRsD9.js";import{U as ia}from"../chunks/DQP15tlf.js";import{D as Yt}from"../chunks/KQ2xQpA3.js";import{D as oa,I as na}from"../chunks/DDhBTdDt.js";import{t as E}from"../chunks/BEkVdVE1.js";import{e as P,i as R,j as Zt,b as C,g as te}from"../chunks/BGVHQGl-.js";var la=h('

                Loading pool...

                '),va=h('

                '),ca=h('
                GitHub Runner Group
                '),ma=h(' '),xa=h('
                Tags
                '),ua=h('

                Extra Specifications

                 
                '),ga=h('

                Basic Information

                Pool ID
                Provider
                Image
                Flavor
                Status
                Entity
                Created At
                Updated At

                Configuration

                Max Runners
                Min Idle Runners
                Bootstrap Timeout
                Priority
                Runner Prefix
                OS Type / Architecture
                ',1),pa=h(' ',1);function Ta(ee,ae){He(ae,!1);const[re,de]=ta(),ut=()=>ea(sa,"$page",re),L=y();let e=y(null),O=y(!0),M=y(""),F=y(!1),T=y(!1),D=y(!1),x=y(null),A=null;async function se(){if(t(L))try{n(O,!0),n(M,""),n(e,await N.getPool(t(L)))}catch(d){n(M,d instanceof Error?d.message:"Failed to load pool")}finally{n(O,!1)}}async function ie(d){if(t(e))try{const o=await N.updatePool(t(e).id,d);n(e,o),n(F,!1),E.success("Pool Updated",`Pool ${t(e).id} has been updated successfully.`)}catch(o){const _=o instanceof Error?o.message:"Failed to update pool";E.error("Update Failed",_)}}async function oe(){if(t(e)){try{await N.deletePool(t(e).id),Xt(`${xt}/pools`)}catch(d){const o=d instanceof Error?d.message:"Failed to delete pool";E.error("Delete Failed",o)}n(T,!1)}}async function ne(){if(t(x)){try{await N.deleteInstance(t(x).name),E.success("Instance Deleted",`Instance ${t(x).name} has been deleted successfully.`),n(D,!1),n(x,null)}catch(d){const o=d instanceof Error?d.message:"Failed to delete instance";E.error("Delete Failed",o)}n(D,!1),n(x,null)}}function le(d){n(x,d),n(D,!0)}function ve(d){if(!d)return"{}";try{if(typeof d=="string"){const o=JSON.parse(d);return JSON.stringify(o,null,2)}return JSON.stringify(d,null,2)}catch{return d.toString()}}function ce(d){if(d.operation==="update"){const o=d.payload;t(e)&&o.id===t(e).id&&n(e,o)}else if(d.operation==="delete"){const o=d.payload.id||d.payload;t(e)&&t(e).id===o&&Xt(`${xt}/pools`)}}function me(d){if(!t(e)||!t(e).instances)return;const o=d.payload;if(o.pool_id===t(e).id){if(d.operation==="create")mt(e,t(e).instances=[...t(e).instances,o]);else if(d.operation==="update")mt(e,t(e).instances=t(e).instances.map(_=>_.id===o.id?o:_));else if(d.operation==="delete"){const _=o.id||o;mt(e,t(e).instances=t(e).instances.filter(q=>q.id!==_))}n(e,t(e))}}Ve(()=>{se();const d=Kt.subscribeToEntity("pool",["update","delete"],ce),o=Kt.subscribeToEntity("instance",["create","update","delete"],me);A=()=>{d(),o()}}),We(()=>{A&&(A(),A=null)}),Ke(()=>ut(),()=>{n(L,ut().params.id)}),Qe(),ze();var gt=pa();Xe(d=>{b(()=>Ze.title=`${t(e),i(()=>t(e)?`Pool ${t(e).id} - Pool Details`:"Pool Details")??""} - GARM`)});var G=S(gt),J=r(G),pt=r(J),j=r(pt),xe=r(j);a(j);var ft=s(j,2),_t=r(ft),yt=s(r(_t),2),ue=r(yt,!0);a(yt),a(_t),a(ft),a(pt),a(J);var ge=s(J,2);{var pe=d=>{var o=la();u(d,o)},fe=d=>{var o=Wt(),_=S(o);{var q=k=>{var w=va(),U=r(w),z=r(U,!0);a(U),a(w),b(()=>l(z,t(M))),u(k,w)},ke=k=>{var w=Wt(),U=S(w);{var z=H=>{var kt=ga(),wt=S(kt);{let v=B(()=>(f(P),t(e),i(()=>P(t(e))))),c=B(()=>(f(R),t(e),i(()=>R(t(e))))),m=B(()=>(f(te),t(e),i(()=>te(t(e).endpoint?.endpoint_type||"unknown"))));oa(wt,{get title(){return t(e),i(()=>t(e).id)},get subtitle(){return`Pool for ${t(v)??""} (${t(c)??""})`},get forgeIcon(){return t(m)},onEdit:()=>n(F,!0),onDelete:()=>n(T,!0)})}var V=s(wt,2),W=r(V),$t=r(W),Pt=s(r($t),2),K=r(Pt),Dt=s(r(K),2),we=r(Dt,!0);a(Dt),a(K);var Q=s(K,2),It=s(r(Q),2),$e=r(It,!0);a(It),a(Q);var X=s(Q,2),Et=s(r(X),2),Mt=r(Et),Pe=r(Mt,!0);a(Mt),a(Et),a(X);var Y=s(X,2),Ft=s(r(Y),2),De=r(Ft,!0);a(Ft),a(Y);var Z=s(Y,2),Tt=s(r(Z),2),tt=r(Tt),Ie=r(tt,!0);a(tt),a(Tt),a(Z);var et=s(Z,2),At=s(r(et),2),Ut=r(At),at=r(Ut),Ee=r(at,!0);a(at);var rt=s(at,2),Me=r(rt,!0);a(rt),a(Ut),a(At),a(et);var dt=s(et,2),St=s(r(dt),2),Fe=r(St,!0);a(St),a(dt);var Bt=s(dt,2),Nt=s(r(Bt),2),Te=r(Nt,!0);a(Nt),a(Bt),a(Pt),a($t),a(W);var Rt=s(W,2),Ct=r(Rt),Lt=s(r(Ct),2),st=r(Lt),Ot=s(r(st),2),Ae=r(Ot,!0);a(Ot),a(st);var it=s(st,2),Gt=s(r(it),2),Ue=r(Gt,!0);a(Gt),a(it);var ot=s(it,2),Jt=s(r(ot),2),Se=r(Jt);a(Jt),a(ot);var nt=s(ot,2),jt=s(r(nt),2),Be=r(jt,!0);a(jt),a(nt);var lt=s(nt,2),qt=s(r(lt),2),Ne=r(qt,!0);a(qt),a(lt);var vt=s(lt,2),zt=s(r(vt),2),Re=r(zt);a(zt),a(vt);var Ht=s(vt,2);{var Ce=v=>{var c=ca(),m=s(r(c),2),p=r(m,!0);a(m),a(c),b(()=>l(p,(t(e),i(()=>t(e)["github-runner-group"])))),u(v,c)};g(Ht,v=>{t(e),i(()=>t(e)["github-runner-group"])&&v(Ce)})}var Le=s(Ht,2);{var Oe=v=>{var c=xa(),m=s(r(c),2),p=r(m);aa(p,5,()=>(t(e),i(()=>t(e).tags)),ra,(I,$)=>{var ct=ma(),qe=r(ct,!0);a(ct),b(()=>l(qe,(t($),i(()=>typeof t($)=="string"?t($):t($).name)))),u(I,ct)}),a(p),a(m),a(c),u(v,c)};g(Le,v=>{t(e),i(()=>t(e).tags&&t(e).tags.length>0)&&v(Oe)})}a(Lt),a(Ct),a(Rt),a(V);var Vt=s(V,2);{var Ge=v=>{var c=ua(),m=r(c),p=s(r(m),2),I=r(p,!0);a(p),a(m),a(c),b($=>l(I,$),[()=>(t(e),i(()=>ve(t(e).extra_specs)))]),u(v,c)};g(Vt,v=>{t(e),i(()=>t(e).extra_specs)&&v(Ge)})}var Je=s(Vt,2);{var je=v=>{na(v,{get instances(){return t(e),i(()=>t(e).instances)},entityType:"repository",onDeleteInstance:le})};g(Je,v=>{t(e),i(()=>t(e).instances)&&v(je)})}b((v,c,m,p,I)=>{l(we,(t(e),i(()=>t(e).id))),l($e,(t(e),i(()=>t(e).provider_name))),l(Pe,(t(e),i(()=>t(e).image))),l(De,(t(e),i(()=>t(e).flavor))),da(tt,1,`inline-flex px-2 py-1 text-xs font-medium rounded-full ${t(e),i(()=>t(e).enabled?"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200":"bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200")??""}`),l(Ie,(t(e),i(()=>t(e).enabled?"Enabled":"Disabled"))),l(Ee,v),Qt(rt,"href",c),l(Me,m),l(Fe,p),l(Te,I),l(Ae,(t(e),i(()=>t(e).max_runners))),l(Ue,(t(e),i(()=>t(e).min_idle_runners))),l(Se,`${t(e),i(()=>t(e).runner_bootstrap_timeout)??""} minutes`),l(Be,(t(e),i(()=>t(e).priority))),l(Ne,(t(e),i(()=>t(e).runner_prefix||"garm"))),l(Re,`${t(e),i(()=>t(e).os_type)??""} / ${t(e),i(()=>t(e).os_arch)??""}`)},[()=>(f(R),t(e),i(()=>R(t(e)))),()=>(f(Zt),t(e),i(()=>Zt(t(e)))),()=>(f(P),t(e),i(()=>P(t(e)))),()=>(f(C),t(e),i(()=>C(t(e).created_at||""))),()=>(f(C),t(e),i(()=>C(t(e).updated_at||"")))]),u(H,kt)};g(U,H=>{t(e)&&H(z)},!0)}u(k,w)};g(_,k=>{t(M)?k(q):k(ke,!1)},!0)}u(d,o)};g(ge,d=>{t(O)?d(pe):d(fe,!1)})}a(G);var ht=s(G,2);{var _e=d=>{ia(d,{get pool(){return t(e)},$$events:{close:()=>n(F,!1),submit:o=>ie(o.detail)}})};g(ht,d=>{t(F)&&t(e)&&d(_e)})}var bt=s(ht,2);{var ye=d=>{{let o=B(()=>(t(e),f(P),i(()=>`Pool ${t(e).id} (${P(t(e))})`)));Yt(d,{title:"Delete Pool",message:"Are you sure you want to delete this pool? This action cannot be undone and will remove all associated runners.",get itemName(){return t(o)},$$events:{close:()=>n(T,!1),confirm:oe}})}};g(bt,d=>{t(T)&&t(e)&&d(ye)})}var he=s(bt,2);{var be=d=>{Yt(d,{title:"Delete Instance",message:"Are you sure you want to delete this instance? This action cannot be undone.",get itemName(){return t(x),i(()=>t(x).name)},$$events:{close:()=>{n(D,!1),n(x,null)},confirm:ne}})};g(he,d=>{t(D)&&t(x)&&d(be)})}b(()=>{Qt(xe,"href",`${xt}/pools`),l(ue,(t(e),i(()=>t(e)?t(e).id:"Loading...")))}),u(ee,gt),Ye(),de()}export{Ta as component}; diff --git a/webapp/assets/_app/immutable/nodes/15.CkHQugXH.js b/webapp/assets/_app/immutable/nodes/15.CkHQugXH.js new file mode 100644 index 00000000..2e6c5196 --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/15.CkHQugXH.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as Ee}from"../chunks/B3Pzt0F_.js";import{p as Me,E as Le,o as Te,l as w,s as r,m as a,g as e,y as T,a as Fe,f as S,k as l,j as c,r as u,c as F,t as K,v as fe,x as xe,u as j,z as $e,e as be,d as Se,h as Ne,b as ze,$ as Be,q as Re}from"../chunks/D8EpLgQ1.js";import{a as De,i as J,s as Ae}from"../chunks/5WA7h8uK.js";import{r as Q,b as Ce,g as oe}from"../chunks/CiE1LlKV.js";import{e as Oe,i as He}from"../chunks/u94nIB4-.js";import{b as ye,a as Pe}from"../chunks/C6k1Q4We.js";import{p as Je}from"../chunks/D4Caz1gY.js";import{M as Ve}from"../chunks/qB7B8uiS.js";import{F as Ye}from"../chunks/CNMHKIIK.js";import{e as Ie,a as ve}from"../chunks/wyaP0EDu.js";import{U as Ke}from"../chunks/CclkODgu.js";import{D as Qe}from"../chunks/KQ2xQpA3.js";import{P as Xe}from"../chunks/CO4LUyTP.js";import{t as X}from"../chunks/BEkVdVE1.js";import{k as Ze,g as et,c as tt,m as rt,p as ot}from"../chunks/BGVHQGl-.js";import{D as at,G as st,a as nt}from"../chunks/C9DJVOi1.js";import{E as it}from"../chunks/B7ITzBt8.js";import{E as lt}from"../chunks/CGpPw4EW.js";import{S as dt}from"../chunks/BE4wujub.js";import"../chunks/CoIRRsD9.js";var ct=S('

                '),ut=S('

                Loading...

                '),pt=S(""),mt=S(''),gt=S('

                Webhook secret will be automatically generated

                '),ft=S('
                '),bt=S('

                Create Repository

                ');function yt(ae,se){Me(se,!1);const[ne,ie]=Ae(),p=()=>De(Ie,"$eagerCache",ne),R=a(),k=a(),G=a(),x=a(),C=Le();let g=a(!1),f=a(""),b=a("github"),o=a({name:"",owner:"",credentials_name:"",webhook_secret:"",pool_balancer_type:"roundrobin"}),D=a(!0),d=a(!0);async function y(){if(!p().loaded.credentials&&!p().loading.credentials)try{await ve.getCredentials()}catch(s){r(f,s instanceof Error?s.message:"Failed to load credentials")}}function _(s){r(b,s.detail),T(o,e(o).credentials_name="")}function P(){if(e(o).credentials_name){const s=e(R).find(A=>A.name===e(o).credentials_name);s&&s.forge_type&&r(b,s.forge_type)}}function E(){const s=new Uint8Array(32);return crypto.getRandomValues(s),Array.from(s,A=>A.toString(16).padStart(2,"0")).join("")}Te(()=>{y()});async function le(){if(!e(o).name?.trim()){r(f,"Repository name is required");return}if(!e(o).owner?.trim()){r(f,"Repository owner is required");return}if(!e(o).credentials_name){r(f,"Please select credentials");return}try{r(g,!0),r(f,"");const s={...e(o),install_webhook:e(D),auto_generate_secret:e(d)};C("submit",s)}catch(s){r(f,s instanceof Error?s.message:"Failed to create repository"),r(g,!1)}}w(()=>p(),()=>{r(R,p().credentials)}),w(()=>p(),()=>{r(k,p().loading.credentials)}),w(()=>(e(R),e(b)),()=>{r(G,e(R).filter(s=>e(b)?s.forge_type===e(b):!0))}),w(()=>e(d),()=>{e(d)?T(o,e(o).webhook_secret=E()):e(d)||T(o,e(o).webhook_secret="")}),w(()=>(e(o),e(d)),()=>{r(x,e(o).name?.trim()!==""&&e(o).owner?.trim()!==""&&e(o).credentials_name!==""&&(e(d)||e(o).webhook_secret?.trim()!==""))}),Fe(),Ee(),Ve(ae,{$$events:{close:()=>C("close")},children:(s,A)=>{var M=bt(),Z=l(c(M),2);{var de=v=>{var h=ct(),I=c(h),W=c(I,!0);u(I),u(h),K(()=>fe(W,e(f))),F(v,h)};J(Z,v=>{e(f)&&v(de)})}var ce=l(Z,2);{var ue=v=>{var h=ut();F(v,h)},pe=v=>{var h=ft(),I=c(h);Ye(I,{get selectedForgeType(){return e(b)},set selectedForgeType(i){r(b,i)},$$events:{select:_},$$legacy:!0});var W=l(I,2),ee=l(c(W),2);Q(ee),u(W);var L=l(W,2),N=l(c(L),2);Q(N),u(L);var z=l(L,2),B=l(c(z),2);K(()=>{e(o),xe(()=>{e(G)})});var O=c(B);O.value=O.__value="";var me=l(O);Oe(me,1,()=>e(G),He,(i,m)=>{var U=pt(),Ge=c(U);u(U);var ke={};K(()=>{fe(Ge,`${e(m),j(()=>e(m).name)??""} (${e(m),j(()=>e(m).endpoint?.name)??""})`),ke!==(ke=(e(m),j(()=>e(m).name)))&&(U.value=(U.__value=(e(m),j(()=>e(m).name)))??"")}),F(i,U)}),u(B),u(z);var H=l(z,2),V=l(c(H),2);K(()=>{e(o),xe(()=>{})});var Y=c(V);Y.value=Y.__value="roundrobin";var te=l(Y);te.value=te.__value="pack",u(V),u(H);var t=l(H,2),n=c(t),re=c(n);Q(re),$e(2),u(n);var $=l(n,2),q=c($),he=c(q);Q(he),$e(2),u(q);var We=l(q,2);{var qe=i=>{var m=mt();Q(m),ye(m,()=>e(o).webhook_secret,U=>T(o,e(o).webhook_secret=U)),F(i,m)},Ue=i=>{var m=gt();F(i,m)};J(We,i=>{e(d)?i(Ue,!1):i(qe)})}u($),u(t);var _e=l(t,2),we=c(_e),ge=l(we,2),je=c(ge,!0);u(ge),u(_e),u(h),K(()=>{ge.disabled=e(g)||e(k)||!e(x),fe(je,e(g)?"Creating...":"Create Repository")}),ye(ee,()=>e(o).name,i=>T(o,e(o).name=i)),ye(N,()=>e(o).owner,i=>T(o,e(o).owner=i)),Ce(B,()=>e(o).credentials_name,i=>T(o,e(o).credentials_name=i)),be("change",B,P),Ce(V,()=>e(o).pool_balancer_type,i=>T(o,e(o).pool_balancer_type=i)),Pe(re,()=>e(D),i=>r(D,i)),Pe(he,()=>e(d),i=>r(d,i)),be("click",we,()=>C("close")),be("submit",h,Je(le)),F(v,h)};J(ce,v=>{e(g)?v(ue):v(pe,!1)})}u(M),F(s,M)},$$slots:{default:!0}}),Se(),ie()}var vt=S('
                ',1);function Gt(ae,se){Me(se,!1);const[ne,ie]=Ae(),p=()=>De(Ie,"$eagerCache",ne),R=a(),k=a(),G=a();let x=a([]),C=a(!0),g=a(""),f=a(""),b=a(!1),o=a(!1),D=a(!1),d=a(null),y=a(null),_=a(1),P=a(25),E=a(1);Te(async()=>{try{r(C,!0);const t=await ve.getRepositories();t&&Array.isArray(t)&&r(x,t)}catch(t){console.error("Failed to load repositories:",t),r(g,t instanceof Error?t.message:"Failed to load repositories")}finally{r(C,!1)}});async function le(){try{await ve.retryResource("repositories")}catch(t){console.error("Retry failed:",t)}}function s(t){r(d,t),r(o,!0)}function A(t){r(y,t),r(D,!0)}function M(){r(b,!1),r(o,!1),r(D,!1),r(d,null),r(y,null),r(g,"")}async function Z(t){try{r(g,"");const n=t.detail,re={name:n.name,owner:n.owner,credentials_name:n.credentials_name,webhook_secret:n.webhook_secret},$=await oe.createRepository(re);if(n.install_webhook&&$.id)try{await oe.installRepoWebhook($.id),X.success("Webhook Installed",`Webhook for repository ${$.owner}/${$.name} has been installed successfully.`)}catch(q){console.warn("Repository created but webhook installation failed:",q),X.error("Webhook Installation Failed",q instanceof Error?q.message:"Failed to install webhook. You can try installing it manually from the repository details page.")}r(b,!1),X.success("Repository Created",`Repository ${$.owner}/${$.name} has been created successfully.`)}catch(n){throw r(g,n instanceof Error?n.message:"Failed to create repository"),n}}async function de(t){if(e(d))try{await oe.updateRepository(e(d).id,t),X.success("Repository Updated",`Repository ${e(d).owner}/${e(d).name} has been updated successfully.`),M()}catch(n){throw n}}async function ce(){if(e(y))try{r(g,""),await oe.deleteRepository(e(y).id),X.success("Repository Deleted",`Repository ${e(y).owner}/${e(y).name} has been deleted successfully.`),M()}catch(t){r(g,t instanceof Error?t.message:"Failed to delete repository")}}const ue=[{key:"repository",title:"Repository",cellComponent:it,cellProps:{entityType:"repository",showOwner:!0}},{key:"endpoint",title:"Endpoint",cellComponent:lt},{key:"credentials",title:"Credentials",cellComponent:st,cellProps:{field:"credentials_name"}},{key:"status",title:"Status",cellComponent:dt,cellProps:{statusType:"entity"}},{key:"actions",title:"Actions",align:"right",cellComponent:nt}],pe={entityType:"repository",primaryText:{field:"name",isClickable:!0,href:"/repositories/{id}",showOwner:!0},customInfo:[{icon:t=>et(t?.endpoint?.endpoint_type||"unknown"),text:t=>t?.endpoint?.name||"Unknown"}],badges:[{type:"custom",value:t=>Ze(t)}],actions:[{type:"edit",handler:t=>s(t)},{type:"delete",handler:t=>A(t)}]};function v(t){r(f,t.detail.term),r(_,1)}function h(t){r(_,t.detail.page)}function I(t){const n=tt(t.detail.perPage);r(P,n.newPerPage),r(_,n.newCurrentPage)}function W(t){s(t.detail.item)}function ee(t){A(t.detail.item)}w(()=>(e(x),p()),()=>{(!e(x).length||p().loaded.repositories)&&r(x,p().repositories)}),w(()=>p(),()=>{r(C,p().loading.repositories)}),w(()=>p(),()=>{r(R,p().errorMessages.repositories)}),w(()=>(e(x),e(f)),()=>{r(k,rt(e(x),e(f)))}),w(()=>(e(E),e(k),e(P),e(_)),()=>{r(E,Math.ceil(e(k).length/e(P))),e(_)>e(E)&&e(E)>0&&r(_,e(E))}),w(()=>(e(k),e(_),e(P)),()=>{r(G,ot(e(k),e(_),e(P)))}),Fe(),Ee();var L=vt();Ne(t=>{Be.title="Repositories - GARM"});var N=ze(L),z=c(N);Xe(z,{title:"Repositories",description:"Manage your GitHub repositories and their runners",actionLabel:"Add Repository",$$events:{action:()=>{r(b,!0)}}});var B=l(z,2);{let t=Re(()=>e(R)||e(g)),n=Re(()=>!!e(R));at(B,{get columns(){return ue},get data(){return e(G)},get loading(){return e(C)},get error(){return e(t)},get searchTerm(){return e(f)},searchPlaceholder:"Search repositories by name or owner...",get currentPage(){return e(_)},get perPage(){return e(P)},get totalPages(){return e(E)},get totalItems(){return e(k),j(()=>e(k).length)},itemName:"repositories",emptyIconType:"building",get showRetry(){return e(n)},get mobileCardConfig(){return pe},$$events:{search:v,pageChange:h,perPageChange:I,retry:le,edit:W,delete:ee}})}u(N);var O=l(N,2);{var me=t=>{yt(t,{$$events:{close:()=>r(b,!1),submit:Z}})};J(O,t=>{e(b)&&t(me)})}var H=l(O,2);{var V=t=>{Ke(t,{get entity(){return e(d)},entityType:"repository",$$events:{close:M,submit:n=>de(n.detail)}})};J(H,t=>{e(o)&&e(d)&&t(V)})}var Y=l(H,2);{var te=t=>{Qe(t,{title:"Delete Repository",message:"Are you sure you want to delete this repository? This action cannot be undone and will remove all associated pools and runners.",get itemName(){return`${e(y),j(()=>e(y).owner)??""}/${e(y),j(()=>e(y).name)??""}`},$$events:{close:M,confirm:ce}})};J(Y,t=>{e(D)&&e(y)&&t(te)})}F(ae,L),Se(),ie()}export{Gt as component}; diff --git a/webapp/assets/_app/immutable/nodes/16.B35VVkOd.js b/webapp/assets/_app/immutable/nodes/16.B35VVkOd.js new file mode 100644 index 00000000..5ee0941c --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/16.B35VVkOd.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as We}from"../chunks/B3Pzt0F_.js";import{p as qe,o as ze,A as He,l as je,a as Ge,f as A,h as Oe,b as M,t as z,c as w,d as Ve,g as e,m as l,s as r,u as s,$ as Je,j as u,r as f,k as d,v as le,y as Ke,B as de,q as m,n as Qe}from"../chunks/D8EpLgQ1.js";import{i as g,s as Xe,a as Ye}from"../chunks/5WA7h8uK.js";import{c as Ze,g as h}from"../chunks/CiE1LlKV.js";import{p as et}from"../chunks/C41YH50Q.js";import{g as ce}from"../chunks/CTf6mQoE.js";import{b as H}from"../chunks/CoIRRsD9.js";import{U as tt}from"../chunks/CclkODgu.js";import{D as pe}from"../chunks/KQ2xQpA3.js";import{E as ot,P as at,a as rt}from"../chunks/BmGWMSQm.js";import{D as st,I as nt}from"../chunks/DDhBTdDt.js";import{g as ue}from"../chunks/BGVHQGl-.js";import{W as it}from"../chunks/Dbd6PPbz.js";import{C as lt}from"../chunks/CwqI2jFH.js";import{w as j}from"../chunks/u94nIB4-.js";import{t as C}from"../chunks/BEkVdVE1.js";var dt=A('

                Loading repository...

                '),ct=A('

                '),pt=A(" ",1),ut=A(' ',1);function kt(fe,me){qe(me,!1);const[ye,ve]=Xe(),G=()=>Ye(et,"$page",ye),x=l();let t=l(null),c=l([]),y=l([]),F=l(!0),I=l(""),R=l(!1),D=l(!1),E=l(!1),T=l(!1),p=l(null),P=null,_=l();async function O(){if(e(x))try{r(F,!0),r(I,"");const[o,a,n]=await Promise.all([h.getRepository(e(x)),h.listRepositoryPools(e(x)).catch(()=>[]),h.listRepositoryInstances(e(x)).catch(()=>[])]);r(t,o),r(c,a),r(y,n)}catch(o){r(I,o instanceof Error?o.message:"Failed to load repository")}finally{r(F,!1)}}function ge(o,a){const{events:n}=o;return{...a,events:n}}async function he(o){if(e(t))try{await h.updateRepository(e(t).id,o),await O(),C.success("Repository Updated",`Repository ${e(t).owner}/${e(t).name} has been updated successfully.`),r(R,!1)}catch(a){throw a}}async function _e(){if(e(t)){try{await h.deleteRepository(e(t).id),ce(`${H}/repositories`)}catch(o){r(I,o instanceof Error?o.message:"Failed to delete repository")}r(D,!1)}}async function $e(){if(e(p))try{await h.deleteInstance(e(p).name),C.success("Instance Deleted",`Instance ${e(p).name} has been deleted successfully.`),r(E,!1),r(p,null)}catch(o){const a=o instanceof Error?o.message:"Failed to delete instance";C.error("Delete Failed",a),r(E,!1),r(p,null)}}function be(o){r(p,o),r(E,!0)}function we(){r(T,!0)}async function xe(o){try{if(!e(t))return;await h.createRepositoryPool(e(t).id,o.detail),C.success("Pool Created",`Pool has been created successfully for repository ${e(t).owner}/${e(t).name}.`),r(T,!1)}catch(a){throw a}}function V(){e(_)&&Ke(_,e(_).scrollTop=e(_).scrollHeight)}function Ie(o){if(o.operation==="update"){const a=o.payload;if(e(t)&&a.id===e(t).id){const n=e(t).events?.length||0,i=a.events?.length||0;r(t,ge(e(t),a)),i>n&&setTimeout(()=>{V()},100)}}else if(o.operation==="delete"){const a=o.payload.id||o.payload;e(t)&&e(t).id===a&&ce(`${H}/repositories`)}}function Ee(o){if(!e(t))return;const a=o.payload;if(a.repo_id===e(t).id){if(o.operation==="create")r(c,[...e(c),a]);else if(o.operation==="update")r(c,e(c).map(n=>n.id===a.id?a:n));else if(o.operation==="delete"){const n=a.id||a;r(c,e(c).filter(i=>i.id!==n))}}}function Re(o){if(!e(t)||!e(c))return;const a=o.payload;if(e(c).some(i=>i.id===a.pool_id)){if(o.operation==="create")r(y,[...e(y),a]);else if(o.operation==="update")r(y,e(y).map(i=>i.id===a.id?a:i));else if(o.operation==="delete"){const i=a.id||a;r(y,e(y).filter(L=>L.id!==i))}}}ze(()=>{O().then(()=>{e(t)?.events?.length&&setTimeout(()=>{V()},100)});const o=j.subscribeToEntity("repository",["update","delete"],Ie),a=j.subscribeToEntity("pool",["create","update","delete"],Ee),n=j.subscribeToEntity("instance",["create","update","delete"],Re);P=()=>{o(),a(),n()}}),He(()=>{P&&(P(),P=null)}),je(()=>G(),()=>{r(x,G().params.id)}),Ge(),We();var J=ut();Oe(o=>{z(()=>Je.title=`${e(t),s(()=>e(t)?`${e(t).name} - Repository Details`:"Repository Details")??""} - GARM`)});var S=M(J),B=u(S),K=u(B),U=u(K),De=u(U);f(U);var Q=d(U,2),X=u(Q),Y=d(u(X),2),Te=u(Y,!0);f(Y),f(X),f(Q),f(K),f(B);var Pe=d(B,2);{var ke=o=>{var a=dt();w(o,a)},Me=o=>{var a=de(),n=M(a);{var i=$=>{var b=ct(),k=u(b),N=u(k,!0);f(k),f(b),z(()=>le(N,e(I))),w($,b)},L=$=>{var b=de(),k=M(b);{var N=W=>{var oe=pt(),ae=M(oe);{let v=m(()=>(e(t),s(()=>e(t).name||"Repository"))),q=m(()=>(e(t),s(()=>e(t).owner))),Le=m(()=>(e(t),s(()=>e(t).endpoint?.name))),Ne=m(()=>(Qe(ue),e(t),s(()=>ue(e(t).endpoint?.endpoint_type||"unknown"))));st(ae,{get title(){return e(v)},get subtitle(){return`Owner: ${e(q)??""} • Endpoint: ${e(Le)??""}`},get forgeIcon(){return e(Ne)},onEdit:()=>r(R,!0),onDelete:()=>r(D,!0)})}var re=d(ae,2);ot(re,{get entity(){return e(t)},entityType:"repository"});var se=d(re,2);{let v=m(()=>(e(t),s(()=>e(t).id||"")));it(se,{entityType:"repository",get entityId(){return e(v)},get entityName(){return`${e(t),s(()=>e(t).owner)??""}/${e(t),s(()=>e(t).name)??""}`}})}var ne=d(se,2);{let v=m(()=>(e(t),s(()=>e(t).id||"")));at(ne,{get pools(){return e(c)},entityType:"repository",get entityId(){return e(v)},get entityName(){return`${e(t),s(()=>e(t).owner)??""}/${e(t),s(()=>e(t).name)??""}`},$$events:{addPool:we}})}var ie=d(ne,2);nt(ie,{get instances(){return e(y)},entityType:"repository",onDeleteInstance:be});var Ue=d(ie,2);{let v=m(()=>(e(t),s(()=>e(t)?.events)));rt(Ue,{get events(){return e(v)},get eventsContainer(){return e(_)},set eventsContainer(q){r(_,q)},$$legacy:!0})}w(W,oe)};g(k,W=>{e(t)&&W(N)},!0)}w($,b)};g(n,$=>{e(I)?$(i):$(L,!1)},!0)}w(o,a)};g(Pe,o=>{e(F)?o(ke):o(Me,!1)})}f(S);var Z=d(S,2);{var Ce=o=>{tt(o,{get entity(){return e(t)},entityType:"repository",$$events:{close:()=>r(R,!1),submit:a=>he(a.detail)}})};g(Z,o=>{e(R)&&e(t)&&o(Ce)})}var ee=d(Z,2);{var Ae=o=>{{let a=m(()=>(e(t),s(()=>`${e(t).owner}/${e(t).name}`)));pe(o,{title:"Delete Repository",message:"Are you sure you want to delete this repository? This action cannot be undone and will remove all associated pools and instances.",get itemName(){return e(a)},$$events:{close:()=>r(D,!1),confirm:_e}})}};g(ee,o=>{e(D)&&e(t)&&o(Ae)})}var te=d(ee,2);{var Fe=o=>{pe(o,{title:"Delete Instance",message:"Are you sure you want to delete this instance? This action cannot be undone.",get itemName(){return e(p),s(()=>e(p).name)},$$events:{close:()=>{r(E,!1),r(p,null)},confirm:$e}})};g(te,o=>{e(E)&&e(p)&&o(Fe)})}var Se=d(te,2);{var Be=o=>{{let a=m(()=>(e(t),s(()=>e(t).id||"")));lt(o,{initialEntityType:"repository",get initialEntityId(){return e(a)},$$events:{close:()=>r(T,!1),submit:xe}})}};g(Se,o=>{e(T)&&e(t)&&o(Be)})}z(()=>{Ze(De,"href",`${H}/repositories`),le(Te,(e(t),s(()=>e(t)?e(t).name:"Loading...")))}),w(fe,J),Ve(),ve()}export{kt as component}; diff --git a/webapp/assets/_app/immutable/nodes/17.CCltcs-Z.js b/webapp/assets/_app/immutable/nodes/17.CCltcs-Z.js new file mode 100644 index 00000000..731517fe --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/17.CCltcs-Z.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as yr}from"../chunks/B3Pzt0F_.js";import{p as hr,E as Gr,o as xr,f as w,k as a,j as o,g as e,m as i,r as s,t as k,s as r,e as de,c as f,v as X,b as kr,z as br,x as ye,D as qe,d as _r,l as U,a as Hr,h as jr,$ as Fr,q as Oe,u as mr,n as Nr}from"../chunks/D8EpLgQ1.js";import{i as D,s as Ur,a as qr}from"../chunks/5WA7h8uK.js";import{r as T,s as Le,b as he,g as R}from"../chunks/CiE1LlKV.js";import"../chunks/CoIRRsD9.js";import{P as Or}from"../chunks/CO4LUyTP.js";import{e as pr,i as vr}from"../chunks/u94nIB4-.js";import{b as H,a as Lr}from"../chunks/C6k1Q4We.js";import{p as Br}from"../chunks/D4Caz1gY.js";import{M as Jr}from"../chunks/qB7B8uiS.js";import{J as Vr}from"../chunks/DZblzgqm.js";import{U as Wr}from"../chunks/C89fcOde.js";import{D as Kr}from"../chunks/KQ2xQpA3.js";import{e as Qr,a as fr}from"../chunks/wyaP0EDu.js";import{t as Be}from"../chunks/BEkVdVE1.js";import{e as ne,h as Xr}from"../chunks/BGVHQGl-.js";import{D as Yr,G as Je,a as Zr}from"../chunks/C9DJVOi1.js";import{E as et}from"../chunks/B7ITzBt8.js";import{E as rt}from"../chunks/CGpPw4EW.js";import{S as tt}from"../chunks/BE4wujub.js";import{P as at}from"../chunks/CLYUNKnN.js";var ot=w('

                '),st=w('
                '),lt=w(""),it=w(''),dt=w('
                '),nt=w(""),ct=w(''),ut=w('

                Entity & Provider Configuration

                Image & OS Configuration

                Runner Limits & Timing

                Advanced Settings

                Extra Specs (JSON)
                ',1),gt=w('
                Creating...
                '),bt=w('

                Create New Scale Set

                Scale sets are only available for GitHub endpoints

                Entity Level *
                ');function mt(xe,ke){hr(ke,!1);const Y=Gr();let q=i(!1),m=i(""),n=i(""),v=i([]),S=i([]),O=i(!1),C=i(!1),$=i(""),p=i(""),_=i(""),u=i(""),y=i(""),A=i(void 0),z=i(void 0),I=i(void 0),d=i("garm"),L=i("linux"),B=i("amd64"),Z=i(""),ee=i(!0),G=i("{}");async function ce(){try{r(C,!0),r(S,await R.listProviders())}catch(c){r(m,c instanceof Error?c.message:"Failed to load providers")}finally{r(C,!1)}}async function _e(){if(e(n))try{switch(r(O,!0),r(v,[]),e(n)){case"repository":r(v,await R.listRepositories());break;case"organization":r(v,await R.listOrganizations());break;case"enterprise":r(v,await R.listEnterprises());break}}catch(c){r(m,c instanceof Error?c.message:`Failed to load ${e(n)}s`)}finally{r(O,!1)}}function re(c){e(n)!==c&&(r(n,c),r(p,""),_e())}async function we(){if(!e($)||!e(n)||!e(p)||!e(_)||!e(u)||!e(y)){r(m,"Please fill in all required fields");return}try{r(q,!0),r(m,"");let c={};if(e(G).trim())try{c=JSON.parse(e(G))}catch{throw new Error("Invalid JSON in extra specs")}const J={name:e($),provider_name:e(_),image:e(u),flavor:e(y),max_runners:e(A)||10,min_idle_runners:e(z)||0,runner_bootstrap_timeout:e(I)||20,runner_prefix:e(d),os_type:e(L),os_arch:e(B),"github-runner-group":e(Z)||void 0,enabled:e(ee),extra_specs:e(G).trim()?c:void 0};let E;switch(e(n)){case"repository":E=await R.createRepositoryScaleSet(e(p),J);break;case"organization":E=await R.createOrganizationScaleSet(e(p),J);break;case"enterprise":E=await R.createEnterpriseScaleSet(e(p),J);break;default:throw new Error("Invalid entity level selected")}Y("submit",E)}catch(c){r(m,c instanceof Error?c.message:"Failed to create scale set")}finally{r(q,!1)}}xr(()=>{ce()}),yr(),Jr(xe,{$$events:{close:()=>Y("close")},children:(c,J)=>{var E=bt(),V=a(o(E),2),ue=o(V);{var ge=b=>{var P=ot(),K=o(P),ve=o(K,!0);s(K),s(P),k(()=>X(ve,e(m))),f(b,P)};D(ue,b=>{e(m)&&b(ge)})}var j=a(ue,2),te=a(o(j),2);T(te),s(j);var ae=a(j,2),oe=o(ae),be=a(o(oe),2),W=o(be),se=a(W,2),me=a(se,2);s(be),s(oe),s(ae);var pe=a(ae,2);{var t=b=>{var P=ut(),K=kr(P),ve=a(o(K),2),Ce=o(ve),$e=o(Ce),$r=o($e);br(),s($e);var Er=a($e,2);{var Pr=l=>{var h=st();f(l,h)},Mr=l=>{var h=it();k(()=>{e(p),ye(()=>{e(n),e(v)})});var M=o(h),Ue=o(M);s(M),M.value=M.__value="";var le=a(M);pr(le,1,()=>e(v),vr,(F,x)=>{var N=lt(),fe=o(N);{var zr=Q=>{var ie=qe();k(()=>X(ie,`${e(x).owner??""}/${e(x).name??""} (${e(x).endpoint?.name||"Unknown endpoint"})`)),f(Q,ie)},Ir=Q=>{var ie=qe();k(()=>X(ie,`${e(x).name??""} (${e(x).endpoint?.name||"Unknown endpoint"})`)),f(Q,ie)};D(fe,Q=>{e(n)==="repository"?Q(zr):Q(Ir,!1)})}s(N);var gr={};k(()=>{gr!==(gr=e(x).id)&&(N.value=(N.__value=e(x).id)??"")}),f(F,N)}),s(h),k(()=>X(Ue,`Select a ${e(n)??""}`)),he(h,()=>e(p),F=>r(p,F)),f(l,h)};D(Er,l=>{e(O)?l(Pr):l(Mr,!1)})}s(Ce);var We=a(Ce,2),Tr=a(o(We),2);{var Rr=l=>{var h=dt();f(l,h)},Dr=l=>{var h=ct();k(()=>{e(_),ye(()=>{e(S)})});var M=o(h);M.value=M.__value="";var Ue=a(M);pr(Ue,1,()=>e(S),vr,(le,F)=>{var x=nt(),N=o(x,!0);s(x);var fe={};k(()=>{X(N,e(F).name),fe!==(fe=e(F).name)&&(x.value=(x.__value=e(F).name)??"")}),f(le,x)}),s(h),he(h,()=>e(_),le=>r(_,le)),f(l,h)};D(Tr,l=>{e(C)?l(Rr):l(Dr,!1)})}s(We),s(ve),s(K);var Ee=a(K,2),Ke=a(o(Ee),2),Pe=o(Ke),Qe=a(o(Pe),2);T(Qe),s(Pe);var Me=a(Pe,2),Xe=a(o(Me),2);T(Xe),s(Me);var Te=a(Me,2),Re=a(o(Te),2);k(()=>{e(L),ye(()=>{})});var De=o(Re);De.value=De.__value="linux";var Ye=a(De);Ye.value=Ye.__value="windows",s(Re),s(Te);var Ze=a(Te,2),Ae=a(o(Ze),2);k(()=>{e(B),ye(()=>{})});var ze=o(Ae);ze.value=ze.__value="amd64";var er=a(ze);er.value=er.__value="arm64",s(Ae),s(Ze),s(Ke),s(Ee);var Ie=a(Ee,2),rr=a(o(Ie),2),Ge=o(rr),tr=a(o(Ge),2);T(tr),s(Ge);var He=a(Ge,2),ar=a(o(He),2);T(ar),s(He);var or=a(He,2),sr=a(o(or),2);T(sr),s(or),s(rr),s(Ie);var lr=a(Ie,2),je=a(o(lr),2),Fe=o(je),ir=a(o(Fe),2);T(ir),s(Fe);var dr=a(Fe,2),nr=a(o(dr),2);T(nr),s(dr),s(je);var Ne=a(je,2),Ar=a(o(Ne),2);Vr(Ar,{rows:4,placeholder:"{}",get value(){return e(G)},set value(l){r(G,l)},$$legacy:!0}),s(Ne);var cr=a(Ne,2),ur=o(cr);T(ur),br(2),s(cr),s(lr),k(l=>X($r,`${l??""} `),[()=>e(n).charAt(0).toUpperCase()+e(n).slice(1)]),H(Qe,()=>e(u),l=>r(u,l)),H(Xe,()=>e(y),l=>r(y,l)),he(Re,()=>e(L),l=>r(L,l)),he(Ae,()=>e(B),l=>r(B,l)),H(tr,()=>e(z),l=>r(z,l)),H(ar,()=>e(A),l=>r(A,l)),H(sr,()=>e(I),l=>r(I,l)),H(ir,()=>e(d),l=>r(d,l)),H(nr,()=>e(Z),l=>r(Z,l)),Lr(ur,()=>e(ee),l=>r(ee,l)),f(b,P)};D(pe,b=>{e(n)&&b(t)})}var g=a(pe,2),Ve=o(g),Se=a(Ve,2),wr=o(Se);{var Sr=b=>{var P=gt();f(b,P)},Cr=b=>{var P=qe("Create Scale Set");f(b,P)};D(wr,b=>{e(q)?b(Sr):b(Cr,!1)})}s(Se),s(g),s(V),s(E),k(()=>{Le(W,1,`flex flex-col items-center justify-center p-4 border-2 rounded-lg transition-colors cursor-pointer ${e(n)==="repository"?"border-blue-500 bg-blue-50 dark:bg-blue-900":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`),Le(se,1,`flex flex-col items-center justify-center p-4 border-2 rounded-lg transition-colors cursor-pointer ${e(n)==="organization"?"border-blue-500 bg-blue-50 dark:bg-blue-900":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`),Le(me,1,`flex flex-col items-center justify-center p-4 border-2 rounded-lg transition-colors cursor-pointer ${e(n)==="enterprise"?"border-blue-500 bg-blue-50 dark:bg-blue-900":"border-gray-300 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-500"}`),Se.disabled=e(q)||!e($)||!e(n)||!e(p)||!e(_)||!e(u)||!e(y)}),H(te,()=>e($),b=>r($,b)),de("click",W,()=>re("repository")),de("click",se,()=>re("organization")),de("click",me,()=>re("enterprise")),de("click",Ve,()=>Y("close")),de("submit",V,Br(we)),f(c,E)},$$slots:{default:!0}}),_r()}var pt=w('
                ',1);function jt(xe,ke){hr(ke,!1);const[Y,q]=Ur(),m=()=>qr(Qr,"$eagerCache",Y),n=i(),v=i(),S=i(),O=i();let C=i([]),$=i(!0),p=i(""),_=i(""),u=i(1),y=i(25),A=i(!1),z=i(!1),I=i(!1),d=i(null);async function L(t){try{r(p,""),r(A,!1),Be.success("Scale Set Created","Scale set has been created successfully.")}catch(g){throw r(p,g instanceof Error?g.message:"Failed to create scale set"),g}}async function B(t){if(e(d))try{await R.updateScaleSet(e(d).id,t),Be.success("Scale Set Updated",`Scale set ${e(d).name} has been updated successfully.`),r(z,!1),r(d,null)}catch(g){throw g}}async function Z(){if(e(d))try{await R.deleteScaleSet(e(d).id),Be.success("Scale Set Deleted",`Scale set ${e(d).name} has been deleted successfully.`),r(I,!1),r(d,null)}catch(t){r(p,t instanceof Error?t.message:"Failed to delete scale set")}}function ee(){r(A,!0)}function G(t){r(d,t),r(z,!0)}function ce(t){r(d,t),r(I,!0)}xr(async()=>{try{r($,!0);const t=await fr.getScaleSets();t&&Array.isArray(t)&&r(C,t)}catch(t){console.error("Failed to load scale sets:",t),r(p,t instanceof Error?t.message:"Failed to load scale sets")}finally{r($,!1)}});async function _e(){try{await fr.retryResource("scalesets")}catch(t){console.error("Retry failed:",t)}}const re=[{key:"name",title:"Name",cellComponent:et,cellProps:{entityType:"scaleset"}},{key:"image",title:"Image",cellComponent:Je,cellProps:{field:"image",type:"code",showTitle:!0}},{key:"provider",title:"Provider",cellComponent:Je,cellProps:{field:"provider_name"}},{key:"flavor",title:"Flavor",cellComponent:Je,cellProps:{field:"flavor"}},{key:"entity",title:"Entity",cellComponent:at},{key:"endpoint",title:"Endpoint",cellComponent:rt},{key:"status",title:"Status",cellComponent:tt,cellProps:{statusType:"enabled"}},{key:"actions",title:"Actions",align:"right",cellComponent:Zr}],we={entityType:"scaleset",primaryText:{field:"name",isClickable:!0,href:"/scalesets/{id}"},secondaryText:{field:"entity_name",computedValue:t=>ne(t)},badges:[{type:"custom",value:t=>({variant:t.enabled?"success":"error",text:t.enabled?"Enabled":"Disabled"})}],actions:[{type:"edit",handler:t=>G(t)},{type:"delete",handler:t=>ce(t)}]};function c(t){r(_,t.detail.term),r(u,1)}function J(t){r(u,t.detail.page)}function E(t){r(y,t.detail.perPage),r(u,1)}function V(t){G(t.detail.item)}function ue(t){ce(t.detail.item)}U(()=>(e(C),m()),()=>{(!e(C).length||m().loaded.scalesets)&&r(C,m().scalesets)}),U(()=>m(),()=>{r($,m().loading.scalesets)}),U(()=>m(),()=>{r(n,m().errorMessages.scalesets)}),U(()=>(e(C),e(_),ne),()=>{r(v,Xr(e(C),e(_),t=>ne(t)))}),U(()=>(e(v),e(y)),()=>{r(S,Math.ceil(e(v).length/e(y)))}),U(()=>(e(u),e(S)),()=>{e(u)>e(S)&&e(S)>0&&r(u,e(S))}),U(()=>(e(v),e(u),e(y)),()=>{r(O,e(v).slice((e(u)-1)*e(y),e(u)*e(y)))}),Hr(),yr();var ge=pt();jr(t=>{Fr.title="Scale Sets - GARM"});var j=kr(ge),te=o(j);Or(te,{title:"Scale Sets",description:"Manage GitHub runner scale sets",actionLabel:"Add Scale Set",$$events:{action:ee}});var ae=a(te,2);{let t=Oe(()=>e(n)||e(p)),g=Oe(()=>!!e(n));Yr(ae,{get columns(){return re},get data(){return e(O)},get loading(){return e($)},get error(){return e(t)},get searchTerm(){return e(_)},searchPlaceholder:"Search by entity name...",get currentPage(){return e(u)},get perPage(){return e(y)},get totalPages(){return e(S)},get totalItems(){return e(v),mr(()=>e(v).length)},itemName:"scale sets",emptyIconType:"cog",get showRetry(){return e(g)},get mobileCardConfig(){return we},$$events:{search:c,pageChange:J,perPageChange:E,retry:_e,edit:V,delete:ue}})}s(j);var oe=a(j,2);{var be=t=>{mt(t,{$$events:{close:()=>r(A,!1),submit:g=>L(g.detail)}})};D(oe,t=>{e(A)&&t(be)})}var W=a(oe,2);{var se=t=>{Wr(t,{get scaleSet(){return e(d)},$$events:{close:()=>{r(z,!1),r(d,null)},submit:g=>B(g.detail)}})};D(W,t=>{e(z)&&e(d)&&t(se)})}var me=a(W,2);{var pe=t=>{{let g=Oe(()=>(e(d),Nr(ne),mr(()=>`Scale Set ${e(d).name} (${ne(e(d))})`)));Kr(t,{title:"Delete Scale Set",message:"Are you sure you want to delete this scale set? This action cannot be undone and will remove all associated runners.",get itemName(){return e(g)},$$events:{close:()=>{r(I,!1),r(d,null)},confirm:Z}})}};D(me,t=>{e(I)&&e(d)&&t(pe)})}f(xe,ge),_r(),q()}export{jt as component}; diff --git a/webapp/assets/_app/immutable/nodes/18.iVIhGVtu.js b/webapp/assets/_app/immutable/nodes/18.iVIhGVtu.js new file mode 100644 index 00000000..ad26b0dc --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/18.iVIhGVtu.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as Ht}from"../chunks/B3Pzt0F_.js";import{p as Jt,o as jt,A as qt,l as zt,a as Pt,f as w,h as Vt,b as F,t as k,c as p,d as Wt,s as l,m as _,u as i,$ as Kt,g as e,j as a,r,k as d,v as o,y as ve,B as Pe,q as I,n as x}from"../chunks/D8EpLgQ1.js";import{i as g,s as Qt,a as Xt}from"../chunks/5WA7h8uK.js";import{c as Ve,g as U,s as Yt}from"../chunks/CiE1LlKV.js";import{p as Zt}from"../chunks/C41YH50Q.js";import{g as We}from"../chunks/CTf6mQoE.js";import{b as me}from"../chunks/CoIRRsD9.js";import{U as ea}from"../chunks/C89fcOde.js";import{D as Ke}from"../chunks/KQ2xQpA3.js";import{D as ta,I as aa}from"../chunks/DDhBTdDt.js";import{w as Qe}from"../chunks/u94nIB4-.js";import{t as B}from"../chunks/BEkVdVE1.js";import{e as S,i as R,j as Xe,b as C,g as Ye}from"../chunks/BGVHQGl-.js";var ra=w('

                Loading scale set...

                '),sa=w('

                '),da=w('
                GitHub Runner Group
                '),ia=w('

                Extra Specifications

                 
                '),na=w('

                Basic Information

                Scale Set ID
                Name
                Provider
                Image
                Flavor
                Status
                Entity
                Created At
                Updated At

                Configuration

                Max Runners
                Min Idle Runners
                Bootstrap Timeout
                Runner Prefix
                OS Type / Architecture
                ',1),la=w(' ',1);function Sa(Ze,et){Jt(et,!1);const[tt,at]=Qt(),ue=()=>Xt(Zt,"$page",tt),D=_();let t=_(null),G=_(!0),E=_(""),M=_(!1),N=_(!1),$=_(!1),m=_(null),A=null;async function L(){if(!(!e(D)||isNaN(e(D))))try{l(G,!0),l(E,""),l(t,await U.getScaleSet(e(D)))}catch(s){l(E,s instanceof Error?s.message:"Failed to load scale set")}finally{l(G,!1)}}async function rt(s){if(e(t))try{await U.updateScaleSet(e(t).id,s),await L(),B.success("Scale Set Updated",`Scale Set ${e(t).name} has been updated successfully.`),l(M,!1)}catch(n){throw n}}async function st(){if(e(t)){try{await U.deleteScaleSet(e(t).id),We(`${me}/scalesets`)}catch(s){const n=s instanceof Error?s.message:"Failed to delete scale set";B.error("Delete Failed",n)}l(N,!1)}}async function dt(){if(e(m)){try{await U.deleteInstance(e(m).name),B.success("Instance Deleted",`Instance ${e(m).name} has been deleted successfully.`),await L(),l($,!1),l(m,null)}catch(s){const n=s instanceof Error?s.message:"Failed to delete instance";B.error("Delete Failed",n)}l($,!1),l(m,null)}}function it(s){l(m,s),l($,!0)}function nt(s){if(!s)return"{}";try{if(typeof s=="string"){const n=JSON.parse(s);return JSON.stringify(n,null,2)}return JSON.stringify(s,null,2)}catch{return s.toString()}}function lt(s){if(s.operation==="update"){const n=s.payload;e(t)&&n.id===e(t).id&&l(t,n)}else if(s.operation==="delete"){const n=s.payload.id||s.payload;e(t)&&e(t).id===n&&We(`${me}/scalesets`)}}function ot(s){if(!e(t)||!e(t).instances)return;const n=s.payload;if(n.scale_set_id===e(t).id){if(s.operation==="create")ve(t,e(t).instances=[...e(t).instances,n]);else if(s.operation==="update")ve(t,e(t).instances=e(t).instances.map(y=>y.id===n.id?n:y));else if(s.operation==="delete"){const y=n.id||n;ve(t,e(t).instances=e(t).instances.filter(j=>j.id!==y))}l(t,e(t))}}jt(()=>{L();const s=Qe.subscribeToEntity("scaleset",["update","delete"],lt),n=Qe.subscribeToEntity("instance",["create","update","delete"],ot);A=()=>{s(),n()}}),qt(()=>{A&&(A(),A=null)}),zt(()=>ue(),()=>{l(D,parseInt(ue().params.id||"0"))}),Pt(),Ht();var xe=la();Vt(s=>{k(()=>Kt.title=`${e(t),i(()=>e(t)?`${e(t).name} - Scale Set Details`:"Scale Set Details")??""} - GARM`)});var O=F(xe),H=a(O),ge=a(H),J=a(ge),ct=a(J);r(J);var fe=d(J,2),pe=a(fe),_e=d(a(pe),2),vt=a(_e,!0);r(_e),r(pe),r(fe),r(ge),r(H);var mt=d(H,2);{var ut=s=>{var n=ra();p(s,n)},xt=s=>{var n=Pe(),y=F(n);{var j=h=>{var b=sa(),T=a(b),q=a(T,!0);r(T),r(b),k(()=>o(q,e(E))),p(h,b)},yt=h=>{var b=Pe(),T=F(b);{var q=z=>{var be=na(),ke=F(be);{let c=I(()=>(e(t),i(()=>e(t).name||"Scale Set"))),v=I(()=>(x(S),e(t),i(()=>S(e(t))))),u=I(()=>(x(R),e(t),i(()=>R(e(t))))),f=I(()=>(x(Ye),i(()=>Ye("github"))));ta(ke,{get title(){return e(c)},get subtitle(){return`Scale set for ${e(v)??""} (${e(u)??""}) • GitHub Runner Scale Set`},get forgeIcon(){return e(f)},onEdit:()=>l(M,!0),onDelete:()=>l(N,!0)})}var P=d(ke,2),V=a(P),Se=a(V),we=d(a(Se),2),W=a(we),$e=d(a(W),2),ht=a($e,!0);r($e),r(W);var K=d(W,2),Ie=d(a(K),2),bt=a(Ie,!0);r(Ie),r(K);var Q=d(K,2),De=d(a(Q),2),kt=a(De,!0);r(De),r(Q);var X=d(Q,2),Ee=d(a(X),2),Me=a(Ee),St=a(Me,!0);r(Me),r(Ee),r(X);var Y=d(X,2),Ne=d(a(Y),2),wt=a(Ne,!0);r(Ne),r(Y);var Z=d(Y,2),Ae=d(a(Z),2),ee=a(Ae),$t=a(ee,!0);r(ee),r(Ae),r(Z);var te=d(Z,2),Te=d(a(te),2),Fe=a(Te),ae=a(Fe),It=a(ae,!0);r(ae);var re=d(ae,2),Dt=a(re,!0);r(re),r(Fe),r(Te),r(te);var se=d(te,2),Ue=d(a(se),2),Et=a(Ue,!0);r(Ue),r(se);var Be=d(se,2),Re=d(a(Be),2),Mt=a(Re,!0);r(Re),r(Be),r(we),r(Se),r(V);var Ce=d(V,2),Ge=a(Ce),Le=d(a(Ge),2),de=a(Le),Oe=d(a(de),2),Nt=a(Oe,!0);r(Oe),r(de);var ie=d(de,2),He=d(a(ie),2),At=a(He,!0);r(He),r(ie);var ne=d(ie,2),Je=d(a(ne),2),Tt=a(Je);r(Je),r(ne);var le=d(ne,2),je=d(a(le),2),Ft=a(je,!0);r(je),r(le);var oe=d(le,2),qe=d(a(oe),2),Ut=a(qe);r(qe),r(oe);var Bt=d(oe,2);{var Rt=c=>{var v=da(),u=d(a(v),2),f=a(u,!0);r(u),r(v),k(()=>o(f,(e(t),i(()=>e(t)["github-runner-group"])))),p(c,v)};g(Bt,c=>{e(t),i(()=>e(t)["github-runner-group"])&&c(Rt)})}r(Le),r(Ge),r(Ce),r(P);var ze=d(P,2);{var Ct=c=>{var v=ia(),u=a(v),f=d(a(u),2),ce=a(f,!0);r(f),r(u),r(v),k(Ot=>o(ce,Ot),[()=>(e(t),i(()=>nt(e(t).extra_specs)))]),p(c,v)};g(ze,c=>{e(t),i(()=>e(t).extra_specs)&&c(Ct)})}var Gt=d(ze,2);{var Lt=c=>{aa(c,{get instances(){return e(t),i(()=>e(t).instances)},entityType:"scaleset",onDeleteInstance:it})};g(Gt,c=>{e(t),i(()=>e(t).instances)&&c(Lt)})}k((c,v,u,f,ce)=>{o(ht,(e(t),i(()=>e(t).id))),o(bt,(e(t),i(()=>e(t).name))),o(kt,(e(t),i(()=>e(t).provider_name))),o(St,(e(t),i(()=>e(t).image))),o(wt,(e(t),i(()=>e(t).flavor))),Yt(ee,1,`inline-flex px-2 py-1 text-xs font-medium rounded-full ${e(t),i(()=>e(t).enabled?"bg-green-100 dark:bg-green-900 text-green-800 dark:text-green-200":"bg-red-100 dark:bg-red-900 text-red-800 dark:text-red-200")??""}`),o($t,(e(t),i(()=>e(t).enabled?"Enabled":"Disabled"))),o(It,c),Ve(re,"href",v),o(Dt,u),o(Et,f),o(Mt,ce),o(Nt,(e(t),i(()=>e(t).max_runners))),o(At,(e(t),i(()=>e(t).min_idle_runners))),o(Tt,`${e(t),i(()=>e(t).runner_bootstrap_timeout)??""} minutes`),o(Ft,(e(t),i(()=>e(t).runner_prefix||"garm"))),o(Ut,`${e(t),i(()=>e(t).os_type)??""} / ${e(t),i(()=>e(t).os_arch)??""}`)},[()=>(x(R),e(t),i(()=>R(e(t)))),()=>(x(Xe),e(t),i(()=>Xe(e(t)))),()=>(x(S),e(t),i(()=>S(e(t)))),()=>(x(C),e(t),i(()=>C(e(t).created_at||""))),()=>(x(C),e(t),i(()=>C(e(t).updated_at||"")))]),p(z,be)};g(T,z=>{e(t)&&z(q)},!0)}p(h,b)};g(y,h=>{e(E)?h(j):h(yt,!1)},!0)}p(s,n)};g(mt,s=>{e(G)?s(ut):s(xt,!1)})}r(O);var ye=d(O,2);{var gt=s=>{ea(s,{get scaleSet(){return e(t)},$$events:{close:()=>l(M,!1),submit:n=>rt(n.detail)}})};g(ye,s=>{e(M)&&e(t)&&s(gt)})}var he=d(ye,2);{var ft=s=>{{let n=I(()=>(e(t),x(S),i(()=>`Scale Set ${e(t).name} (${S(e(t))})`)));Ke(s,{title:"Delete Scale Set",message:"Are you sure you want to delete this scale set? This action cannot be undone and will remove all associated runners.",get itemName(){return e(n)},$$events:{close:()=>l(N,!1),confirm:st}})}};g(he,s=>{e(N)&&e(t)&&s(ft)})}var pt=d(he,2);{var _t=s=>{Ke(s,{title:"Delete Instance",message:"Are you sure you want to delete this instance? This action cannot be undone.",get itemName(){return e(m),i(()=>e(m).name)},$$events:{close:()=>{l($,!1),l(m,null)},confirm:dt}})};g(pt,s=>{e($)&&e(m)&&s(_t)})}k(()=>{Ve(ct,"href",`${me}/scalesets`),o(vt,(e(t),i(()=>e(t)?e(t).name:"Loading...")))}),p(Ze,xe),Wt(),at()}export{Sa as component}; diff --git a/webapp/assets/_app/immutable/nodes/2.CiT4lj0D.js b/webapp/assets/_app/immutable/nodes/2.CiT4lj0D.js new file mode 100644 index 00000000..b08a6de1 --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/2.CiT4lj0D.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as Je}from"../chunks/B3Pzt0F_.js";import{f as h,k as a,j as r,r as t,t as T,v as z,c as m,B as He,b as ze,p as Oe,E as vt,l as Le,s as v,m as I,g as e,a as Ne,C as ut,z as ve,n as B,u,d as Qe,e as Ge,o as mt,A as gt,h as bt,$ as pt,y as N}from"../chunks/D8EpLgQ1.js";import{p as fe,i as C,s as ft,a as xt}from"../chunks/5WA7h8uK.js";import{e as ht,w as Me,i as kt}from"../chunks/u94nIB4-.js";import{s as xe,B as yt,r as Ue,g as Ke,c as ue}from"../chunks/CiE1LlKV.js";import{b as Q}from"../chunks/CoIRRsD9.js";import{e as _t,a as Ce}from"../chunks/wyaP0EDu.js";import{b as Re}from"../chunks/C6k1Q4We.js";import{p as wt}from"../chunks/D4Caz1gY.js";import{M as Mt}from"../chunks/qB7B8uiS.js";import{t as Fe}from"../chunks/BEkVdVE1.js";var Ut=h('
                '),Ct=h('
                '),Rt=h('
                '),zt=h('
                '),Lt=h('
                ');function pe(me,D){let x=fe(D,"title",8),re=fe(D,"content",8),s=fe(D,"position",8,"top"),ae=fe(D,"width",8,"w-80");var i=Lt(),k=a(r(i),2),p=r(k),y=r(p,!0);t(p);var d=a(p,2),R=r(d,!0);t(d);var oe=a(d,2);{var ge=E=>{var q=Ut();m(E,q)},se=E=>{var q=He(),W=ze(q);{var F=L=>{var P=Ct();m(L,P)},K=L=>{var P=He(),ie=ze(P);{var le=$=>{var H=Rt();m($,H)},ne=$=>{var H=He(),X=ze(H);{var de=l=>{var o=zt();m(l,o)};C(X,l=>{s()==="right"&&l(de)},!0)}m($,H)};C(ie,$=>{s()==="left"?$(le):$(ne,!1)},!0)}m(L,P)};C(W,L=>{s()==="bottom"?L(F):L(K,!1)},!0)}m(E,q)};C(oe,E=>{s()==="top"?E(ge):E(se,!1)})}t(k),t(i),T(()=>{xe(k,1,`absolute ${s()==="top"?"bottom-full":s()==="bottom"?"top-full":s()==="left"?"right-full top-1/2 -translate-y-1/2":"left-full top-1/2 -translate-y-1/2"} left-1/2 transform -translate-x-1/2 ${s()==="top"?"mb-2":s()==="bottom"?"mt-2":"mx-2"} ${ae()??""} p-3 bg-gray-900 text-white text-xs rounded-lg shadow-lg opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200 z-50`),z(y,x()),z(R,re())}),m(me,i)}var $t=ut(' Settings',1),St=h('
                Metadata
                '),jt=h('
                Callback
                '),Bt=h('
                Webhook
                '),At=h('

                No URLs configured

                '),It=h('
                Controller Webhook URL

                Use this URL in your GitHub organization/repository webhook settings

                '),Et=h('

                Please enter a valid URL

                '),Ht=h('

                Please enter a valid URL

                '),Gt=h('

                Please enter a valid URL

                '),qt=h('

                Controller Settings

                URL where runners can fetch metadata and setup information

                URL where runners send status updates and lifecycle events

                URL where GitHub/Gitea will send webhook events for job notifications

                Time to wait before spinning up a runner for a new job (0 = immediate)

                '),Pt=h('

                Controller Information

                Identity

                Controller ID
                Hostname
                Job Age Backoff

                Integration URLs

                ',1);function Tt(me,D){Oe(D,!1);const x=I(),re=I();let s=fe(D,"controllerInfo",12);const ae=vt();let i=I(!1),k=I(!1),p=I(""),y=I(""),d=I(""),R=I(null);function oe(){v(p,s().metadata_url||""),v(y,s().callback_url||""),v(d,s().webhook_url||""),v(R,s().minimum_job_age_backoff||null),v(i,!0)}async function ge(){try{v(k,!0);const n={};e(p).trim()&&(n.metadata_url=e(p).trim()),e(y).trim()&&(n.callback_url=e(y).trim()),e(d).trim()&&(n.webhook_url=e(d).trim()),e(R)!==null&&e(R)>=0&&(n.minimum_job_age_backoff=e(R));const c=await Ke.updateController(n);Fe.success("Settings Updated","Controller settings have been updated successfully."),v(i,!1),s(c),ae("updated",c)}catch(n){Fe.error("Update Failed",n instanceof Error?n.message:"Failed to update controller settings")}finally{v(k,!1)}}function se(){v(i,!1),v(p,""),v(y,""),v(d,""),v(R,null)}Le(()=>{},()=>{v(x,n=>{if(!n.trim())return!0;try{return new URL(n),!0}catch{return!1}})}),Le(()=>(e(x),e(p),e(y),e(d),e(R)),()=>{v(re,e(x)(e(p))&&e(x)(e(y))&&e(x)(e(d))&&(e(R)===null||e(R)>=0))}),Ne(),Je();var E=Pt(),q=ze(E),W=r(q),F=r(W),K=r(F),L=a(r(K),2),P=a(r(L),2),ie=r(P),le=r(ie);t(ie),t(P),t(L),t(K);var ne=a(K,2);yt(ne,{variant:"secondary",size:"sm",$$events:{click:oe},children:(n,c)=>{var b=$t();ve(),m(n,b)},$$slots:{default:!0}}),t(F);var $=a(F,2),H=r($),X=r(H),de=a(r(X),2),l=r(de),o=a(r(l),2),S=r(o,!0);t(o),t(l);var _=a(l,2),f=a(r(_),2),w=r(f,!0);t(f),t(_);var A=a(_,2),V=r(A),Y=a(r(V),2),Z=r(Y);pe(Z,{title:"Job Age Backoff",content:"Time in seconds GARM waits after receiving a new job before spinning up a runner. This delay allows existing idle runners to pick up jobs first, preventing unnecessary runner creation. Set to 0 for immediate response."}),t(Y),t(V);var J=a(V,2),O=r(J);t(J),t(A),t(de),t(X),t(H);var ee=a(H,2),ce=r(ee),he=a(r(ce),2),ke=r(he);{var $e=n=>{var c=St(),b=r(c),M=a(r(b),2),G=r(M);pe(G,{title:"Metadata URL",content:"URL where runners retrieve setup information and metadata. Runners must be able to connect to this URL during their initialization process. Usually accessible at /api/v1/metadata endpoint."}),t(M),t(b);var U=a(b,2),j=r(U,!0);t(U),t(c),T(()=>z(j,(B(s()),u(()=>s().metadata_url)))),m(n,c)};C(ke,n=>{B(s()),u(()=>s().metadata_url)&&n($e)})}var qe=a(ke,2);{var Xe=n=>{var c=jt(),b=r(c),M=a(r(b),2),G=r(M);pe(G,{title:"Callback URL",content:"URL where runners send status updates and system information (OS version, runner agent ID, etc.) to the controller. Runners must be able to connect to this URL. Usually accessible at /api/v1/callbacks endpoint."}),t(M),t(b);var U=a(b,2),j=r(U,!0);t(U),t(c),T(()=>z(j,(B(s()),u(()=>s().callback_url)))),m(n,c)};C(qe,n=>{B(s()),u(()=>s().callback_url)&&n(Xe)})}var Pe=a(qe,2);{var Ye=n=>{var c=Bt(),b=r(c),M=a(r(b),2),G=r(M);pe(G,{title:"Webhook Base URL",content:"Base URL for webhooks where GitHub sends job notifications. GARM needs to receive these webhooks to know when to create new runners for jobs. GitHub must be able to connect to this URL. Usually accessible at /webhooks endpoint."}),t(M),t(b);var U=a(b,2),j=r(U,!0);t(U),t(c),T(()=>z(j,(B(s()),u(()=>s().webhook_url)))),m(n,c)};C(Pe,n=>{B(s()),u(()=>s().webhook_url)&&n(Ye)})}var Ze=a(Pe,2);{var et=n=>{var c=At(),b=a(r(c),4);t(c),Ge("click",b,oe),m(n,c)};C(Ze,n=>{B(s()),u(()=>!s().metadata_url&&!s().callback_url&&!s().webhook_url)&&n(et)})}t(he),t(ce),t(ee),t($);var tt=a($,2);{var rt=n=>{var c=It(),b=r(c),M=a(r(b),2),G=r(M);pe(G,{title:"Controller Webhook URL",content:"Unique webhook URL for this GARM controller. This is the preferred URL to use in GitHub webhook settings as it's controller-specific and allows multiple GARM controllers to work with the same repository. Automatically combines the webhook base URL with the controller ID."}),t(M),t(b);var U=a(b,2),j=r(U),be=a(r(j),2),ye=r(be),Se=r(ye,!0);t(ye),ve(2),t(be),t(j),t(U),t(c),T(()=>z(Se,(B(s()),u(()=>s().controller_webhook_url)))),m(n,c)};C(tt,n=>{B(s()),u(()=>s().controller_webhook_url)&&n(rt)})}t(W),t(q);var at=a(q,2);{var ot=n=>{Mt(n,{$$events:{close:se},children:(c,b)=>{var M=qt(),G=a(r(M),2),U=r(G),j=a(r(U),2);Ue(j);let be;var ye=a(j,2);{var Se=g=>{var te=Et();m(g,te)};C(ye,g=>{e(x),e(p),u(()=>!e(x)(e(p)))&&g(Se)})}ve(2),t(U);var je=a(U,2),_e=a(r(je),2);Ue(_e);let Te;var st=a(_e,2);{var it=g=>{var te=Ht();m(g,te)};C(st,g=>{e(x),e(y),u(()=>!e(x)(e(y)))&&g(it)})}ve(2),t(je);var Be=a(je,2),we=a(r(Be),2);Ue(we);let De;var lt=a(we,2);{var nt=g=>{var te=Gt();m(g,te)};C(lt,g=>{e(x),e(d),u(()=>!e(x)(e(d)))&&g(nt)})}ve(2),t(Be);var Ae=a(Be,2),Ve=a(r(Ae),2);Ue(Ve),ve(2),t(Ae);var We=a(Ae,2),Ie=r(We),Ee=a(Ie,2),dt=r(Ee,!0);t(Ee),t(We),t(G),t(M),T((g,te,ct)=>{be=xe(j,1,"block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white sm:text-sm",null,be,g),Te=xe(_e,1,"block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white sm:text-sm",null,Te,te),De=xe(we,1,"block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 bg-white dark:bg-gray-700 text-gray-900 dark:text-white sm:text-sm",null,De,ct),Ie.disabled=e(k),Ee.disabled=!e(re)||e(k),z(dt,e(k)?"Saving...":"Save Changes")},[()=>({"border-red-300":!e(x)(e(p))}),()=>({"border-red-300":!e(x)(e(y))}),()=>({"border-red-300":!e(x)(e(d))})]),Re(j,()=>e(p),g=>v(p,g)),Re(_e,()=>e(y),g=>v(y,g)),Re(we,()=>e(d),g=>v(d,g)),Re(Ve,()=>e(R),g=>v(R,g)),Ge("click",Ie,se),Ge("submit",G,wt(ge)),m(c,M)},$$slots:{default:!0}})};C(at,n=>{e(i)&&n(ot)})}T(n=>{z(le,`v${n??""}`),z(S,(B(s()),u(()=>s().controller_id))),z(w,(B(s()),u(()=>s().hostname||"Unknown"))),z(O,`${B(s()),u(()=>s().minimum_job_age_backoff||30)??""}s`)},[()=>(B(s()),u(()=>s().version?.replace(/^v/,"")||"Unknown"))]),m(me,E),Qe()}var Dt=h('

                Error loading dashboard

                '),Vt=h('
                '),Wt=h('

                Dashboard

                Welcome to GARM - GitHub Actions Runner Manager

                ');function ar(me,D){Oe(D,!1);const[x,re]=ft(),s=()=>xt(_t,"$eagerCache",x),ae=I();let i=I({repositories:0,organizations:0,pools:0,instances:0}),k=I(null),p=I(""),y=[];function d(l,o,S=1e3){const _=parseInt(l.textContent||"0"),f=(o-_)/(S/16);let w=_;const A=()=>{if(w+=f,f>0&&w>=o||f<0&&w<=o){l.textContent=o.toString();return}l.textContent=Math.floor(w).toString(),requestAnimationFrame(A)};_!==o&&requestAnimationFrame(A)}mt(async()=>{try{const[f,w,A,V,Y]=await Promise.all([Ce.getRepositories(),Ce.getOrganizations(),Ce.getPools(),Ke.listInstances(),Ce.getControllerInfo()]);setTimeout(()=>{const Z=document.querySelector('[data-stat="repositories"]'),J=document.querySelector('[data-stat="organizations"]'),O=document.querySelector('[data-stat="pools"]'),ee=document.querySelector('[data-stat="instances"]');Z&&d(Z,f.length),J&&d(J,w.length),O&&d(O,A.length),ee&&d(ee,V.length)},100),v(i,{repositories:f.length,organizations:w.length,pools:A.length,instances:V.length}),Y&&v(k,Y)}catch(f){v(p,f instanceof Error?f.message:"Failed to load dashboard data"),console.error("Dashboard error:",f)}const l=Me.subscribeToEntity("repository",["create","delete"],R),o=Me.subscribeToEntity("organization",["create","delete"],oe),S=Me.subscribeToEntity("pool",["create","delete"],ge),_=Me.subscribeToEntity("instance",["create","delete"],se);y=[l,o,S,_]}),gt(()=>{y.forEach(l=>l())});function R(l){const o=document.querySelector('[data-stat="repositories"]');l.operation==="create"?(N(i,e(i).repositories++),o&&d(o,e(i).repositories,500)):l.operation==="delete"&&(N(i,e(i).repositories=Math.max(0,e(i).repositories-1)),o&&d(o,e(i).repositories,500))}function oe(l){const o=document.querySelector('[data-stat="organizations"]');l.operation==="create"?(N(i,e(i).organizations++),o&&d(o,e(i).organizations,500)):l.operation==="delete"&&(N(i,e(i).organizations=Math.max(0,e(i).organizations-1)),o&&d(o,e(i).organizations,500))}function ge(l){const o=document.querySelector('[data-stat="pools"]');l.operation==="create"?(N(i,e(i).pools++),o&&d(o,e(i).pools,500)):l.operation==="delete"&&(N(i,e(i).pools=Math.max(0,e(i).pools-1)),o&&d(o,e(i).pools,500))}function se(l){const o=document.querySelector('[data-stat="instances"]');l.operation==="create"?(N(i,e(i).instances++),o&&d(o,e(i).instances,500)):l.operation==="delete"&&(N(i,e(i).instances=Math.max(0,e(i).instances-1)),o&&d(o,e(i).instances,500))}function E(l){v(k,l.detail)}function q(l){return{blue:"bg-blue-500 text-white",green:"bg-green-500 text-white",purple:"bg-purple-500 text-white",yellow:"bg-yellow-500 text-white"}[l]||"bg-gray-500 text-white"}Le(()=>(e(k),s()),()=>{(!e(k)||s().loaded.controllerInfo)&&v(k,s().controllerInfo)}),Le(()=>(e(i),Q),()=>{v(ae,[{title:"Repositories",value:e(i).repositories,icon:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",color:"blue",href:`${Q}/repositories`},{title:"Organizations",value:e(i).organizations,icon:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",color:"green",href:`${Q}/organizations`},{title:"Pools",value:e(i).pools,icon:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",color:"purple",href:`${Q}/pools`},{title:"Instances",value:e(i).instances,icon:"M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z",color:"yellow",href:`${Q}/instances`}])}),Ne(),Je();var W=Wt();bt(l=>{pt.title="Dashboard - GARM"});var F=a(r(W),2);{var K=l=>{var o=Dt(),S=r(o),_=a(r(S),2),f=a(r(_),2),w=r(f,!0);t(f),t(_),t(S),t(o),T(()=>z(w,e(p))),m(l,o)};C(F,l=>{e(p)&&l(K)})}var L=a(F,2);ht(L,5,()=>e(ae),kt,(l,o)=>{var S=Vt(),_=r(S),f=r(_),w=r(f),A=r(w),V=r(A),Y=r(V);t(V),t(A),t(w);var Z=a(w,2),J=r(Z),O=r(J),ee=r(O,!0);t(O);var ce=a(O,2),he=r(ce,!0);t(ce),t(J),t(Z),t(f),t(_),t(S),T((ke,$e)=>{ue(S,"href",(e(o),u(()=>e(o).href))),xe(A,1,`w-8 h-8 rounded-md ${ke??""} flex items-center justify-center`),ue(Y,"d",(e(o),u(()=>e(o).icon))),z(ee,(e(o),u(()=>e(o).title))),ue(ce,"data-stat",$e),z(he,(e(o),u(()=>e(o).value)))},[()=>(e(o),u(()=>q(e(o).color))),()=>(e(o),u(()=>e(o).title.toLowerCase()))]),m(l,S)}),t(L);var P=a(L,2);{var ie=l=>{Tt(l,{get controllerInfo(){return e(k)},$$events:{updated:E}})};C(P,l=>{e(k)&&l(ie)})}var le=a(P,2),ne=r(le),$=a(r(ne),4),H=r($),X=a(H,2),de=a(X,2);t($),t(ne),t(le),t(W),T(()=>{ue(H,"href",`${Q??""}/repositories`),ue(X,"href",`${Q??""}/pools`),ue(de,"href",`${Q??""}/instances`)}),m(me,W),Qe(),re()}export{ar as component}; diff --git a/webapp/assets/_app/immutable/nodes/3.BSFz0YHn.js b/webapp/assets/_app/immutable/nodes/3.BSFz0YHn.js new file mode 100644 index 00000000..f89efad2 --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/3.BSFz0YHn.js @@ -0,0 +1,7 @@ +import"../chunks/DsnmJJEf.js";import{i as It}from"../chunks/B3Pzt0F_.js";import{p as jt,g as e,o as Gt,l as Q,a as Ut,f as E,e as f,h as qt,b as Fe,c as $,d as zt,$ as Bt,m as b,s as n,i as St,j as i,k as a,r as o,u,n as ye,q as Le,t as se,v as W,w as tt,x as Lt,y as _,z as X}from"../chunks/D8EpLgQ1.js";import{i as G,s as Nt,a as Kt}from"../chunks/5WA7h8uK.js";import{e as Vt,i as Ht}from"../chunks/u94nIB4-.js";import{h as Rt,r as L,s as Ie,b as Yt,a as Ot,g as ve}from"../chunks/CiE1LlKV.js";import{b as N,a as Jt}from"../chunks/C6k1Q4We.js";import{p as rt}from"../chunks/D4Caz1gY.js";import{P as Qt}from"../chunks/CO4LUyTP.js";import{F as Wt}from"../chunks/CNMHKIIK.js";import{D as Xt,A as at,G as it,a as Zt}from"../chunks/C9DJVOi1.js";import{e as er,a as Ne}from"../chunks/wyaP0EDu.js";import{t as je}from"../chunks/BEkVdVE1.js";import{f as tr,p as rr,g as Ke,B as ot,c as ar}from"../chunks/BGVHQGl-.js";import"../chunks/CoIRRsD9.js";import{E as ir}from"../chunks/CGpPw4EW.js";import{S as or}from"../chunks/BE4wujub.js";var nr=E('

                '),dr=E(""),sr=E('

                '),lr=E('

                Gitea only supports PAT authentication

                '),cr=E('
                '),ur=E('

                or drag and drop

                PEM, KEY files only

                ',1),pr=E(''),gr=E('
                '),br=E('

                or drag and drop

                PEM, KEY files only. Upload new private key.

                ',1),yr=E(" ",1),vr=E(''),fr=E(''),mr=E('
                ',1);function Ur(nt,dt){jt(dt,!1);const[st,lt]=Nt(),U=()=>Kt(er,"$eagerCache",st),Ge=b(),Z=b(),Ve=b(),Ue=b(),p={PAT:"pat",APP:"app"};let we=b(!0),le=b([]),J=b([]),fe=b(""),Ce=b(""),K=b(1),ce=b(25),ue=b(1),Pe=b(!1),Ae=b(!1),Te=b(!1),D=b(p.PAT),g=b(null),M=b(null),r=b({name:"",description:"",endpoint:"",auth_type:p.PAT,oauth2_token:"",app_id:"",installation_id:"",private_key_bytes:""}),$e={...e(r)},ee=b(!1);function ct(t){t.key==="Escape"&&(e(Pe)||e(Ae)||e(Te))&&P()}Gt(async()=>{try{n(we,!0);const[t,s]=await Promise.all([Ne.getCredentials(),Ne.getEndpoints()]);t&&Array.isArray(t)&&n(le,t),s&&Array.isArray(s)&&n(J,s)}catch(t){console.error("Failed to load credentials:",t),n(fe,t instanceof Error?t.message:"Failed to load credentials")}finally{n(we,!1)}});async function ut(){try{await Ne.retryResource("credentials")}catch(t){console.error("Retry failed:",t)}}async function pt(){He(),n(Pe,!0),n(x,"github")}let x=b("");function gt(t){n(x,t.detail),_(r,e(r).auth_type=p.PAT),n(D,p.PAT)}async function qe(t){n(g,t),n(r,{name:t.name||"",description:t.description||"",endpoint:t.endpoint?.name||"",auth_type:t["auth-type"]||p.PAT,oauth2_token:"",app_id:"",installation_id:"",private_key_bytes:""}),n(D,t["auth-type"]||p.PAT),$e={...e(r)},n(ee,!1),n(Ae,!0)}function ze(t){n(M,t),n(Te,!0)}function He(){n(r,{name:"",description:"",endpoint:"",auth_type:p.PAT,oauth2_token:"",app_id:"",installation_id:"",private_key_bytes:""}),$e={...e(r)},n(D,p.PAT),n(ee,!1)}function P(){n(Pe,!1),n(Ae,!1),n(Te,!1),n(g,null),n(M,null),n(x,""),He()}function Re(t){n(D,t),_(r,e(r).auth_type=t)}function bt(){const t={};if(e(r).name!==$e.name&&e(r).name.trim()!==""&&(t.name=e(r).name.trim()),e(r).description!==$e.description&&e(r).description.trim()!==""&&(t.description=e(r).description.trim()),e(ee)&&e(g))if(e(g)["auth-type"]===p.PAT)e(r).oauth2_token.trim()!==""&&(t.pat={oauth2_token:e(r).oauth2_token.trim()});else{const s={};let y=!1;if(e(r).app_id.trim()!==""&&(s.app_id=parseInt(e(r).app_id.trim()),y=!0),e(r).installation_id.trim()!==""&&(s.installation_id=parseInt(e(r).installation_id.trim()),y=!0),e(r).private_key_bytes!=="")try{const m=atob(e(r).private_key_bytes);s.private_key_bytes=Array.from(m,l=>l.charCodeAt(0)),y=!0}catch{}y&&(t.app=s)}return t}async function yt(){try{if(e(x)==="github")await ve.createGithubCredentials(e(r));else if(e(x)==="gitea")await ve.createGiteaCredentials(e(r));else throw new Error("Please select a forge type");je.success("Credentials Created",`Credentials ${e(r).name} have been created successfully.`),P()}catch(t){n(fe,t instanceof Error?t.message:"Failed to create credentials")}}async function vt(){if(!(!e(g)||!e(g).id))try{const t=bt();if(Object.keys(t).length===0){je.info("No Changes","No fields were modified."),P();return}e(g).forge_type==="github"?await ve.updateGithubCredentials(e(g).id,t):await ve.updateGiteaCredentials(e(g).id,t),je.success("Credentials Updated",`Credentials ${e(g)?.name||"Unknown"} have been updated successfully.`),P()}catch(t){n(fe,t instanceof Error?t.message:"Failed to update credentials")}}async function ft(){if(!(!e(M)||!e(M).id))try{e(M).forge_type==="github"?await ve.deleteGithubCredentials(e(M).id):await ve.deleteGiteaCredentials(e(M).id),je.success("Credentials Deleted",`Credentials ${e(M)?.name||"Unknown"} have been deleted successfully.`),P()}catch(t){n(fe,t instanceof Error?t.message:"Failed to delete credentials")}}function Ye(t){const y=t.target.files?.[0];if(!y){_(r,e(r).private_key_bytes="");return}const m=new FileReader;m.onload=l=>{const h=l.target?.result;_(r,e(r).private_key_bytes=btoa(h))},m.readAsText(y)}function Oe(){return!e(r).name||!e(r).description||!e(r).endpoint?!1:e(r).auth_type===p.PAT?!!e(r).oauth2_token:!!e(r).app_id&&!!e(r).installation_id&&!!e(r).private_key_bytes}function Je(){return!e(r).name.trim()||!e(r).description.trim()?!1:e(ee)&&e(g)?e(g)["auth-type"]===p.PAT?!!e(r).oauth2_token.trim():!!e(r).app_id.trim()&&!!e(r).installation_id.trim()&&!!e(r).private_key_bytes:!0}function mt(t){return e(J).find(y=>y.name===t)?.endpoint_type||""}function xt(t){return mt(t)==="gitea"}const _t=[{key:"name",title:"Name",cellComponent:it,cellProps:{field:"name"}},{key:"description",title:"Description",cellComponent:it,cellProps:{field:"description",type:"description"}},{key:"endpoint",title:"Endpoint",cellComponent:ir},{key:"auth_type",title:"Auth Type",cellComponent:or,cellProps:{statusType:"custom",statusField:"auth-type"}},{key:"actions",title:"Actions",align:"right",cellComponent:Zt}],ht={entityType:"credential",primaryText:{field:"name",isClickable:!1},secondaryText:{field:"description"},customInfo:[{icon:t=>Ke(t?.forge_type||"unknown"),text:t=>t?.endpoint?.name||"Unknown"}],badges:[{type:"auth",field:"auth-type"}],actions:[{type:"edit",handler:t=>qe(t)},{type:"delete",handler:t=>ze(t)}]};function kt(t){n(Ce,t.detail.term),n(K,1)}function wt(t){n(K,t.detail.page)}function Ct(t){const s=ar(t.detail.perPage);n(ce,s.newPerPage),n(K,s.newCurrentPage)}function Pt(t){qe(t.detail.item)}function At(t){ze(t.detail.item)}Q(()=>(e(le),U()),()=>{(!e(le).length||U().loaded.credentials)&&n(le,U().credentials)}),Q(()=>U(),()=>{n(we,U().loading.credentials)}),Q(()=>U(),()=>{n(Ge,U().errorMessages.credentials)}),Q(()=>(e(J),U()),()=>{(!e(J).length||U().loaded.endpoints)&&n(J,U().endpoints)}),Q(()=>(e(le),e(Ce)),()=>{n(Z,tr(e(le),e(Ce)))}),Q(()=>(e(ue),e(Z),e(ce),e(K)),()=>{n(ue,Math.ceil(e(Z).length/e(ce))),e(K)>e(ue)&&e(ue)>0&&n(K,e(ue))}),Q(()=>(e(Z),e(K),e(ce)),()=>{n(Ve,rr(e(Z),e(K),e(ce)))}),Q(()=>(e(x),e(J)),()=>{n(Ue,e(x)?e(J).filter(t=>t.endpoint_type===e(x)):e(J))}),Ut(),It();var Qe=mr();f("keydown",St,ct),qt(t=>{Bt.title="Credentials - GARM"});var Be=Fe(Qe),We=i(Be);Qt(We,{title:"Credentials",description:"Manage authentication credentials for your GitHub and Gitea endpoints.",actionLabel:"Add Credentials",$$events:{action:pt}});var Tt=a(We,2);{let t=Le(()=>e(Ge)||e(fe)),s=Le(()=>!!e(Ge));Xt(Tt,{get columns(){return _t},get data(){return e(Ve)},get loading(){return e(we)},get error(){return e(t)},get searchTerm(){return e(Ce)},searchPlaceholder:"Search credentials by name, description, or endpoint...",get currentPage(){return e(K)},get perPage(){return e(ce)},get totalPages(){return e(ue)},get totalItems(){return e(Z),u(()=>e(Z).length)},itemName:"credentials",emptyIconType:"key",get showRetry(){return e(s)},get mobileCardConfig(){return ht},$$events:{search:kt,pageChange:wt,perPageChange:Ct,retry:ut,edit:Pt,delete:At},$$slots:{"mobile-card":(y,m)=>{const l=Le(()=>m.item);var h=nr(),A=i(h),q=i(A),F=i(q),I=i(F,!0);o(F);var k=a(F,2),V=i(k,!0);o(k);var z=a(k,2),B=i(z),S=i(B);Rt(S,()=>(ye(Ke),ye(e(l)),u(()=>Ke(e(l).forge_type||"unknown"))));var te=a(S,2),re=i(te,!0);o(te),o(B),o(z),o(q),o(A);var ae=a(A,2),H=i(ae);{var ie=j=>{ot(j,{variant:"success",text:"PAT"})},R=j=>{ot(j,{variant:"info",text:"App"})};G(H,j=>{ye(e(l)),u(()=>(e(l)["auth-type"]||"pat")==="pat")?j(ie):j(R,!1)})}var Y=a(H,2),oe=i(Y);at(oe,{action:"edit",size:"sm",title:"Edit credentials",ariaLabel:"Edit credentials",$$events:{click:()=>qe(e(l))}});var pe=a(oe,2);at(pe,{action:"delete",size:"sm",title:"Delete credentials",ariaLabel:"Delete credentials",$$events:{click:()=>ze(e(l))}}),o(Y),o(ae),o(h),se(()=>{W(I,(ye(e(l)),u(()=>e(l).name))),W(V,(ye(e(l)),u(()=>e(l).description))),W(re,(ye(e(l)),u(()=>e(l).endpoint?.name||"Unknown")))}),$(y,h)}}})}o(Be);var Xe=a(Be,2);{var $t=t=>{var s=pr(),y=i(s),m=a(y,2),l=i(m),h=a(i(l),2);o(l);var A=a(l,2),q=i(A);Wt(q,{get selectedForgeType(){return e(x)},set selectedForgeType(d){n(x,d)},$$events:{select:gt},$$legacy:!0});var F=a(q,2),I=a(i(F),2);L(I),o(F);var k=a(F,2),V=a(i(k),2);tt(V),o(k);var z=a(k,2),B=a(i(z),2);se(()=>{e(r),Lt(()=>{e(Ue)})});var S=i(B);S.value=S.__value="";var te=a(S);Vt(te,1,()=>e(Ue),Ht,(d,c)=>{var v=dr(),C=i(v);o(v);var T={};se(()=>{W(C,`${e(c),u(()=>e(c).name)??""} (${e(c),u(()=>e(c).endpoint_type)??""})`),T!==(T=(e(c),u(()=>e(c).name)))&&(v.value=(v.__value=(e(c),u(()=>e(c).name)))??"")}),$(d,v)}),o(B);var re=a(B,2);{var ae=d=>{var c=sr(),v=i(c);o(c),se(()=>W(v,`Showing only ${e(x)??""} endpoints`)),$(d,c)};G(re,d=>{e(x)&&d(ae)})}o(z);var H=a(z,2),ie=a(i(H),2),R=i(ie),Y=a(R,2);o(ie);var oe=a(ie,2);{var pe=d=>{var c=lr();$(d,c)};G(oe,d=>{e(x)==="gitea"&&d(pe)})}o(H);var j=a(H,2);{var Ee=d=>{var c=cr(),v=a(i(c),2);L(v),o(c),N(v,()=>e(r).oauth2_token,C=>_(r,e(r).oauth2_token=C)),$(d,c)};G(j,d=>{e(D),u(()=>e(D)===p.PAT)&&d(Ee)})}var me=a(j,2);{var De=d=>{var c=ur(),v=Fe(c),C=a(i(v),2);L(C),o(v);var T=a(v,2),O=a(i(T),2);L(O),o(T);var de=a(T,2),ge=a(i(de),2),_e=i(ge),he=a(_e,2),ke=a(i(he),2),Me=i(ke);X(),o(ke),X(2),o(he),o(ge),o(de),N(C,()=>e(r).app_id,be=>_(r,e(r).app_id=be)),N(O,()=>e(r).installation_id,be=>_(r,e(r).installation_id=be)),f("change",_e,Ye),f("click",Me,()=>document.getElementById("private_key")?.click()),$(d,c)};G(me,d=>{e(D),u(()=>e(D)===p.APP)&&d(De)})}var w=a(me,2),ne=i(w),xe=a(ne,2);o(w),o(A),o(m),o(s),se((d,c,v)=>{Ie(R,1,`flex-1 py-2 px-4 text-sm font-medium rounded-md border focus:outline-none focus:ring-2 focus:ring-blue-500 cursor-pointer + ${e(D),u(()=>e(D)===p.PAT?"bg-blue-600 text-white border-blue-600":"bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 border-gray-300 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-600")??""} + ${d??""}`),Y.disabled=e(x)==="gitea",Ie(Y,1,`flex-1 py-2 px-4 text-sm font-medium rounded-md border focus:outline-none focus:ring-2 focus:ring-blue-500 + ${e(D),u(()=>e(D)===p.APP?"bg-blue-600 text-white border-blue-600":"bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 border-gray-300 dark:border-gray-600 hover:bg-gray-50 dark:hover:bg-gray-600")??""} + ${e(x)==="gitea"?"opacity-50 cursor-not-allowed":"cursor-pointer"}`),xe.disabled=c,Ie(xe,1,`px-4 py-2 text-sm font-medium text-white rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors + ${v??""}`)},[()=>(e(r),u(()=>(e(r).endpoint&&xt(e(r).endpoint),""))),()=>u(()=>!Oe()),()=>u(()=>Oe()?"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 cursor-pointer":"bg-gray-400 cursor-not-allowed")]),f("click",y,P),f("click",h,P),N(I,()=>e(r).name,d=>_(r,e(r).name=d)),N(V,()=>e(r).description,d=>_(r,e(r).description=d)),Yt(B,()=>e(r).endpoint,d=>_(r,e(r).endpoint=d)),f("click",R,()=>Re(p.PAT)),f("click",Y,()=>Re(p.APP)),f("click",ne,P),f("submit",A,rt(yt)),$(t,s)};G(Xe,t=>{e(Pe)&&t($t)})}var Ze=a(Xe,2);{var Et=t=>{var s=vr(),y=i(s),m=a(y,2),l=i(m),h=i(l),A=a(i(h),2),q=i(A);o(A),o(h);var F=a(h,2);o(l);var I=a(l,2),k=i(I),V=a(i(k),2);L(V),o(k);var z=a(k,2),B=a(i(z),2);tt(B),o(z);var S=a(z,2),te=a(i(S),2);L(te),X(2),o(S);var re=a(S,2),ae=a(i(re),2),H=i(ae),ie=i(H,!0);o(H),o(ae),X(2),o(re);var R=a(re,2),Y=i(R),oe=i(Y);L(oe),X(2),o(Y),X(2),o(R);var pe=a(R,2);{var j=w=>{var ne=yr(),xe=Fe(ne);{var d=C=>{var T=gr(),O=a(i(T),2);L(O),o(T),N(O,()=>e(r).oauth2_token,de=>_(r,e(r).oauth2_token=de)),$(C,T)};G(xe,C=>{e(g),u(()=>e(g)["auth-type"]===p.PAT)&&C(d)})}var c=a(xe,2);{var v=C=>{var T=br(),O=Fe(T),de=a(i(O),2);L(de),o(O);var ge=a(O,2),_e=a(i(ge),2);L(_e),o(ge);var he=a(ge,2),ke=a(i(he),2),Me=i(ke),be=a(Me,2),et=a(i(be),2),Ft=i(et);X(),o(et),X(2),o(be),o(ke),o(he),N(de,()=>e(r).app_id,Se=>_(r,e(r).app_id=Se)),N(_e,()=>e(r).installation_id,Se=>_(r,e(r).installation_id=Se)),f("change",Me,Ye),f("click",Ft,()=>document.getElementById("edit_private_key")?.click()),$(C,T)};G(c,C=>{e(g),u(()=>e(g)["auth-type"]===p.APP)&&C(v)})}$(w,ne)};G(pe,w=>{e(ee)&&w(j)})}var Ee=a(pe,2),me=i(Ee),De=a(me,2);o(Ee),o(I),o(m),o(s),se((w,ne)=>{W(q,`Update credentials for ${e(g),u(()=>e(g)?.name||"Unknown")??""}`),Ot(te,(e(r),u(()=>e(r).endpoint))),W(ie,(e(g),u(()=>(e(g)?.["auth-type"]||p.PAT)===p.PAT?"Personal Access Token (PAT)":"GitHub App"))),De.disabled=w,Ie(De,1,`px-4 py-2 text-sm font-medium text-white rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors + ${ne??""}`)},[()=>u(()=>!Je()),()=>u(()=>Je()?"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 cursor-pointer":"bg-gray-400 cursor-not-allowed")]),f("click",y,P),f("click",F,P),N(V,()=>e(r).name,w=>_(r,e(r).name=w)),N(B,()=>e(r).description,w=>_(r,e(r).description=w)),Jt(oe,()=>e(ee),w=>n(ee,w)),f("click",me,P),f("submit",I,rt(vt)),$(t,s)};G(Ze,t=>{e(Ae)&&e(g)&&t(Et)})}var Dt=a(Ze,2);{var Mt=t=>{var s=fr(),y=i(s),m=a(y,2),l=i(m),h=i(l),A=a(i(h),2),q=a(i(A),2),F=i(q);o(q),o(A),o(h),o(l);var I=a(l,2),k=i(I),V=a(k,2);o(I),o(m),o(s),se(()=>W(F,`Are you sure you want to delete the credentials "${e(M),u(()=>e(M)?.name||"Unknown")??""}"? This action cannot be undone.`)),f("click",y,P),f("click",k,P),f("click",V,ft),$(t,s)};G(Dt,t=>{e(Te)&&e(M)&&t(Mt)})}$(nt,Qe),zt(),lt()}export{Ur as component}; diff --git a/webapp/assets/_app/immutable/nodes/4.XnVoh6ca.js b/webapp/assets/_app/immutable/nodes/4.XnVoh6ca.js new file mode 100644 index 00000000..36e9bd97 --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/4.XnVoh6ca.js @@ -0,0 +1,3 @@ +import"../chunks/DsnmJJEf.js";import{i as pt}from"../chunks/B3Pzt0F_.js";import{p as bt,g as e,o as gt,l as Z,a as ft,f as I,e as b,h as _t,b as Ee,c as j,d as mt,m as p,i as yt,$ as vt,j as o,q as Ce,k as a,t as me,u as E,s,r as i,n as se,v as ne,w as De,z as V,y as g}from"../chunks/D8EpLgQ1.js";import{i as de,s as xt,a as ht}from"../chunks/5WA7h8uK.js";import{h as kt,r as U,c as je,s as Ie,g as ee}from"../chunks/CiE1LlKV.js";import{b as C}from"../chunks/C6k1Q4We.js";import{p as Ge}from"../chunks/D4Caz1gY.js";import{P as wt}from"../chunks/CO4LUyTP.js";import{F as Et}from"../chunks/CNMHKIIK.js";import{D as Ct,A as ze,G as Pe,a as Pt}from"../chunks/C9DJVOi1.js";import{e as $t,a as qe}from"../chunks/wyaP0EDu.js";import{t as ye}from"../chunks/BEkVdVE1.js";import{g as $e,c as Rt,a as At,p as Bt}from"../chunks/BGVHQGl-.js";import"../chunks/CoIRRsD9.js";import{E as Ut}from"../chunks/CGpPw4EW.js";var Lt=I('

                '),Mt=I('
                ',1),Tt=I('

                If empty, Base URL will be used as API Base URL

                '),Ft=I(''),Dt=I('
                ',1),jt=I('

                If empty, Base URL will be used as API Base URL

                '),It=I(''),Gt=I(''),zt=I('
                ',1);function rr(He,Ne){bt(Ne,!1);const[Se,Ve]=xt(),q=()=>ht($t,"$eagerCache",Se),ve=p(),H=p(),Re=p();let le=p(!0),O=p([]),te=p(""),ue=p(""),L=p(1),K=p(25),J=p(1),ce=p(!1),pe=p(!1),be=p(!1),G=p("github"),m=p(null),R=p(null),r=p({name:"",description:"",endpoint_type:"",base_url:"",api_base_url:"",upload_base_url:"",ca_cert_bundle:""}),k={...e(r)};gt(async()=>{try{s(le,!0);const t=await qe.getEndpoints();t&&Array.isArray(t)&&s(O,t)}catch(t){console.error("Failed to load endpoints:",t),s(te,t instanceof Error?t.message:"Failed to load endpoints")}finally{s(le,!1)}});async function Oe(){try{await qe.retryResource("endpoints")}catch(t){console.error("Retry failed:",t)}}const Ke=[{key:"name",title:"Name",cellComponent:Pe,cellProps:{field:"name"}},{key:"description",title:"Description",cellComponent:Pe,cellProps:{field:"description"}},{key:"api_url",title:"API URL",cellComponent:Pe,cellProps:{field:"api_base_url",fallbackField:"base_url"}},{key:"forge_type",title:"Forge Type",cellComponent:Ut},{key:"actions",title:"Actions",align:"right",cellComponent:Pt}],Je={entityType:"endpoint",primaryText:{field:"name",isClickable:!1},secondaryText:{field:"description"},customInfo:[{icon:t=>$e(t?.endpoint_type||"unknown"),text:t=>t?.api_base_url||"Unknown"}],actions:[{type:"edit",handler:t=>xe(t)},{type:"delete",handler:t=>he(t)}]};function Qe(t){s(ue,t.detail.term),s(L,1)}function We(t){s(L,t.detail.page)}function Xe(t){const d=Rt(t.detail.perPage);s(K,d.newPerPage),s(L,d.newCurrentPage)}function Ye(t){xe(t.detail.item)}function Ze(t){he(t.detail.item)}function et(){s(G,"github"),Ae(),s(ce,!0)}function tt(t){s(G,t.detail),g(r,e(r).endpoint_type=t.detail)}function xe(t){s(m,t),s(r,{name:t.name||"",description:t.description||"",endpoint_type:t.endpoint_type||"",base_url:t.base_url||"",api_base_url:t.api_base_url||"",upload_base_url:t.upload_base_url||"",ca_cert_bundle:typeof t.ca_cert_bundle=="string"?t.ca_cert_bundle:""}),k={...e(r)},s(pe,!0)}function he(t){s(R,t),s(be,!0)}function Ae(){s(r,{name:"",description:"",endpoint_type:"",base_url:"",api_base_url:"",upload_base_url:"",ca_cert_bundle:""}),k={...e(r)}}function rt(t){t.key==="Escape"&&(e(ce)||e(pe)||e(be))&&y()}function y(){s(ce,!1),s(pe,!1),s(be,!1),s(G,"github"),s(m,null),s(R,null),Ae()}function at(){const t={};if(e(r).description!==k.description&&(e(r).description.trim()!==""||k.description!=="")&&(t.description=e(r).description.trim()),e(r).base_url!==k.base_url&&e(r).base_url.trim()!==""&&(t.base_url=e(r).base_url.trim()),e(r).api_base_url!==k.api_base_url&&(e(r).api_base_url.trim()!==""||k.api_base_url!=="")&&(t.api_base_url=e(r).api_base_url.trim()),e(m)?.endpoint_type==="github"&&e(r).upload_base_url!==k.upload_base_url&&(e(r).upload_base_url.trim()!==""||k.upload_base_url!=="")&&(t.upload_base_url=e(r).upload_base_url.trim()),e(r).ca_cert_bundle!==k.ca_cert_bundle)if(e(r).ca_cert_bundle!=="")try{const d=atob(e(r).ca_cert_bundle);t.ca_cert_bundle=Array.from(d,c=>c.charCodeAt(0))}catch{k.ca_cert_bundle!==""&&(t.ca_cert_bundle=[])}else k.ca_cert_bundle!==""&&(t.ca_cert_bundle=[]);return t}async function ot(){try{const t={name:e(r).name,description:e(r).description,endpoint_type:e(r).endpoint_type,base_url:e(r).base_url,api_base_url:e(r).api_base_url,upload_base_url:e(r).upload_base_url};if(e(r).ca_cert_bundle&&e(r).ca_cert_bundle.trim()!=="")try{const d=atob(e(r).ca_cert_bundle);t.ca_cert_bundle=Array.from(d,c=>c.charCodeAt(0))}catch{}e(r).endpoint_type==="github"?await ee.createGithubEndpoint(t):await ee.createGiteaEndpoint(t),ye.success("Endpoint Created",`Endpoint ${e(r).name} has been created successfully.`),y()}catch(t){s(te,t instanceof Error?t.message:"Failed to create endpoint")}}async function it(){if(e(m))try{const t=at();if(Object.keys(t).length===0){ye.info("No Changes","No fields were modified."),y();return}e(m).endpoint_type==="github"?await ee.updateGithubEndpoint(e(m).name,t):await ee.updateGiteaEndpoint(e(m).name,t),ye.success("Endpoint Updated",`Endpoint ${e(m).name} has been updated successfully.`),y()}catch(t){s(te,t instanceof Error?t.message:"Failed to update endpoint")}}async function st(){if(e(R))try{e(R).endpoint_type==="github"?await ee.deleteGithubEndpoint(e(R).name):await ee.deleteGiteaEndpoint(e(R).name),ye.success("Endpoint Deleted",`Endpoint ${e(R).name} has been deleted successfully.`),y()}catch(t){s(te,t instanceof Error?t.message:"Failed to delete endpoint")}}function Be(t){const c=t.target.files?.[0];if(!c){g(r,e(r).ca_cert_bundle="");return}const v=new FileReader;v.onload=n=>{const f=n.target?.result;g(r,e(r).ca_cert_bundle=btoa(f))},v.readAsText(c)}function ge(){return!(!e(r).name||!e(r).description||!e(r).base_url||e(r).endpoint_type==="github"&&!e(r).api_base_url)}Z(()=>(e(O),q()),()=>{(!e(O).length||q().loaded.endpoints)&&s(O,q().endpoints)}),Z(()=>q(),()=>{s(le,q().loading.endpoints)}),Z(()=>q(),()=>{s(ve,q().errorMessages.endpoints)}),Z(()=>(e(O),e(ue)),()=>{s(H,At(e(O),e(ue)))}),Z(()=>(e(J),e(H),e(K),e(L)),()=>{s(J,Math.ceil(e(H).length/e(K))),e(L)>e(J)&&e(J)>0&&s(L,e(J))}),Z(()=>(e(H),e(L),e(K)),()=>{s(Re,Bt(e(H),e(L),e(K)))}),ft(),pt();var Ue=zt();b("keydown",yt,rt),_t(t=>{vt.title="Endpoints - GARM"});var ke=Ee(Ue),Le=o(ke);wt(Le,{title:"Endpoints",description:"Manage your GitHub and Gitea endpoints for runner management.",actionLabel:"Add Endpoint",$$events:{action:et}});var nt=a(Le,2);{let t=Ce(()=>e(ve)||e(te)),d=Ce(()=>!!e(ve));Ct(nt,{get columns(){return Ke},get data(){return e(Re)},get loading(){return e(le)},get error(){return e(t)},get searchTerm(){return e(ue)},searchPlaceholder:"Search endpoints by name, description, or URL...",get currentPage(){return e(L)},get perPage(){return e(K)},get totalPages(){return e(J)},get totalItems(){return e(H),E(()=>e(H).length)},itemName:"endpoints",emptyIconType:"settings",get showRetry(){return e(d)},get mobileCardConfig(){return Je},$$events:{search:Qe,pageChange:We,perPageChange:Xe,retry:Oe,edit:Ye,delete:Ze},$$slots:{"mobile-card":(c,v)=>{const n=Ce(()=>v.item);var f=Lt(),x=o(f),A=o(x),P=o(A),w=o(P,!0);i(P);var _=a(P,2),M=o(_,!0);i(_);var B=a(_,2),T=o(B);kt(T,()=>(se($e),se(e(n)),E(()=>$e(e(n).endpoint_type||"","w-5 h-5"))));var F=a(T,2),Q=o(F,!0);i(F),i(B),i(A),i(x);var N=a(x,2),z=o(N);ze(z,{action:"edit",size:"sm",title:"Edit endpoint",ariaLabel:"Edit endpoint",$$events:{click:()=>xe(e(n))}});var W=a(z,2);ze(W,{action:"delete",size:"sm",title:"Delete endpoint",ariaLabel:"Delete endpoint",$$events:{click:()=>he(e(n))}}),i(N),i(f),me(()=>{ne(w,(se(e(n)),E(()=>e(n).name))),ne(M,(se(e(n)),E(()=>e(n).description))),ne(Q,(se(e(n)),E(()=>e(n).endpoint_type)))}),j(c,f)}}})}i(ke);var Me=a(ke,2);{var dt=t=>{var d=Ft(),c=o(d),v=a(c,2),n=o(v),f=a(o(n),2);i(n);var x=a(n,2),A=o(x);Et(A,{get selectedForgeType(){return e(G)},set selectedForgeType(u){s(G,u)},$$events:{select:tt},$$legacy:!0});var P=a(A,2),w=a(o(P),2);U(w),i(P);var _=a(P,2),M=a(o(_),2);De(M),i(_);var B=a(_,2),T=a(o(B),2);U(T),i(B);var F=a(B,2);{var Q=u=>{var $=Mt(),l=Ee($),h=a(o(l),2);U(h),i(l);var D=a(l,2),S=a(o(D),2);U(S),i(D),C(h,()=>e(r).api_base_url,Y=>g(r,e(r).api_base_url=Y)),C(S,()=>e(r).upload_base_url,Y=>g(r,e(r).upload_base_url=Y)),j(u,$)},N=u=>{var $=Tt(),l=a(o($),2);U(l),V(2),i($),C(l,()=>e(r).api_base_url,h=>g(r,e(r).api_base_url=h)),j(u,$)};de(F,u=>{e(G)==="github"?u(Q):u(N,!1)})}var z=a(F,2),W=a(o(z),2),X=o(W),re=a(X,2),ae=a(o(re),2),fe=o(ae);V(),i(ae),V(2),i(re),i(W),i(z);var oe=a(z,2),_e=o(oe),ie=a(_e,2);i(oe),i(x),i(v),i(d),me((u,$)=>{je(w,"placeholder",e(G)==="github"?"e.g., github-enterprise or github-com":"e.g., gitea-main or my-gitea"),je(T,"placeholder",e(G)==="github"?"https://github.com or https://github.example.com":"https://gitea.example.com"),ie.disabled=u,Ie(ie,1,`px-4 py-2 text-sm font-medium text-white rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors + ${$??""}`)},[()=>E(()=>!ge()),()=>E(()=>ge()?"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 cursor-pointer":"bg-gray-400 cursor-not-allowed")]),b("click",c,y),b("click",f,y),C(w,()=>e(r).name,u=>g(r,e(r).name=u)),C(M,()=>e(r).description,u=>g(r,e(r).description=u)),C(T,()=>e(r).base_url,u=>g(r,e(r).base_url=u)),b("change",X,Be),b("click",fe,()=>document.getElementById("ca_cert_file")?.click()),b("click",_e,y),b("submit",x,Ge(ot)),j(t,d)};de(Me,t=>{e(ce)&&t(dt)})}var Te=a(Me,2);{var lt=t=>{var d=It(),c=o(d),v=a(c,2),n=o(v),f=o(n),x=o(f),A=o(x);i(x),V(2),i(f);var P=a(f,2);i(n);var w=a(n,2),_=o(w),M=a(o(_),2);U(M),i(_);var B=a(_,2),T=a(o(B),2);De(T),i(B);var F=a(B,2),Q=a(o(F),2);U(Q),i(F);var N=a(F,2);{var z=l=>{var h=Dt(),D=Ee(h),S=a(o(D),2);U(S),i(D);var Y=a(D,2),Fe=a(o(Y),2);U(Fe),i(Y),C(S,()=>e(r).api_base_url,we=>g(r,e(r).api_base_url=we)),C(Fe,()=>e(r).upload_base_url,we=>g(r,e(r).upload_base_url=we)),j(l,h)},W=l=>{var h=jt(),D=a(o(h),2);U(D),V(2),i(h),C(D,()=>e(r).api_base_url,S=>g(r,e(r).api_base_url=S)),j(l,h)};de(N,l=>{e(m),E(()=>e(m).endpoint_type==="github")?l(z):l(W,!1)})}var X=a(N,2),re=a(o(X),2),ae=o(re),fe=a(ae,2),oe=a(o(fe),2),_e=o(oe);V(),i(oe),V(2),i(fe),i(re),i(X);var ie=a(X,2),u=o(ie),$=a(u,2);i(ie),i(w),i(v),i(d),me((l,h)=>{ne(A,`Edit ${e(m),E(()=>e(m).endpoint_type==="github"?"GitHub":"Gitea")??""} Endpoint`),$.disabled=l,Ie($,1,`px-4 py-2 text-sm font-medium text-white rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors + ${h??""}`)},[()=>E(()=>!ge()),()=>E(()=>ge()?"bg-blue-600 hover:bg-blue-700 focus:ring-blue-500 cursor-pointer":"bg-gray-400 cursor-not-allowed")]),b("click",c,y),b("click",P,y),C(M,()=>e(r).name,l=>g(r,e(r).name=l)),C(T,()=>e(r).description,l=>g(r,e(r).description=l)),C(Q,()=>e(r).base_url,l=>g(r,e(r).base_url=l)),b("change",ae,Be),b("click",_e,()=>document.getElementById("edit_ca_cert_file")?.click()),b("click",u,y),b("submit",w,Ge(it)),j(t,d)};de(Te,t=>{e(pe)&&e(m)&&t(lt)})}var ut=a(Te,2);{var ct=t=>{var d=Gt(),c=o(d),v=a(c,2),n=o(v),f=o(n),x=a(o(f),2),A=a(o(x),2),P=o(A);i(A),i(x),i(f),i(n);var w=a(n,2),_=o(w),M=a(_,2);i(w),i(v),i(d),me(()=>ne(P,`Are you sure you want to delete the endpoint "${e(R),E(()=>e(R).name)??""}"? This action cannot be undone.`)),b("click",c,y),b("click",_,y),b("click",M,st),j(t,d)};de(ut,t=>{e(be)&&e(R)&&t(ct)})}j(He,Ue),mt(),Ve()}export{rr as component}; diff --git a/webapp/assets/_app/immutable/nodes/5.rvsSG-AQ.js b/webapp/assets/_app/immutable/nodes/5.rvsSG-AQ.js new file mode 100644 index 00000000..5f4f52cc --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/5.rvsSG-AQ.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as Ae}from"../chunks/B3Pzt0F_.js";import{p as Ge,E as je,o as Se,l as w,s as r,m as n,g as e,a as Be,f as M,k as o,j as i,r as l,c as $,t as L,v as K,x as Ee,u as y,z as Ie,y as Z,e as $e,d as He,B as Je,b as Re,h as Ve,$ as We,n as A,q as ee}from"../chunks/D8EpLgQ1.js";import{a as Ue,i as B,s as Fe}from"../chunks/5WA7h8uK.js";import{r as Ce,b as Pe,c as Ye,g as ge}from"../chunks/CiE1LlKV.js";import{b as Me}from"../chunks/CoIRRsD9.js";import{P as Ke}from"../chunks/CO4LUyTP.js";import{e as Oe,i as Qe}from"../chunks/u94nIB4-.js";import{b as De}from"../chunks/C6k1Q4We.js";import{p as Xe}from"../chunks/D4Caz1gY.js";import{M as Ze}from"../chunks/qB7B8uiS.js";import{e as Le,a as ye}from"../chunks/wyaP0EDu.js";import{U as et}from"../chunks/CclkODgu.js";import{D as tt}from"../chunks/KQ2xQpA3.js";import{t as be}from"../chunks/BEkVdVE1.js";import{B as rt,k as ve,l as at}from"../chunks/BGVHQGl-.js";import{D as st,A as Te,G as ot,a as nt}from"../chunks/C9DJVOi1.js";import{E as it}from"../chunks/B7ITzBt8.js";import{E as lt}from"../chunks/CGpPw4EW.js";import{S as dt}from"../chunks/BE4wujub.js";var ct=M('

                '),ut=M('

                Loading...

                '),pt=M(""),mt=M('

                Loading credentials...

                '),ft=M('

                No GitHub credentials found. Please create GitHub credentials first.

                '),gt=M(`

                You'll need to manually configure this secret in GitHub's enterprise webhook settings.

                `),bt=M('

                Create Enterprise

                Enterprises are only available for GitHub endpoints.

                ');function vt(te,re){Ge(re,!1);const[ae,se]=Fe(),p=()=>Ue(Le,"$eagerCache",ae),G=n(),h=n(),m=n(),H=n(),E=je();let x=n(!1),f=n(""),a=n({name:"",credentials_name:"",webhook_secret:"",pool_balancer_type:"roundrobin"});async function _(){if(!p().loaded.credentials&&!p().loading.credentials)try{await ye.getCredentials()}catch(c){r(f,c instanceof Error?c.message:"Failed to load credentials")}}async function C(){if(!e(a).name||!e(a).name.trim()){r(f,"Enterprise name is required");return}if(!e(a).credentials_name){r(f,"Please select credentials");return}try{r(x,!0),r(f,"");const c={...e(a)};E("submit",c)}catch(c){r(f,c instanceof Error?c.message:"Failed to create enterprise"),r(x,!1)}}Se(()=>{_()}),w(()=>p(),()=>{r(G,p().credentials)}),w(()=>p(),()=>{r(h,p().loading.credentials)}),w(()=>e(G),()=>{r(m,e(G).filter(c=>c.forge_type==="github"))}),w(()=>e(a),()=>{r(H,e(a).name&&e(a).name.trim()!==""&&e(a).credentials_name!==""&&e(a).webhook_secret&&e(a).webhook_secret.trim()!=="")}),Be(),Ae(),Ze(te,{$$events:{close:()=>E("close")},children:(c,N)=>{var D=bt(),d=o(i(D),4);{var oe=g=>{var b=ct(),T=i(b),R=i(T,!0);l(T),l(b),L(()=>K(R,e(f))),$(g,b)};B(d,g=>{e(f)&&g(oe)})}var ne=o(d,2);{var ie=g=>{var b=ut();$(g,b)},le=g=>{var b=gt(),T=i(b),R=o(i(T),2);Ce(R),l(T);var q=o(T,2),U=o(i(q),2);L(()=>{e(a),Ee(()=>{e(m)})});var z=i(U);z.value=z.__value="";var de=o(z);Oe(de,1,()=>e(m),Qe,(s,u)=>{var P=pt(),v=i(P);l(P);var k={};L(()=>{K(v,`${e(u),y(()=>e(u).name)??""} (${e(u),y(()=>e(u).endpoint?.name||"Unknown endpoint")??""})`),k!==(k=(e(u),y(()=>e(u).name)))&&(P.value=(P.__value=(e(u),y(()=>e(u).name)))??"")}),$(s,P)}),l(U);var ce=o(U,2);{var ue=s=>{var u=mt();$(s,u)},O=s=>{var u=Je(),P=Re(u);{var v=k=>{var Y=ft();$(k,Y)};B(P,k=>{e(m),y(()=>e(m).length===0)&&k(v)},!0)}$(s,u)};B(ce,s=>{e(h)?s(ue):s(O,!1)})}l(q);var S=o(q,2),F=o(i(S),2);L(()=>{e(a),Ee(()=>{})});var j=i(F);j.value=j.__value="roundrobin";var I=o(j);I.value=I.__value="pack",l(F),l(S);var J=o(S,2),V=o(i(J),2);Ce(V),Ie(2),l(J);var Q=o(J,2),X=i(Q),W=o(X,2),t=i(W,!0);l(W),l(Q),l(b),L(()=>{W.disabled=(e(x),e(h),e(H),e(m),y(()=>e(x)||e(h)||!e(H)||e(m).length===0)),K(t,e(x)?"Creating...":"Create Enterprise")}),De(R,()=>e(a).name,s=>Z(a,e(a).name=s)),Pe(U,()=>e(a).credentials_name,s=>Z(a,e(a).credentials_name=s)),Pe(F,()=>e(a).pool_balancer_type,s=>Z(a,e(a).pool_balancer_type=s)),De(V,()=>e(a).webhook_secret,s=>Z(a,e(a).webhook_secret=s)),$e("click",X,()=>E("close")),$e("submit",b,Xe(C)),$(g,b)};B(ne,g=>{e(x)?g(ie):g(le,!1)})}l(D),$(c,D)},$$slots:{default:!0}}),He(),se()}var yt=M(''),ht=M('
                ',1);function Nt(te,re){Ge(re,!1);const[ae,se]=Fe(),p=()=>Ue(Le,"$eagerCache",ae),G=n(),h=n(),m=n(),H=n();let E=n([]),x=n(!0),f=n(""),a=n(""),_=n(1),C=n(25),c=n(!1),N=n(!1),D=n(!1),d=n(null);async function oe(t){try{r(f,""),await ge.createEnterprise(t),be.success("Enterprise Created",`Enterprise ${t.name} has been created successfully.`),r(c,!1)}catch(s){throw r(f,s instanceof Error?s.message:"Failed to create enterprise"),s}}async function ne(t){if(e(d))try{await ge.updateEnterprise(e(d).id,t),be.success("Enterprise Updated",`Enterprise ${e(d).name} has been updated successfully.`),r(N,!1),r(d,null)}catch(s){throw s}}async function ie(){if(e(d))try{r(f,""),await ge.deleteEnterprise(e(d).id),be.success("Enterprise Deleted",`Enterprise ${e(d).name} has been deleted successfully.`),r(D,!1),r(d,null)}catch(t){r(f,t instanceof Error?t.message:"Failed to delete enterprise")}}function le(){r(c,!0)}function g(t){r(d,t),r(N,!0)}function b(t){r(d,t),r(D,!0)}Se(async()=>{try{r(x,!0);const t=await ye.getEnterprises();t&&Array.isArray(t)&&r(E,t)}catch(t){console.error("Failed to load enterprises:",t),r(f,t instanceof Error?t.message:"Failed to load enterprises")}finally{r(x,!1)}});async function T(){try{await ye.retryResource("enterprises")}catch(t){console.error("Retry failed:",t)}}const R=[{key:"name",title:"Name",cellComponent:it,cellProps:{entityType:"enterprise"}},{key:"endpoint",title:"Endpoint",cellComponent:lt},{key:"credentials",title:"Credentials",cellComponent:ot,cellProps:{field:"credentials_name"}},{key:"status",title:"Status",cellComponent:dt,cellProps:{statusType:"entity"}},{key:"actions",title:"Actions",align:"right",cellComponent:nt}],q={entityType:"enterprise",primaryText:{field:"name",isClickable:!0,href:"/enterprises/{id}"},secondaryText:{field:"credentials_name"},badges:[{type:"custom",value:t=>ve(t)}],actions:[{type:"edit",handler:t=>g(t)},{type:"delete",handler:t=>b(t)}]};function U(t){r(a,t.detail.term),r(_,1)}function z(t){r(_,t.detail.page)}function de(t){r(C,t.detail.perPage),r(_,1)}function ce(t){g(t.detail.item)}function ue(t){b(t.detail.item)}w(()=>(e(E),p()),()=>{(!e(E).length||p().loaded.enterprises)&&r(E,p().enterprises)}),w(()=>p(),()=>{r(x,p().loading.enterprises)}),w(()=>p(),()=>{r(G,p().errorMessages.enterprises)}),w(()=>(e(E),e(a)),()=>{r(h,at(e(E),e(a)))}),w(()=>(e(h),e(C)),()=>{r(m,Math.ceil(e(h).length/e(C)))}),w(()=>(e(_),e(m)),()=>{e(_)>e(m)&&e(m)>0&&r(_,e(m))}),w(()=>(e(h),e(_),e(C)),()=>{r(H,e(h).slice((e(_)-1)*e(C),e(_)*e(C)))}),Be(),Ae();var O=ht();Ve(t=>{We.title="Enterprises - GARM"});var S=Re(O),F=i(S);Ke(F,{title:"Enterprises",description:"Manage GitHub enterprises",actionLabel:"Add Enterprise",$$events:{action:le}});var j=o(F,2);{let t=ee(()=>e(G)||e(f)),s=ee(()=>!!e(G));st(j,{get columns(){return R},get data(){return e(H)},get loading(){return e(x)},get error(){return e(t)},get searchTerm(){return e(a)},searchPlaceholder:"Search enterprises...",get currentPage(){return e(_)},get perPage(){return e(C)},get totalPages(){return e(m)},get totalItems(){return e(h),y(()=>e(h).length)},itemName:"enterprises",emptyIconType:"building",get showRetry(){return e(s)},get mobileCardConfig(){return q},$$events:{search:U,pageChange:z,perPageChange:de,retry:T,edit:ce,delete:ue},$$slots:{"mobile-card":(u,P)=>{const v=ee(()=>P.item),k=ee(()=>(A(ve),A(e(v)),y(()=>ve(e(v)))));var Y=yt(),pe=i(Y),me=i(pe),fe=i(me),Ne=i(fe,!0);l(fe);var he=o(fe,2),qe=i(he,!0);l(he),l(me),l(pe);var _e=o(pe,2),xe=i(_e);rt(xe,{get variant(){return A(e(k)),y(()=>e(k).variant)},get text(){return A(e(k)),y(()=>e(k).text)}});var ke=o(xe,2),we=i(ke);Te(we,{action:"edit",size:"sm",title:"Edit enterprise",ariaLabel:"Edit enterprise",$$events:{click:()=>g(e(v))}});var ze=o(we,2);Te(ze,{action:"delete",size:"sm",title:"Delete enterprise",ariaLabel:"Delete enterprise",$$events:{click:()=>b(e(v))}}),l(ke),l(_e),l(Y),L(()=>{Ye(me,"href",(A(Me),A(e(v)),y(()=>`${Me}/enterprises/${e(v).id}`))),K(Ne,(A(e(v)),y(()=>e(v).name))),K(qe,(A(e(v)),y(()=>e(v).credentials_name)))}),$(u,Y)}}})}l(S);var I=o(S,2);{var J=t=>{vt(t,{$$events:{close:()=>r(c,!1),submit:s=>oe(s.detail)}})};B(I,t=>{e(c)&&t(J)})}var V=o(I,2);{var Q=t=>{et(t,{get entity(){return e(d)},entityType:"enterprise",$$events:{close:()=>{r(N,!1),r(d,null)},submit:s=>ne(s.detail)}})};B(V,t=>{e(N)&&e(d)&&t(Q)})}var X=o(V,2);{var W=t=>{tt(t,{title:"Delete Enterprise",message:"Are you sure you want to delete this enterprise? This action cannot be undone.",get itemName(){return e(d),y(()=>e(d).name)},$$events:{close:()=>{r(D,!1),r(d,null)},confirm:ie}})};B(X,t=>{e(D)&&e(d)&&t(W)})}$(te,O),He(),se()}export{Nt as component}; diff --git a/webapp/assets/_app/immutable/nodes/6.CtGX0qgG.js b/webapp/assets/_app/immutable/nodes/6.CtGX0qgG.js new file mode 100644 index 00000000..03f28a9f --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/6.CtGX0qgG.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as He}from"../chunks/B3Pzt0F_.js";import{p as Ne,o as qe,A as ze,l as Ge,a as je,f as B,h as Re,b as A,t as G,c as E,d as Ve,g as e,m as o,s,u as l,$ as We,j as u,r as f,k as d,v as oe,y as Je,B as le,q as v,n as Ke}from"../chunks/D8EpLgQ1.js";import{i as g,s as Oe,a as Qe}from"../chunks/5WA7h8uK.js";import{c as Xe,g as y}from"../chunks/CiE1LlKV.js";import{p as Ye}from"../chunks/C41YH50Q.js";import{g as de}from"../chunks/CTf6mQoE.js";import{b as j}from"../chunks/CoIRRsD9.js";import{U as Ze}from"../chunks/CclkODgu.js";import{D as ce}from"../chunks/KQ2xQpA3.js";import{E as et,P as tt,a as at}from"../chunks/BmGWMSQm.js";import{D as rt,I as st}from"../chunks/DDhBTdDt.js";import{g as pe}from"../chunks/BGVHQGl-.js";import{w as R}from"../chunks/u94nIB4-.js";import{t as F}from"../chunks/BEkVdVE1.js";import{C as nt}from"../chunks/CwqI2jFH.js";var it=B('

                Loading enterprise...

                '),ot=B('

                '),lt=B(" ",1),dt=B(' ',1);function Dt(ue,fe){Ne(fe,!1);const[me,ve]=Oe(),V=()=>Qe(Ye,"$page",me),$=o();let a=o(null),c=o([]),m=o([]),S=o(!0),x=o(""),T=o(!1),P=o(!1),w=o(!1),M=o(!1),p=o(null),C=null,h=o();async function W(){if(e($))try{s(S,!0),s(x,"");const[t,r,n]=await Promise.all([y.getEnterprise(e($)),y.listEnterprisePools(e($)).catch(()=>[]),y.listEnterpriseInstances(e($)).catch(()=>[])]);s(a,t),s(c,r),s(m,n)}catch(t){s(x,t instanceof Error?t.message:"Failed to load enterprise")}finally{s(S,!1)}}function ge(t,r){const{events:n}=t;return{...r,events:n}}async function ye(t){if(e(a))try{await y.updateEnterprise(e(a).id,t),await W(),F.success("Enterprise Updated",`Enterprise ${e(a).name} has been updated successfully.`),s(T,!1)}catch(r){throw r}}async function he(){if(e(a)){try{await y.deleteEnterprise(e(a).id),de(`${j}/enterprises`)}catch(t){s(x,t instanceof Error?t.message:"Failed to delete enterprise")}s(P,!1)}}async function be(){if(e(p))try{await y.deleteInstance(e(p).name),F.success("Instance Deleted",`Instance ${e(p).name} has been deleted successfully.`),s(w,!1),s(p,null)}catch(t){const r=t instanceof Error?t.message:"Failed to delete instance";F.error("Delete Failed",r),s(w,!1),s(p,null)}}function _e(t){s(p,t),s(w,!0)}function Ee(){s(M,!0)}async function $e(t){try{if(!e(a))return;await y.createEnterprisePool(e(a).id,t.detail),F.success("Pool Created",`Pool has been created successfully for enterprise ${e(a).name}.`),s(M,!1)}catch(r){throw r}}function J(){e(h)&&Je(h,e(h).scrollTop=e(h).scrollHeight)}function xe(t){if(t.operation==="update"){const r=t.payload;if(e(a)&&r.id===e(a).id){const n=e(a).events?.length||0,i=r.events?.length||0;s(a,ge(e(a),r)),i>n&&setTimeout(()=>{J()},100)}}else if(t.operation==="delete"){const r=t.payload.id||t.payload;e(a)&&e(a).id===r&&de(`${j}/enterprises`)}}function we(t){if(!e(a))return;const r=t.payload;if(r.enterprise_id===e(a).id){if(t.operation==="create")s(c,[...e(c),r]);else if(t.operation==="update")s(c,e(c).map(n=>n.id===r.id?r:n));else if(t.operation==="delete"){const n=r.id||r;s(c,e(c).filter(i=>i.id!==n))}}}function Ie(t){if(!e(a)||!e(c))return;const r=t.payload;if(e(c).some(i=>i.id===r.pool_id)){if(t.operation==="create")s(m,[...e(m),r]);else if(t.operation==="update")s(m,e(m).map(i=>i.id===r.id?r:i));else if(t.operation==="delete"){const i=r.id||r;s(m,e(m).filter(N=>N.id!==i))}}}qe(()=>{W().then(()=>{e(a)?.events?.length&&setTimeout(()=>{J()},100)});const t=R.subscribeToEntity("enterprise",["update","delete"],xe),r=R.subscribeToEntity("pool",["create","update","delete"],we),n=R.subscribeToEntity("instance",["create","update","delete"],Ie);C=()=>{t(),r(),n()}}),ze(()=>{C&&(C(),C=null)}),Ge(()=>V(),()=>{s($,V().params.id)}),je(),He();var K=dt();Re(t=>{G(()=>We.title=`${e(a),l(()=>e(a)?`${e(a).name} - Enterprise Details`:"Enterprise Details")??""} - GARM`)});var U=A(K),L=u(U),O=u(L),H=u(O),De=u(H);f(H);var Q=d(H,2),X=u(Q),Y=d(u(X),2),Te=u(Y,!0);f(Y),f(X),f(Q),f(O),f(L);var Pe=d(L,2);{var Me=t=>{var r=it();E(t,r)},Ce=t=>{var r=le(),n=A(r);{var i=b=>{var _=ot(),k=u(_),q=u(k,!0);f(k),f(_),G(()=>oe(q,e(x))),E(b,_)},N=b=>{var _=le(),k=A(_);{var q=z=>{var ae=lt(),re=A(ae);{let I=v(()=>(e(a),l(()=>e(a).name||"Enterprise"))),D=v(()=>(e(a),l(()=>e(a).endpoint?.name))),Le=v(()=>(Ke(pe),l(()=>pe("github"))));rt(re,{get title(){return e(I)},get subtitle(){return`Endpoint: ${e(D)??""} • GitHub Enterprise`},get forgeIcon(){return e(Le)},onEdit:()=>s(T,!0),onDelete:()=>s(P,!0)})}var se=d(re,2);et(se,{get entity(){return e(a)},entityType:"enterprise"});var ne=d(se,2);{let I=v(()=>(e(a),l(()=>e(a).id||""))),D=v(()=>(e(a),l(()=>e(a).name||"")));tt(ne,{get pools(){return e(c)},entityType:"enterprise",get entityId(){return e(I)},get entityName(){return e(D)},$$events:{addPool:Ee}})}var ie=d(ne,2);st(ie,{get instances(){return e(m)},entityType:"enterprise",onDeleteInstance:_e});var Ue=d(ie,2);{let I=v(()=>(e(a),l(()=>e(a)?.events)));at(Ue,{get events(){return e(I)},get eventsContainer(){return e(h)},set eventsContainer(D){s(h,D)},$$legacy:!0})}E(z,ae)};g(k,z=>{e(a)&&z(q)},!0)}E(b,_)};g(n,b=>{e(x)?b(i):b(N,!1)},!0)}E(t,r)};g(Pe,t=>{e(S)?t(Me):t(Ce,!1)})}f(U);var Z=d(U,2);{var ke=t=>{Ze(t,{get entity(){return e(a)},entityType:"enterprise",$$events:{close:()=>s(T,!1),submit:r=>ye(r.detail)}})};g(Z,t=>{e(T)&&e(a)&&t(ke)})}var ee=d(Z,2);{var Ae=t=>{ce(t,{title:"Delete Enterprise",message:"Are you sure you want to delete this enterprise? This action cannot be undone and will remove all associated pools and instances.",get itemName(){return e(a),l(()=>e(a).name)},$$events:{close:()=>s(P,!1),confirm:he}})};g(ee,t=>{e(P)&&e(a)&&t(Ae)})}var te=d(ee,2);{var Fe=t=>{ce(t,{title:"Delete Instance",message:"Are you sure you want to delete this instance? This action cannot be undone.",get itemName(){return e(p),l(()=>e(p).name)},$$events:{close:()=>{s(w,!1),s(p,null)},confirm:be}})};g(te,t=>{e(w)&&e(p)&&t(Fe)})}var Be=d(te,2);{var Se=t=>{{let r=v(()=>(e(a),l(()=>e(a).id||"")));nt(t,{initialEntityType:"enterprise",get initialEntityId(){return e(r)},$$events:{close:()=>s(M,!1),submit:$e}})}};g(Be,t=>{e(M)&&e(a)&&t(Se)})}G(()=>{Xe(De,"href",`${j}/enterprises`),oe(Te,(e(a),l(()=>e(a)?e(a).name:"Loading...")))}),E(ue,K),Ve(),ve()}export{Dt as component}; diff --git a/webapp/assets/_app/immutable/nodes/7.0w3i9VHx.js b/webapp/assets/_app/immutable/nodes/7.0w3i9VHx.js new file mode 100644 index 00000000..3b5d5acd --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/7.0w3i9VHx.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as Xe}from"../chunks/B3Pzt0F_.js";import{p as Ye,o as Ze,l as R,a as er,f as m,h as rr,t as re,g as e,e as ar,c as n,d as tr,m as i,$ as dr,j as a,k as d,s,r as t,z as L,u as h,C as lr,b as sr,D as or,v as $e,q as ir}from"../chunks/D8EpLgQ1.js";import{i as u,s as nr,a as vr}from"../chunks/5WA7h8uK.js";import{B as Ue,r as A,s as F,c as ze}from"../chunks/CiE1LlKV.js";import{b as P}from"../chunks/C6k1Q4We.js";import{p as mr}from"../chunks/D4Caz1gY.js";import{g as W}from"../chunks/CTf6mQoE.js";import{b as q}from"../chunks/CoIRRsD9.js";import{a as cr,b as ur}from"../chunks/duD3WMbl.js";import{t as pr}from"../chunks/BEkVdVE1.js";var br=m('

                Username is required

                '),gr=m('

                Please enter a valid email address

                '),fr=m('

                Full name is required

                '),xr=m('

                Password must be at least 8 characters long

                '),hr=m('

                Passwords do not match

                '),yr=lr(' Advanced Configuration (Optional)',1),kr=m('

                URL where runners can fetch metadata and setup information.

                URL where runners send status updates and lifecycle events.

                URL where GitHub/Gitea will send webhook events for job notifications.

                '),_r=m("
              • Enter a username
              • "),wr=m("
              • Enter a valid email address
              • "),$r=m("
              • Enter your full name
              • "),Ur=m("
              • Enter a password with at least 8 characters
              • "),zr=m("
              • Confirm your password
              • "),Mr=m('

                Please complete all required fields

                '),Rr=m('

                '),Ar=m('
                GARM

                Welcome to GARM

                Complete the first-run setup to get started

                First-Run Initialization

                GARM needs to be initialized before first use. This will create the admin user and generate a unique controller ID for this installation.

                This will create the admin user, generate a unique controller ID, and configure the required URLs for your GARM installation.
                Make sure to remember these credentials as they cannot be recovered.

                ');function Sr(Me,Re){Ye(Re,!1);const[Ae,Pe]=nr(),C=()=>vr(cr,"$authStore",Ae),k=i(),_=i(),w=i(),$=i(),U=i(),N=i();let g=i("admin"),p=i("admin@garm.local"),c=i(""),f=i(""),x=i("Administrator"),S=i(!1),H=i(""),T=i(!1),E=i(""),I=i(""),V=i("");async function qe(){if(e(N))try{s(S,!0),s(H,""),await ur.initialize(e(g).trim(),e(p).trim(),e(c),e(x).trim(),{callbackUrl:e(E).trim()||void 0,metadataUrl:e(I).trim()||void 0,webhookUrl:e(V).trim()||void 0}),pr.success("GARM Initialized","GARM has been successfully initialized. Welcome!"),W(`${q}/`)}catch(r){s(H,r instanceof Error?r.message:"Failed to initialize GARM")}finally{s(S,!1)}}Ze(()=>{if(C().isAuthenticated){W(`${q}/`);return}!C().needsInitialization&&!C().loading&&W(`${q}/login`)}),R(()=>(e(E),e(I),e(V)),()=>{if(typeof window<"u"){const r=window.location.origin;e(E)||s(E,`${r}/api/v1/callbacks`),e(I)||s(I,`${r}/api/v1/metadata`),e(V)||s(V,`${r}/webhooks`)}}),R(()=>e(p),()=>{s(k,e(p).trim()!==""&&e(p).includes("@"))}),R(()=>e(c),()=>{s(_,e(c).length>=8)}),R(()=>(e(f),e(c)),()=>{s(w,e(f).length>0&&e(c)===e(f))}),R(()=>e(g),()=>{s($,e(g).trim()!=="")}),R(()=>e(x),()=>{s(U,e(x).trim()!=="")}),R(()=>(e($),e(k),e(U),e(_),e(w)),()=>{s(N,e($)&&e(k)&&e(U)&&e(_)&&e(w))}),R(()=>(C(),q),()=>{C().isAuthenticated?W(`${q}/`):!C().needsInitialization&&!C().loading&&W(`${q}/login`)}),er(),Xe();var ae=Ar();rr(r=>{dr.title="Initialize GARM - First Run Setup"});var te=a(ae),me=a(te),ce=a(me),Ce=d(ce,2);t(me),L(4),t(te);var ue=d(te,2),pe=d(a(ue),2),de=a(pe),le=a(de),be=d(a(le),2),O=a(be);A(O);var Ge=d(O,2);{var Le=r=>{var l=br();n(r,l)};u(Ge,r=>{e($),e(g),h(()=>!e($)&&e(g).length>0)&&r(Le)})}t(be),t(le);var se=d(le,2),ge=d(a(se),2),J=a(ge);A(J);var Ee=d(J,2);{var Ie=r=>{var l=gr();n(r,l)};u(Ee,r=>{e(k),e(p),h(()=>!e(k)&&e(p).length>0)&&r(Ie)})}t(ge),t(se);var oe=d(se,2),fe=d(a(oe),2),K=a(fe);A(K);var Ve=d(K,2);{var Be=r=>{var l=fr();n(r,l)};u(Ve,r=>{e(U),e(x),h(()=>!e(U)&&e(x).length>0)&&r(Be)})}t(fe),t(oe);var ie=d(oe,2),xe=d(a(ie),2),Q=a(xe);A(Q);var Fe=d(Q,2);{var Ne=r=>{var l=xr();n(r,l)};u(Fe,r=>{e(_),e(c),h(()=>!e(_)&&e(c).length>0)&&r(Ne)})}t(xe),t(ie);var ne=d(ie,2),he=d(a(ne),2),X=a(he);A(X);var Se=d(X,2);{var je=r=>{var l=hr();n(r,l)};u(Se,r=>{e(w),e(f),h(()=>!e(w)&&e(f).length>0)&&r(je)})}t(he),t(ne);var ve=d(ne,2),ye=a(ve);Ue(ye,{type:"button",variant:"ghost",size:"sm",$$events:{click:()=>s(T,!e(T))},children:(r,l)=>{var b=yr(),v=sr(b);L(),re(()=>F(v,0,`w-4 h-4 mr-2 transition-transform ${e(T)?"rotate-90":""}`)),n(r,b)},$$slots:{default:!0}});var De=d(ye,2);{var We=r=>{var l=kr(),b=a(l),v=a(b),z=d(a(v),2),G=a(z);A(G),L(2),t(z),t(v);var B=d(v,2),Y=d(a(B),2),j=a(Y);A(j),L(2),t(Y),t(B);var Z=d(B,2),D=d(a(Z),2),ee=a(D);A(ee),L(2),t(D),t(Z),t(b),t(l),P(G,()=>e(I),M=>s(I,M)),P(j,()=>e(E),M=>s(E,M)),P(ee,()=>e(V),M=>s(V,M)),n(r,l)};u(De,r=>{e(T)&&r(We)})}t(ve);var ke=d(ve,2);{var He=r=>{var l=Mr(),b=a(l),v=d(a(b),2),z=d(a(v),2),G=a(z),B=a(G);{var Y=o=>{var y=_r();n(o,y)};u(B,o=>{e($)||o(Y)})}var j=d(B,2);{var Z=o=>{var y=wr();n(o,y)};u(j,o=>{e(k)||o(Z)})}var D=d(j,2);{var ee=o=>{var y=$r();n(o,y)};u(D,o=>{e(U)||o(ee)})}var M=d(D,2);{var Je=o=>{var y=Ur();n(o,y)};u(M,o=>{e(_)||o(Je)})}var Ke=d(M,2);{var Qe=o=>{var y=zr();n(o,y)};u(Ke,o=>{e(w)||o(Qe)})}t(G),t(z),t(v),t(b),t(l),n(r,l)};u(ke,r=>{e(N),e(g),e(p),e(x),e(c),e(f),h(()=>!e(N)&&(e(g).length>0||e(p).length>0||e(x).length>0||e(c).length>0||e(f).length>0))&&r(He)})}var _e=d(ke,2);{var Te=r=>{var l=Rr(),b=a(l),v=d(a(b),2),z=a(v),G=a(z,!0);t(z),t(v),t(b),t(l),re(()=>$e(G,e(H))),n(r,l)};u(_e,r=>{e(H)&&r(Te)})}var we=d(_e,2),Oe=a(we);{let r=ir(()=>!e(N)||e(S));Ue(Oe,{type:"submit",variant:"primary",size:"lg",fullWidth:!0,get loading(){return e(S)},get disabled(){return e(r)},children:(l,b)=>{L();var v=or();re(()=>$e(v,e(S)?"Initializing...":"Initialize GARM")),n(l,v)},$$slots:{default:!0}})}t(we),t(de),L(2),t(pe),t(ue),t(ae),re(()=>{ze(ce,"src",`${q??""}/assets/garm-light.svg`),ze(Ce,"src",`${q??""}/assets/garm-dark.svg`),F(O,1,`appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white sm:text-sm ${e($),e(g),h(()=>!e($)&&e(g).length>0?"border-red-300 dark:border-red-600":"")??""}`),F(J,1,`appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white sm:text-sm ${e(k),e(p),h(()=>!e(k)&&e(p).length>0?"border-red-300 dark:border-red-600":"")??""}`),F(K,1,`appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white sm:text-sm ${e(U),e(x),h(()=>!e(U)&&e(x).length>0?"border-red-300 dark:border-red-600":"")??""}`),F(Q,1,`appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white sm:text-sm ${e(_),e(c),h(()=>!e(_)&&e(c).length>0?"border-red-300 dark:border-red-600":"")??""}`),F(X,1,`appearance-none block w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-md shadow-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:text-white sm:text-sm ${e(w),e(f),h(()=>!e(w)&&e(f).length>0?"border-red-300 dark:border-red-600":"")??""}`)}),P(O,()=>e(g),r=>s(g,r)),P(J,()=>e(p),r=>s(p,r)),P(K,()=>e(x),r=>s(x,r)),P(Q,()=>e(c),r=>s(c,r)),P(X,()=>e(f),r=>s(f,r)),ar("submit",de,mr(qe)),n(Me,ae),tr(),Pe()}export{Sr as component}; diff --git a/webapp/assets/_app/immutable/nodes/8.BiZNKYxk.js b/webapp/assets/_app/immutable/nodes/8.BiZNKYxk.js new file mode 100644 index 00000000..38d013cb --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/8.BiZNKYxk.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as z}from"../chunks/B3Pzt0F_.js";import{p as J,f as C,c as x,d as K,j as y,n as _,u as f,r as b,t as A,v as L,B as ce,b as O,o as de,A as ue,l as w,a as me,h as pe,g as e,m as d,$ as fe,q as ge,k as S,s}from"../chunks/D8EpLgQ1.js";import{p as ve,i as D}from"../chunks/5WA7h8uK.js";import{c as T,g as B}from"../chunks/CiE1LlKV.js";import{D as he}from"../chunks/KQ2xQpA3.js";import{P as _e}from"../chunks/CO4LUyTP.js";import{w as ye}from"../chunks/u94nIB4-.js";import{t as be}from"../chunks/BEkVdVE1.js";import{D as xe,G as Ce,a as ke}from"../chunks/C9DJVOi1.js";import{E as Pe}from"../chunks/B7ITzBt8.js";import{S as H}from"../chunks/BE4wujub.js";import{b as W}from"../chunks/CoIRRsD9.js";var Ie=C(' '),we=C(' '),Se=C('-'),Te=C('
                ');function De($,P){J(P,!1);let a=ve(P,"item",8);z();var p=Te(),I=y(p);{var u=r=>{var n=Ie(),h=y(n);b(n),A(()=>{T(n,"href",`${W??""}/pools/${_(a()),f(()=>a().pool_id)??""}`),T(n,"title",`Pool: ${_(a()),f(()=>a().pool_id)??""}`),L(h,`Pool: ${_(a()),f(()=>a().pool_id)??""}`)}),x(r,n)},k=r=>{var n=ce(),h=O(n);{var o=l=>{var i=we(),m=y(i);b(i),A(()=>{T(i,"href",`${W??""}/scalesets/${_(a()),f(()=>a().scale_set_id)??""}`),T(i,"title",`Scale Set: ${_(a()),f(()=>a().scale_set_id)??""}`),L(m,`Scale Set: ${_(a()),f(()=>a().scale_set_id)??""}`)}),x(l,i)},g=l=>{var i=Se();x(l,i)};D(h,l=>{_(a()),f(()=>a()?.scale_set_id)?l(o):l(g,!1)},!0)}x(r,n)};D(I,r=>{_(a()),f(()=>a()?.pool_id)?r(u):r(k,!1)})}b(p),x($,p),K()}var $e=C('

                Error

                '),Ee=C('
                ',1);function Je($,P){J(P,!1);const a=d(),p=d(),I=d();let u=d([]),k=d(!0),r=d(""),n=d(""),h=null,o=d(1),g=d(25),l=d(""),i=d(!1),m=d(null);async function M(){try{s(k,!0),s(r,""),s(u,await B.listInstances())}catch(t){s(r,t instanceof Error?t.message:"Failed to load instances")}finally{s(k,!1)}}function F(t){s(m,t),s(i,!0)}async function Q(){if(e(m))try{await B.deleteInstance(e(m).name),be.success("Instance Deleted",`Instance ${e(m).name} has been deleted successfully.`),s(i,!1),s(m,null)}catch(t){s(r,t instanceof Error?t.message:"Failed to delete instance")}}const U=[{key:"name",title:"Name",cellComponent:Pe,cellProps:{entityType:"instance",showId:!0}},{key:"pool_scale_set",title:"Pool/Scale Set",flexible:!0,cellComponent:De},{key:"created",title:"Created",cellComponent:Ce,cellProps:{field:"created_at",type:"date"}},{key:"status",title:"Status",cellComponent:H,cellProps:{statusType:"instance",statusField:"status"}},{key:"runner_status",title:"Runner Status",cellComponent:H,cellProps:{statusType:"instance",statusField:"runner_status"}},{key:"actions",title:"Actions",align:"right",cellComponent:ke,cellProps:{actions:[{type:"delete",title:"Delete",ariaLabel:"Delete instance",action:"delete"}]}}],V={entityType:"instance",primaryText:{field:"name",isClickable:!0,href:"/instances/{name}"},secondaryText:{field:"provider_id"},badges:[{type:"status",field:"status"},{type:"status",field:"runner_status"}],actions:[{type:"delete",handler:t=>F(t)}]};function X(t){s(l,t.detail.term),s(o,1)}function Y(t){s(o,t.detail.page)}function Z(t){s(g,t.detail.perPage),s(o,1)}async function ee(){try{await M()}catch(t){console.error("Retry failed:",t)}}function te(t){}function ae(t){F(t.detail.item)}function se(t){if(t.operation==="create"){const c=t.payload;s(u,[...e(u),c])}else if(t.operation==="update"){const c=t.payload;s(u,e(u).map(v=>v.name===c.name?c:v))}else if(t.operation==="delete"){const c=t.payload.name||t.payload;s(u,e(u).filter(v=>v.name!==c))}}de(()=>{M(),h=ye.subscribeToEntity("instance",["create","update","delete"],se)}),ue(()=>{h&&(h(),h=null)}),w(()=>(e(u),e(l),e(n)),()=>{s(a,e(u).filter(t=>{const c=e(l)===""||t.name?.toLowerCase().includes(e(l).toLowerCase())||t.provider_id?.toLowerCase().includes(e(l).toLowerCase()),v=e(n)===""||t.status===e(n)||t.runner_status===e(n);return c&&v}))}),w(()=>(e(a),e(g)),()=>{s(p,Math.ceil(e(a).length/e(g)))}),w(()=>(e(o),e(p)),()=>{e(o)>e(p)&&e(p)>0&&s(o,e(p))}),w(()=>(e(a),e(o),e(g)),()=>{s(I,e(a).slice((e(o)-1)*e(g),e(o)*e(g)))}),me(),z();var R=Ee();pe(t=>{fe.title="Instances - GARM"});var E=O(R),N=y(E);_e(N,{title:"Runner Instances",description:"Monitor your running instances",showAction:!1});var G=S(N,2);{var re=t=>{var c=$e(),v=y(c),q=y(v),j=S(y(q),2),ie=y(j,!0);b(j),b(q),b(v),b(c),A(()=>L(ie,e(r))),x(t,c)};D(G,t=>{e(r)&&t(re)})}var ne=S(G,2);{let t=ge(()=>!!e(r));xe(ne,{get columns(){return U},get data(){return e(I)},get loading(){return e(k)},get error(){return e(r)},get searchTerm(){return e(l)},searchPlaceholder:"Search instances...",get currentPage(){return e(o)},get perPage(){return e(g)},get totalPages(){return e(p)},get totalItems(){return e(a),f(()=>e(a).length)},itemName:"instances",emptyIconType:"cog",get showRetry(){return e(t)},get mobileCardConfig(){return V},$$events:{search:X,pageChange:Y,perPageChange:Z,retry:ee,edit:te,delete:ae}})}b(E);var le=S(E,2);{var oe=t=>{he(t,{title:"Delete Instance",message:"Are you sure you want to delete this instance? This action cannot be undone.",get itemName(){return e(m),f(()=>e(m).name)},$$events:{close:()=>{s(i,!1),s(m,null)},confirm:Q}})};D(le,t=>{e(i)&&e(m)&&t(oe)})}x($,R),K()}export{Je as component}; diff --git a/webapp/assets/_app/immutable/nodes/9.DpSfMRgo.js b/webapp/assets/_app/immutable/nodes/9.DpSfMRgo.js new file mode 100644 index 00000000..54eb6b8a --- /dev/null +++ b/webapp/assets/_app/immutable/nodes/9.DpSfMRgo.js @@ -0,0 +1 @@ +import"../chunks/DsnmJJEf.js";import{i as Te}from"../chunks/B3Pzt0F_.js";import{p as Ue,o as Le,A as Oe,l as Ve,a as ze,f as g,h as Pe,b as O,t as f,c as v,d as Re,g as t,m as M,s as p,u as i,$ as qe,j as s,r as a,k as r,v as c,B as Et,n as b,e as Fe,q as Tt,D as Ut}from"../chunks/D8EpLgQ1.js";import{i as _,s as Ge,a as He}from"../chunks/5WA7h8uK.js";import{w as We,e as Lt,i as Ot}from"../chunks/u94nIB4-.js";import{c as nt,g as Vt,s as zt}from"../chunks/CiE1LlKV.js";import{b as Je}from"../chunks/BAg1iRPq.js";import{p as Ke}from"../chunks/C41YH50Q.js";import{g as Pt}from"../chunks/CTf6mQoE.js";import{b as A}from"../chunks/CoIRRsD9.js";import{D as Qe}from"../chunks/KQ2xQpA3.js";import{g as V,f as z}from"../chunks/ow_oMtSd.js";import{s as Rt,b as B,B as qt,d as Ft}from"../chunks/BGVHQGl-.js";var Xe=g('

                Error

                '),Ye=g('

                Loading instance details...

                '),Ze=g(' '),ta=g(' '),ea=g('-'),aa=g('
                Updated At:
                '),sa=g('
                '),ra=g('
                Network Addresses:
                '),da=g('
                Network Addresses:
                No addresses available
                '),ia=g('
                OS Type:
                '),na=g('
                OS Name:
                '),oa=g('
                OS Version:
                '),la=g('
                OS Architecture:
                '),va=g('

                '),xa=g('

                Status Messages

                '),ca=g('

                Status Messages

                No status messages available

                '),ma=g('

                Instance Information

                ID:
                Name:
                Provider ID:
                Provider:
                Pool/Scale Set:
                Agent ID:
                Created At:

                Status & Network

                Instance Status:
                Runner Status:
                ',1),ga=g('
                Instance not found.
                '),_a=g(' ',1);function Ba(Gt,Ht){Ue(Ht,!1);const[Wt,Jt]=Ge(),ot=()=>He(Ke,"$page",Wt),P=M();let e=M(null),R=M(!0),$=M(""),N=M(!1),C=null,E=M();async function Kt(){if(t(P))try{p(R,!0),p($,""),p(e,await Vt.getInstance(t(P)))}catch(o){p($,o instanceof Error?o.message:"Failed to load instance")}finally{p(R,!1)}}async function Qt(){if(t(e)){try{await Vt.deleteInstance(t(e).name),Pt(`${A}/instances`)}catch(o){p($,o instanceof Error?o.message:"Failed to delete instance")}p(N,!1)}}function Xt(o){if(t(e))if(o.operation==="update"&&o.payload.id===t(e).id){const h=t(e).status_messages?.length||0,j={...t(e),...o.payload},S=j.status_messages?.length||0;p(e,j),S>h&&setTimeout(()=>{Rt(t(E))},100)}else o.operation==="delete"&&(o.payload.id||o.payload)===t(e).id&&Pt(`${A}/instances`)}Le(()=>{Kt().then(()=>{t(e)?.status_messages?.length&&setTimeout(()=>{Rt(t(E))},100)}),C=We.subscribeToEntity("instance",["update","delete"],Xt)}),Oe(()=>{C&&(C(),C=null)}),Ve(()=>ot(),()=>{p(P,decodeURIComponent(ot().params.id||""))}),ze(),Te();var lt=_a();Pe(o=>{f(()=>qe.title=`${t(e),i(()=>t(e)?`${t(e).name} - Instance Details`:"Instance Details")??""} - GARM`)});var q=O(lt),F=s(q),vt=s(F),G=s(vt),Yt=s(G);a(G);var xt=r(G,2),ct=s(xt),mt=r(s(ct),2),Zt=s(mt,!0);a(mt),a(ct),a(xt),a(vt),a(F);var gt=r(F,2);{var te=o=>{var h=Xe(),j=s(h),S=s(j),T=r(s(S),2),I=s(T,!0);a(T),a(S),a(j),a(h),f(()=>c(I,t($))),v(o,h)};_(gt,o=>{t($)&&o(te)})}var ee=r(gt,2);{var ae=o=>{var h=Ye();v(o,h)},se=o=>{var h=Et(),j=O(h);{var S=I=>{var U=ma(),H=O(U),W=s(H),J=s(W),_t=r(s(J),2),ie=s(_t);a(_t),a(J);var ut=r(J,2),K=s(ut),ft=r(s(K),2),ne=s(ft,!0);a(ft),a(K);var Q=r(K,2),yt=r(s(Q),2),oe=s(yt,!0);a(yt),a(Q);var X=r(Q,2),pt=r(s(X),2),le=s(pt,!0);a(pt),a(X);var Y=r(X,2),ht=r(s(Y),2),ve=s(ht,!0);a(ht),a(Y);var Z=r(Y,2),kt=r(s(Z),2),xe=s(kt);{var ce=d=>{var n=Ze(),l=s(n,!0);a(n),f(()=>{nt(n,"href",`${A??""}/pools/${t(e),i(()=>t(e).pool_id)??""}`),c(l,(t(e),i(()=>t(e).pool_id)))}),v(d,n)},me=d=>{var n=Et(),l=O(n);{var m=u=>{var y=ta(),D=s(y,!0);a(y),f(()=>{nt(y,"href",`${A??""}/scalesets/${t(e),i(()=>t(e).scale_set_id)??""}`),c(D,(t(e),i(()=>t(e).scale_set_id)))}),v(u,y)},x=u=>{var y=ea();v(u,y)};_(l,u=>{t(e),i(()=>t(e).scale_set_id)?u(m):u(x,!1)},!0)}v(d,n)};_(xe,d=>{t(e),i(()=>t(e).pool_id)?d(ce):d(me,!1)})}a(kt),a(Z);var tt=r(Z,2),bt=r(s(tt),2),ge=s(bt,!0);a(bt),a(tt);var et=r(tt,2),wt=r(s(et),2),_e=s(wt,!0);a(wt),a(et);var ue=r(et,2);{var fe=d=>{var n=aa(),l=r(s(n),2),m=s(l,!0);a(l),a(n),f(x=>c(m,x),[()=>(b(B),t(e),i(()=>B(t(e).updated_at)))]),v(d,n)};_(ue,d=>{t(e),i(()=>t(e).updated_at&&t(e).updated_at!==t(e).created_at)&&d(fe)})}a(ut),a(W);var It=r(W,2),jt=r(s(It),2),at=s(jt),Dt=r(s(at),2),st=s(Dt),ye=s(st,!0);a(st),a(Dt),a(at);var rt=r(at,2),St=r(s(rt),2),dt=s(St),pe=s(dt,!0);a(dt),a(St),a(rt);var Mt=r(rt,2);{var he=d=>{var n=ra(),l=r(s(n),2);Lt(l,5,()=>(t(e),i(()=>t(e).addresses)),Ot,(m,x)=>{var u=sa(),y=s(u),D=s(y,!0);a(y);var it=r(y,2);{let L=Tt(()=>(t(x),i(()=>t(x).type||"Unknown")));qt(it,{variant:"info",get text(){return t(L)}})}a(u),f(()=>c(D,(t(x),i(()=>t(x).address)))),v(m,u)}),a(l),a(n),v(d,n)},ke=d=>{var n=da();v(d,n)};_(Mt,d=>{t(e),i(()=>t(e).addresses&&t(e).addresses.length>0)?d(he):d(ke,!1)})}var Bt=r(Mt,2);{var be=d=>{var n=ia(),l=r(s(n),2),m=s(l,!0);a(l),a(n),f(()=>c(m,(t(e),i(()=>t(e).os_type)))),v(d,n)};_(Bt,d=>{t(e),i(()=>t(e).os_type)&&d(be)})}var $t=r(Bt,2);{var we=d=>{var n=na(),l=r(s(n),2),m=s(l,!0);a(l),a(n),f(()=>c(m,(t(e),i(()=>t(e).os_name)))),v(d,n)};_($t,d=>{t(e),i(()=>t(e).os_name)&&d(we)})}var At=r($t,2);{var Ie=d=>{var n=oa(),l=r(s(n),2),m=s(l,!0);a(l),a(n),f(()=>c(m,(t(e),i(()=>t(e).os_version)))),v(d,n)};_(At,d=>{t(e),i(()=>t(e).os_version)&&d(Ie)})}var je=r(At,2);{var De=d=>{var n=la(),l=r(s(n),2),m=s(l,!0);a(l),a(n),f(()=>c(m,(t(e),i(()=>t(e).os_arch)))),v(d,n)};_(je,d=>{t(e),i(()=>t(e).os_arch)&&d(De)})}a(jt),a(It),a(H);var Se=r(H,2);{var Me=d=>{var n=xa(),l=r(s(n),2);Lt(l,5,()=>(t(e),i(()=>t(e).status_messages)),Ot,(m,x)=>{var u=va(),y=s(u),D=s(y),it=s(D,!0);a(D);var L=r(D,2),Nt=s(L);{var $e=k=>{const w=Tt(()=>(b(Ft),t(x),i(()=>Ft(t(x).event_level))));qt(k,{get variant(){return b(t(w)),i(()=>t(w).variant)},get text(){return b(t(w)),i(()=>t(w).text)}})};_(Nt,k=>{t(x),i(()=>t(x).event_level)&&k($e)})}var Ct=r(Nt,2),Ae=s(Ct);{var Ne=k=>{var w=Ut();f(Ee=>c(w,Ee),[()=>(b(B),t(x),i(()=>B(t(x).created_at)))]),v(k,w)},Ce=k=>{var w=Ut("Unknown date");v(k,w)};_(Ae,k=>{t(x),i(()=>t(x).created_at)?k(Ne):k(Ce,!1)})}a(Ct),a(L),a(y),a(u),f(()=>c(it,(t(x),i(()=>t(x).message)))),v(m,u)}),a(l),Je(l,m=>p(E,m),()=>t(E)),a(n),v(d,n)},Be=d=>{var n=ca();v(d,n)};_(Se,d=>{t(e),i(()=>t(e).status_messages&&t(e).status_messages.length>0)?d(Me):d(Be,!1)})}f((d,n,l,m,x)=>{c(ne,(t(e),i(()=>t(e).id))),c(oe,(t(e),i(()=>t(e).name))),c(le,(t(e),i(()=>t(e).provider_id))),c(ve,(t(e),i(()=>t(e).provider_name||"Unknown"))),c(ge,(t(e),i(()=>t(e).agent_id||"Not assigned"))),c(_e,d),zt(st,1,`inline-flex px-2 py-1 text-xs font-semibold rounded-full ring-1 ring-inset ${n??""}`),c(ye,l),zt(dt,1,`inline-flex px-2 py-1 text-xs font-semibold rounded-full ring-1 ring-inset ${m??""}`),c(pe,x)},[()=>(b(B),t(e),i(()=>B(t(e).created_at))),()=>(b(V),t(e),i(()=>V(t(e).status||"unknown"))),()=>(b(z),t(e),i(()=>z(t(e).status||"unknown"))),()=>(b(V),t(e),i(()=>V(t(e).runner_status||"unknown"))),()=>(b(z),t(e),i(()=>z(t(e).runner_status||"unknown")))]),Fe("click",ie,()=>p(N,!0)),v(I,U)},T=I=>{var U=ga();v(I,U)};_(j,I=>{t(e)?I(S):I(T,!1)},!0)}v(o,h)};_(ee,o=>{t(R)?o(ae):o(se,!1)})}a(q);var re=r(q,2);{var de=o=>{Qe(o,{title:"Delete Instance",message:"Are you sure you want to delete this instance? This action cannot be undone.",get itemName(){return t(e),i(()=>t(e).name)},$$events:{close:()=>p(N,!1),confirm:Qt}})};_(re,o=>{t(N)&&t(e)&&o(de)})}f(()=>{nt(Yt,"href",`${A}/instances`),c(Zt,(t(e),i(()=>t(e)?t(e).name:"Instance Details")))}),v(Gt,lt),Re(),Jt()}export{Ba as component}; diff --git a/webapp/assets/_app/version.json b/webapp/assets/_app/version.json new file mode 100644 index 00000000..6268ff48 --- /dev/null +++ b/webapp/assets/_app/version.json @@ -0,0 +1 @@ +{"version":"1755334486454"} \ No newline at end of file diff --git a/webapp/assets/assets.go b/webapp/assets/assets.go new file mode 100644 index 00000000..613baa0d --- /dev/null +++ b/webapp/assets/assets.go @@ -0,0 +1,83 @@ +package assets + +import ( + "embed" + "net/http" + "path/filepath" + "strings" +) + +//go:generate go run github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0 generate spec --output=../swagger.yaml --scan-models --work-dir=../../ +//go:generate go run github.com/go-swagger/go-swagger/cmd/swagger@v0.31.0 validate ../swagger.yaml +//go:generate rm -rf ../src/lib/api/generated +//go:generate openapi-generator-cli generate --skip-validate-spec -i ../swagger.yaml -g typescript-axios -o ../src/lib/api/generated + +//go:embed all:* +var EmbeddedSPA embed.FS + +// GetSPAFileSystem returns the embedded SPA file system for use with http.FileServer +func GetSPAFileSystem() http.FileSystem { + return http.FS(EmbeddedSPA) +} + +// ServeSPA serves the embedded SPA with proper content types and SPA routing +// This is kept for backward compatibility +func ServeSPA(w http.ResponseWriter, r *http.Request) { + ServeSPAWithPath(w, r, "/ui/") +} + +// ServeSPAWithPath serves the embedded SPA with a custom webapp path +func ServeSPAWithPath(w http.ResponseWriter, r *http.Request, webappPath string) { + filename := strings.TrimPrefix(r.URL.Path, webappPath) + + // Handle root path and SPA routing - serve index.html for all routes + if filename == "" || !strings.Contains(filename, ".") { + filename = "index.html" + } + + // Security check - prevent directory traversal + if strings.Contains(filename, "..") { + http.NotFound(w, r) + return + } + + // Read file from embedded filesystem + content, err := EmbeddedSPA.ReadFile(filename) + if err != nil { + // If file not found, serve index.html for SPA routing + content, err = EmbeddedSPA.ReadFile("index.html") + if err != nil { + http.NotFound(w, r) + return + } + filename = "index.html" + } + + // Set appropriate content type based on file extension + ext := strings.ToLower(filepath.Ext(filename)) + switch ext { + case ".html": + w.Header().Set("Content-Type", "text/html; charset=utf-8") + case ".js": + w.Header().Set("Content-Type", "application/javascript") + case ".css": + w.Header().Set("Content-Type", "text/css") + case ".json": + w.Header().Set("Content-Type", "application/json") + case ".svg": + w.Header().Set("Content-Type", "image/svg+xml") + case ".png": + w.Header().Set("Content-Type", "image/png") + default: + w.Header().Set("Content-Type", "text/plain") + } + + // Set cache headers for static assets (but not for HTML to ensure fresh content) + if ext != ".html" { + w.Header().Set("Cache-Control", "public, max-age=3600") + } else { + w.Header().Set("Cache-Control", "no-cache, must-revalidate") + } + + w.Write(content) +} diff --git a/webapp/assets/assets/garm-dark.svg b/webapp/assets/assets/garm-dark.svg new file mode 100644 index 00000000..f0a0c564 --- /dev/null +++ b/webapp/assets/assets/garm-dark.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/webapp/assets/assets/garm-light.svg b/webapp/assets/assets/garm-light.svg new file mode 100644 index 00000000..2495959d --- /dev/null +++ b/webapp/assets/assets/garm-light.svg @@ -0,0 +1,36 @@ + + + + + + + + + + diff --git a/webapp/assets/assets/gitea.svg b/webapp/assets/assets/gitea.svg new file mode 100644 index 00000000..e4643ce3 --- /dev/null +++ b/webapp/assets/assets/gitea.svg @@ -0,0 +1 @@ + diff --git a/webapp/assets/assets/github-mark-white.svg b/webapp/assets/assets/github-mark-white.svg new file mode 100644 index 00000000..d5e64918 --- /dev/null +++ b/webapp/assets/assets/github-mark-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webapp/assets/assets/github-mark.svg b/webapp/assets/assets/github-mark.svg new file mode 100644 index 00000000..37fa923d --- /dev/null +++ b/webapp/assets/assets/github-mark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webapp/assets/favicon-dark.png b/webapp/assets/favicon-dark.png new file mode 100644 index 0000000000000000000000000000000000000000..d16186d1d64f35f2676d6bb462e4824345f811de GIT binary patch literal 3506 zcmeHK`8O197k|dsjeTus8v7{BkRoKsjAaI8u1 zT>wP=a+@u+0bts(Ftfoi0($3m{*iwe`2S&m@#opag&3^>=p-w1YXBfHerArVUBekj zx7}ags<>F|{M4q_RqBs_-1MUVSUD&P-YO6jozUWz)WsUueD>8pbLyxt6DD?XZ-0CB zU9kl_abWQM_{>hJKkX2o#L4I{LK@2?Hk0g1PM^2%-*%d49a$(rT~VR^XC#Z!-1!Re za=LnvE{STnU`N-&yD?GX3hwY-3VM3Qq{7RtaU8cz4X))ZW|UlBIJwE<&o| z>5aqr#}E(tCi_F>rJL}%VS1hmpT2L5T%ev6P=0M2cTen5z>$kB=WdaCgUX&=JAGL$ z^Mp*!&9?M6F0DP!jU9)g*5Yqp?|A&;rK*!do_2S2T1|MC*f7+PK?CH9sSy^$vm7>N z7;GdH0*-Bkotsrt@ZOQM&kV9WOtAVko-=EA!!N!4Al!L6+G04)XyGtTpR?F1p8ZT3 zv%*8c5pWcJOjbc0g_l;-7IL=3L7ZVvUmILxf#56`PAE9F?85t&zm^rReYJa<>3g*B zW3%s^GKx z#FgWn=h(@jp;>mGJ}zqDhTP=jgq8-JcP{4HAd{%a=j^^r{{Yc;S2aNbRFL;z)@VqL${1HT7F)@pQde%&LzlE+*V^UzKt1er>xfeM?2xlmLytT{!lY7YsJ9Y~fbG zs=DjBwuek%U&UW49$oDW zzku88V!T}inYBxV@@dE#@{Hny(MR&p~#CcVRQb6)}pQOiCbp z#CcXLZ2biJ;Fm9(oCS15yf%SIZiCHVt(ve4-xz)r+>yD%L)5ggKO2fT(Pthv*By_S z{jDbfr?I{cO6J%m5PJQqN%tK5bNt_|rViO2szL(YlVwf2F+6Dzbxoz`+#AE7`Yq;p zkFu#9#%yT~h6@GR6Jw9o5yLC%%RRjd^6qU5unLuH5uQL!I~SjW3}=?PfK z@9EzVsq{V%{T+JgUG0}h@;k(3k>j=?TNBeJeW7Z%R+q_9txG^phX28eM21*H?SqE( zTsoWZ5fQ;|(9yHP3fVXGx{e?RIF~~?t6yg|o2E5~j3+HfU91unXR<)bOsK6{aP$;3 zW*`LXZ)`7O+!ly*lk$X%FaR|4(uLn`TVBjUY&URJ9Bn4vC30n{CzxH$M{CI67NI{liu>=8XT)p#g&hBf8y=M{7CI> zk)PFPx_{Yv%iP1Uqh0-s*W-K+i2}r@3AKBj9~P4>%EhUH%&0iOL5zY6(wBqR_2;a% zf&a3$dx&IHjn~IdJH8X2D?YvA*Si!OTcF(%rJ<`gbl#~~S z6MCpfgi#0Wc&Wv0p&8|JY}z_F5o%Jjq7t+tknS!--VF9T0q-+u@|VzrgCJa+dD#egmGr5VQS!po?+w95 zoepu*Lqut@p2(pYEfvr+1qY`WpREf)o7)Pu_X(^Jm>J9|0t0b^YdZzl0RAB<&ogBE zBG-9gzlzP{B610wB|2eCU(P}}pT~eYB7Q-9BG$`!!}^7_p6L=6fVcLwt(0!_TMzyc zJ6UB;k)0TRaf6&U@^iTAvF&K4aR**P-V0GMtN7kK zoccKTcxro-dW8C^_az$ce8WG~)n$}6S#p(vt%-UpAHM3xrois5&Y9bk zU|`Scf-^#g)EtDIl@NUt=uSc36tfU8fP% ze{LjGKk&Chif3k;rXJ!;MeF%Yvu%g2K0Z+e%YCtHW60)6WLmK)1oo?Vm?GhN>jOSr ze$mo3#8E+>C8K$;!c`7w*uP3M63nIvvM2Qh1eU1?$G=wtnLG6#_qzDj-%WM|89LMU#!~tb#9efGIKxv`UPhl^Q*@_i2lirT(>em+` zKR3Jd-W)Ie0Uk>PcO`r(pXua9ha{TL{{c-*w>TsV6)(|IOFK{Yu0FmUn8Y)TDmZ@eGDsE za1~NMD%Png(AMrhu=<5%qeCt^tHf**Es1~mHons2lnjo&gI|#BSR%5K?9NiIMlKz= zR*ahB9$9zRxh>?Sk%l_#`K{xLO$$?xh#Jzq2jtqoIxi2D&24cS zR-K-2l}x2eJSDft!JLeH!dOVsi@FDcYpsDzs2!Gi^#H!b7KZ~>#AXilbhu6tgspnY zumo~aGbW2lO-T($eY%ot*un;y?i%sB2 z$bdsb0j=3TBKmORDw_NUnI)V{yuq=Vbcg?{u%0@{UV!sye1@_*UWIwn4{bd-y){nK zs$!SlX+5!!u~xaWeUN%rfl#K}Upkdx_UcdDzUYyS`Q2g7v=PP>B1^)ZBe^=0+%#SM z-53g}VpLBkVKkIfRBcpLHPtj2atwpf#9+$tIK~F_UjQGXtCxG|{|1bS9vmV8ED@D`scdCe z3E4v=SxSbX-ub@g{o(!P{R`gjIrq7rbMJjV&pqdJo*(YLZDDT24TVDi0Nf_VSStoP z{e3u?8UBOeUw;=^JoE|r06b0R+IMDU#7GxoD*^yvasZHH0N7)s$jbl(VgUH+1c2s! z07U(=8!fc~VA`=Tv%xVg@W|`@WB(}d|Dyoo&(HN{K4t)&WMys*00hR*!g;l0C=Kbh z`|Dc;7h8>=+T^-Q?eR~WUi2R;2L-`fd4i(jTHKPlSOc5SzWQfQ9TjH6#4hgbZ?C>D zwBR824}2J#-YNE{9paNX8T~~_W0}Nml35P*c?bV(r-{~)WhSUADzyHLWHp*SUnZXT zwK3V+>f>Xxk)@a`f%6aB^Ib)z-aMPBPbf;_387Rgp$zZdA2m0%_x8AC>0FA7kg9ur z<8baV#G{^xzEFAT27Gpyp69~c_l@BT)UyK0Z*Aiqh&>57a$Ei!LV$%|{JFUzH$ zkjc8)lG^Li-1XAfaWHBv{`U2@r>|bCIyvNMcUGoUg=dHjF&i>ufLt*(!h(3#!^Vt& zon%75v9EA&vuR2|^Ar66;P5cP>f3luuiX#7^zNf@`{`(lp*W+3!!&(pp;bJ`nG_a< z$AZJ)DEgSJf;b89&Gs!lRjQtO0jd zj<=uVAd7}(*m?T6sDT@D6BFZF8gSm(m=^;~q8^_!d(!;_L|a|e1PRQ7yl1l)-PGg- zUwu235s+Aj(3nPR(P?*I z(gMF(aI;hQyg&i9I9IHp&q9l*qjxc*HlnbQaLavF#=Y~c?Xr+JAJDs`jh5UDZzR`F z@ScX%u<*6Tc~heDIcEdS?8I2|<1Jbt;Ie}5;w|?r6npXB_LlGx>%;RP|;_R}ESSm!SN4i@rz z>Ni9xwZ}t$hhBVN`!$mM9&uUZxGl)k#I#6XsMxL6WpY&O5YUt1f3zZzCRSJdsBS%* z&MtgJM6eUIb*->L_6@zRBgg^HrOeREw;7G5DUBgx2@6seD@4VaERZteYHJppU3v9s z2*KJL+lv^t1tQ&~^v*>X02+F!!tb{&FJ?DPJgD&Pc^QqYzbXH7pm_e}j4ikGzR^89 zlc;rqc&?Lqs;#YBrzacUq7D$Z{Jqu_${<>Yn!Iiqdh zzpU*ZBH2*o^=WR$cl>kN+#7zqOR=$e+D%a!x_X1>ow_wXTN{ZBlw~LBTG~CQ)(AYK zhl)fPwb70jTih0!R*w2r*`K$Gwxlxky@vSoa%JNwdj&NS*A1#%-6H#;VXP$+SAk_Q zZC54(WNSAwO`M$1(Ry*^3eR)<>xtNhR#ZIfday$v!I0^@(;6%JN7a{BpdA?g=m zncsboHN~3U@0xr~LqFSRrqrO%=fWTpRVJ}ZXm25zDXAw)CIt@OVR=`8Ty0M|+=xKQ z;g1_J4?5t&au*zMLHqxl>J24rWXs9R#p@U_>wS|faGd)7algIcsGupa1_=`KkvKZL z@tcCySFp2_rjr(-sQ_RjDLOw%(ko}Oa=t0g^N8eVqcS*VMhP5^9#J|sgB!p8DU%{w zvH3l0{!Xl4pUq&a41oA9gzQxV+SaSRKwWl~Bh#JU5z527)5Qt5M+6EI7p{J<3pQ$Z zh?5>9N{e+x4o+*SfUZe6IKB8{U5L4{C2xD5zy^Vt!JHy65GS~{Q-BTNAC&SuL$)t) zofq~i+dM8JcL!Re6Snl_ECl*82GkJo3*zIkUd|iVudMYRk70b|QQpbwc)!3uO6*f2ga=2yLS1Dg|2=^;AB5)sJ0)!(APk-Ehai zp3Mbkgbt}X2stYu`XtCFE05BnieKw98T1V8z3?X7Y)`4wSRmmQWyf|%iqBoA9@Tel zI9)&Rw?mR=dWxnV;!9cc`E;{whmIaTQ3cC=v1_Bq#zD8)iDS71`0JFG7B4 zcIksTUiu?EmI&@k_>{lU$%zh0GzC_B#>UKdC;*Dump`Q;Fagdxwr4g?OkE;sNc%33Z3An+++Q-g@#)escBbj@;|ny5Kx|88 zYOYlxl`ip|+$0BcGVTgvB}p&p9t^BC2R5K~SZmb-_!gTS4pb4FS=7_vIt38+%1Of_ z$VttZ3@SA#IUJRB_u2^O#BVyAE)5YJ7 z0YDX_dO``Kp`@Z}qoS&*ropgd7>p(cQ;NqiHlY6^_z+#a+(Z92VN~?sfI-mtyF);b zho%eB$H&c=1ds;*?&OLL_9A&AO? + + + + + + + + + + + + + + + + + + + + + + + +
                + +
                + + diff --git a/webapp/assets/openapitools.json b/webapp/assets/openapitools.json new file mode 100644 index 00000000..a82623d6 --- /dev/null +++ b/webapp/assets/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.14.0" + } +} diff --git a/webapp/openapitools.json b/webapp/openapitools.json new file mode 100644 index 00000000..a82623d6 --- /dev/null +++ b/webapp/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.14.0" + } +} diff --git a/webapp/package-lock.json b/webapp/package-lock.json new file mode 100644 index 00000000..c6e47eb5 --- /dev/null +++ b/webapp/package-lock.json @@ -0,0 +1,5603 @@ +{ + "name": "garm-webapp", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "garm-webapp", + "version": "0.0.1", + "license": "ISC", + "dependencies": { + "@codemirror/lang-json": "^6.0.2", + "@codemirror/state": "^6.5.2", + "@codemirror/theme-one-dark": "^6.1.3", + "@codemirror/view": "^6.38.1", + "@tailwindcss/typography": "^0.5.10", + "codemirror": "^6.0.2" + }, + "devDependencies": { + "@openapitools/openapi-generator-cli": "^2.21.4", + "@sveltejs/adapter-static": "^3.0.1", + "@sveltejs/kit": "^2.0.0", + "@sveltejs/vite-plugin-svelte": "^6.1.0", + "@tailwindcss/forms": "^0.5.7", + "@tailwindcss/postcss": "^4.1.11", + "@types/node": "^24.2.0", + "autoprefixer": "^10.4.16", + "postcss": "^8.4.32", + "svelte": "^5.38.0", + "svelte-check": "^4.3.1", + "swagger-typescript-api": "^13.2.7", + "tailwindcss": "^4.1.11", + "typescript": "^5.0.0", + "vite": "^7.1.1" + } + }, + "node_modules/@alloc/quick-lru": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@alloc/quick-lru/-/quick-lru-5.2.0.tgz", + "integrity": "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@biomejs/js-api": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@biomejs/js-api/-/js-api-1.0.0.tgz", + "integrity": "sha512-69OfQ7+09AtiCIg+k+aU3rEsGit5o/SJWCS3BeBH/2nJYdJGi0cIx+ybka8i1EK69aNcZxYO1y1iAAEmYMq1HA==", + "dev": true, + "license": "MIT OR Apache-2.0", + "peerDependencies": { + "@biomejs/wasm-bundler": "^2.0.0", + "@biomejs/wasm-nodejs": "^2.0.0", + "@biomejs/wasm-web": "^2.0.0" + }, + "peerDependenciesMeta": { + "@biomejs/wasm-bundler": { + "optional": true + }, + "@biomejs/wasm-nodejs": { + "optional": true + }, + "@biomejs/wasm-web": { + "optional": true + } + } + }, + "node_modules/@biomejs/wasm-nodejs": { + "version": "2.0.5", + "dev": true, + "license": "MIT OR Apache-2.0" + }, + "node_modules/@codemirror/autocomplete": { + "version": "6.18.6", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.18.6.tgz", + "integrity": "sha512-PHHBXFomUs5DF+9tCOM/UoW6XQ4R44lLNNhRaW9PKPTU0D7lIjRg3ElxaJnTwsl/oHiR93WSXDBrekhoUGCPtg==", + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@codemirror/autocomplete/node_modules/@lezer/common": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", + "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==", + "license": "MIT" + }, + "node_modules/@codemirror/commands": { + "version": "6.8.1", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.8.1.tgz", + "integrity": "sha512-KlGVYufHMQzxbdQONiLyGQDUW0itrLZwq3CcY7xpv9ZLRHqzkBSoteocBHtMCoY7/Ci4xhzSrToIeLg7FxHuaw==", + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.4.0", + "@codemirror/view": "^6.27.0", + "@lezer/common": "^1.1.0" + } + }, + "node_modules/@codemirror/commands/node_modules/@lezer/common": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", + "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==", + "license": "MIT" + }, + "node_modules/@codemirror/lang-json": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/@codemirror/lang-json/-/lang-json-6.0.2.tgz", + "integrity": "sha512-x2OtO+AvwEHrEwR0FyyPtfDUiloG3rnVTSZV1W8UteaLL8/MajQd8DpvUb2YVzC+/T18aSDv0H9mu+xw0EStoQ==", + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@lezer/json": "^1.0.0" + } + }, + "node_modules/@codemirror/language": { + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.11.2.tgz", + "integrity": "sha512-p44TsNArL4IVXDTbapUmEkAlvWs2CFQbcfc0ymDsis1kH2wh0gcY96AS29c/vp2d0y2Tquk1EDSaawpzilUiAw==", + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.23.0", + "@lezer/common": "^1.1.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "node_modules/@codemirror/language/node_modules/@lezer/common": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", + "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==", + "license": "MIT" + }, + "node_modules/@codemirror/language/node_modules/@lezer/lr": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.2.tgz", + "integrity": "sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==", + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@codemirror/language/node_modules/style-mod": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz", + "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==", + "license": "MIT" + }, + "node_modules/@codemirror/lint": { + "version": "6.8.5", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.8.5.tgz", + "integrity": "sha512-s3n3KisH7dx3vsoeGMxsbRAgKe4O1vbrnKBClm99PU0fWxmxsx5rR2PfqQgIt+2MMJBHbiJ5rfIdLYfB9NNvsA==", + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.35.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/lint/node_modules/crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", + "license": "MIT" + }, + "node_modules/@codemirror/search": { + "version": "6.5.11", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.11.tgz", + "integrity": "sha512-KmWepDE6jUdL6n8cAAqIpRmLPBZ5ZKnicE8oGU/s3QrAVID+0VhLFrzUucVKHG5035/BSykhExDL/Xm7dHthiA==", + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/search/node_modules/crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", + "license": "MIT" + }, + "node_modules/@codemirror/state": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.5.2.tgz", + "integrity": "sha512-FVqsPqtPWKVVL3dPSxy8wEF/ymIEuVzF1PK3VbUgrxXpJUSHQWWZz4JMToquRxnkw+36LTamCZG2iua2Ptq0fA==", + "license": "MIT", + "dependencies": { + "@marijn/find-cluster-break": "^1.0.0" + } + }, + "node_modules/@codemirror/theme-one-dark": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.3.tgz", + "integrity": "sha512-NzBdIvEJmx6fjeremiGp3t/okrLPYT0d9orIc7AFun8oZcRk58aejkqhv6spnz4MLAevrKNPMQYXEWMg4s+sKA==", + "license": "MIT", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/highlight": "^1.0.0" + } + }, + "node_modules/@codemirror/view": { + "version": "6.38.1", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.38.1.tgz", + "integrity": "sha512-RmTOkE7hRU3OVREqFVITWHz6ocgBjv08GoePscAakgVQfciA3SGCEk7mb9IzwW61cKKmlTpHXG6DUE5Ubx+MGQ==", + "license": "MIT", + "dependencies": { + "@codemirror/state": "^6.5.0", + "crelt": "^1.0.6", + "style-mod": "^4.1.0", + "w3c-keyname": "^2.2.4" + } + }, + "node_modules/@codemirror/view/node_modules/crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", + "license": "MIT" + }, + "node_modules/@codemirror/view/node_modules/style-mod": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.2.tgz", + "integrity": "sha512-wnD1HyVqpJUI2+eKZ+eo1UwghftP6yuFheBqqe+bWCotBjC2K1YnteJILRMs3SM4V/0dLEW1SC27MWP5y+mwmw==", + "license": "MIT" + }, + "node_modules/@codemirror/view/node_modules/w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", + "license": "MIT" + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.8.tgz", + "integrity": "sha512-urAvrUedIqEiFR3FYSLTWQgLu5tb+m0qZw0NBEasUeo6wuqatkMDaRT+1uABiGXEu5vqgPd7FGE1BhsAIy9QVA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.8.tgz", + "integrity": "sha512-RONsAvGCz5oWyePVnLdZY/HHwA++nxYWIX1atInlaW6SEkwq6XkP3+cb825EUcRs5Vss/lGh/2YxAb5xqc07Uw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.8.tgz", + "integrity": "sha512-OD3p7LYzWpLhZEyATcTSJ67qB5D+20vbtr6vHlHWSQYhKtzUYrETuWThmzFpZtFsBIxRvhO07+UgVA9m0i/O1w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.8.tgz", + "integrity": "sha512-yJAVPklM5+4+9dTeKwHOaA+LQkmrKFX96BM0A/2zQrbS6ENCmxc4OVoBs5dPkCCak2roAD+jKCdnmOqKszPkjA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.8.tgz", + "integrity": "sha512-Jw0mxgIaYX6R8ODrdkLLPwBqHTtYHJSmzzd+QeytSugzQ0Vg4c5rDky5VgkoowbZQahCbsv1rT1KW72MPIkevw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.8.tgz", + "integrity": "sha512-Vh2gLxxHnuoQ+GjPNvDSDRpoBCUzY4Pu0kBqMBDlK4fuWbKgGtmDIeEC081xi26PPjn+1tct+Bh8FjyLlw1Zlg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.8.tgz", + "integrity": "sha512-YPJ7hDQ9DnNe5vxOm6jaie9QsTwcKedPvizTVlqWG9GBSq+BuyWEDazlGaDTC5NGU4QJd666V0yqCBL2oWKPfA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.8.tgz", + "integrity": "sha512-MmaEXxQRdXNFsRN/KcIimLnSJrk2r5H8v+WVafRWz5xdSVmWLoITZQXcgehI2ZE6gioE6HirAEToM/RvFBeuhw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.8.tgz", + "integrity": "sha512-FuzEP9BixzZohl1kLf76KEVOsxtIBFwCaLupVuk4eFVnOZfU+Wsn+x5Ryam7nILV2pkq2TqQM9EZPsOBuMC+kg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.8.tgz", + "integrity": "sha512-WIgg00ARWv/uYLU7lsuDK00d/hHSfES5BzdWAdAig1ioV5kaFNrtK8EqGcUBJhYqotlUByUKz5Qo6u8tt7iD/w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.8.tgz", + "integrity": "sha512-A1D9YzRX1i+1AJZuFFUMP1E9fMaYY+GnSQil9Tlw05utlE86EKTUA7RjwHDkEitmLYiFsRd9HwKBPEftNdBfjg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.8.tgz", + "integrity": "sha512-O7k1J/dwHkY1RMVvglFHl1HzutGEFFZ3kNiDMSOyUrB7WcoHGf96Sh+64nTRT26l3GMbCW01Ekh/ThKM5iI7hQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.8.tgz", + "integrity": "sha512-uv+dqfRazte3BzfMp8PAQXmdGHQt2oC/y2ovwpTteqrMx2lwaksiFZ/bdkXJC19ttTvNXBuWH53zy/aTj1FgGw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.8.tgz", + "integrity": "sha512-GyG0KcMi1GBavP5JgAkkstMGyMholMDybAf8wF5A70CALlDM2p/f7YFE7H92eDeH/VBtFJA5MT4nRPDGg4JuzQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.8.tgz", + "integrity": "sha512-rAqDYFv3yzMrq7GIcen3XP7TUEG/4LK86LUPMIz6RT8A6pRIDn0sDcvjudVZBiiTcZCY9y2SgYX2lgK3AF+1eg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.8.tgz", + "integrity": "sha512-Xutvh6VjlbcHpsIIbwY8GVRbwoviWT19tFhgdA7DlenLGC/mbc3lBoVb7jxj9Z+eyGqvcnSyIltYUrkKzWqSvg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.8.tgz", + "integrity": "sha512-ASFQhgY4ElXh3nDcOMTkQero4b1lgubskNlhIfJrsH5OKZXDpUAKBlNS0Kx81jwOBp+HCeZqmoJuihTv57/jvQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.8.tgz", + "integrity": "sha512-d1KfruIeohqAi6SA+gENMuObDbEjn22olAR7egqnkCD9DGBG0wsEARotkLgXDu6c4ncgWTZJtN5vcgxzWRMzcw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.8.tgz", + "integrity": "sha512-nVDCkrvx2ua+XQNyfrujIG38+YGyuy2Ru9kKVNyh5jAys6n+l44tTtToqHjino2My8VAY6Lw9H7RI73XFi66Cg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.8.tgz", + "integrity": "sha512-j8HgrDuSJFAujkivSMSfPQSAa5Fxbvk4rgNAS5i3K+r8s1X0p1uOO2Hl2xNsGFppOeHOLAVgYwDVlmxhq5h+SQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.8.tgz", + "integrity": "sha512-1h8MUAwa0VhNCDp6Af0HToI2TJFAn1uqT9Al6DJVzdIBAd21m/G0Yfc77KDM3uF3T/YaOgQq3qTJHPbTOInaIQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.8.tgz", + "integrity": "sha512-r2nVa5SIK9tSWd0kJd9HCffnDHKchTGikb//9c7HX+r+wHYCpQrSgxhlY6KWV1nFo1l4KFbsMlHk+L6fekLsUg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.8.tgz", + "integrity": "sha512-zUlaP2S12YhQ2UzUfcCuMDHQFJyKABkAjvO5YSndMiIkMimPmxA+BYSBikWgsRpvyxuRnow4nS5NPnf9fpv41w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.8.tgz", + "integrity": "sha512-YEGFFWESlPva8hGL+zvj2z/SaK+pH0SwOM0Nc/d+rVnW7GSTFlLBGzZkuSU9kFIGIo8q9X3ucpZhu8PDN5A2sQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.8.tgz", + "integrity": "sha512-hiGgGC6KZ5LZz58OL/+qVVoZiuZlUYlYHNAmczOm7bs2oE1XriPFi5ZHHrS8ACpV5EjySrnoCKmcbQMN+ojnHg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.8.tgz", + "integrity": "sha512-cn3Yr7+OaaZq1c+2pe+8yxC8E144SReCQjN6/2ynubzYjvyqZjTXfQJpAcQpsdJq3My7XADANiYGHoFC69pLQw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.12", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.12.tgz", + "integrity": "sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz", + "integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.29", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.29.tgz", + "integrity": "sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@lezer/highlight": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.1.tgz", + "integrity": "sha512-Z5duk4RN/3zuVO7Jq0pGLJ3qynpxUVsh7IbUbGj88+uV2ApSAn6kWg2au3iJb+0Zi7kKtqffIESgNcRXWZWmSA==", + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@lezer/highlight/node_modules/@lezer/common": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", + "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==", + "license": "MIT" + }, + "node_modules/@lezer/json": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@lezer/json/-/json-1.0.3.tgz", + "integrity": "sha512-BP9KzdF9Y35PDpv04r0VeSTKDeox5vVr3efE7eBbx3r4s3oNLfunchejZhjArmeieBH+nVOpgIiBJpEAv8ilqQ==", + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.2.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0" + } + }, + "node_modules/@lezer/json/node_modules/@lezer/common": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.2.3.tgz", + "integrity": "sha512-w7ojc8ejBqr2REPsWxJjrMFsA/ysDCFICn8zEOR9mrqzOu2amhITYuLD8ag6XZf0CFXDrhKqw7+tW8cX66NaDA==", + "license": "MIT" + }, + "node_modules/@lezer/json/node_modules/@lezer/lr": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.4.2.tgz", + "integrity": "sha512-pu0K1jCIdnQ12aWNaAVU5bzi7Bd1w54J3ECgANPmYLtQKP0HBj2cE/5coBD66MT10xbtIuUr7tg0Shbsvk0mDA==", + "license": "MIT", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@marijn/find-cluster-break": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@marijn/find-cluster-break/-/find-cluster-break-1.0.2.tgz", + "integrity": "sha512-l0h88YhZFyKdXIFNfSWpyjStDjGHwZ/U7iobcK1cQQD8sejsONdQtTVU+1wVN1PBw40PiiHB1vA5S7VTfQiP9g==", + "license": "MIT" + }, + "node_modules/@nestjs/axios": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@nestjs/axios/-/axios-4.0.1.tgz", + "integrity": "sha512-68pFJgu+/AZbWkGu65Z3r55bTsCPlgyKaV4BSG8yUAD72q1PPuyVRgUwFv6BxdnibTUHlyxm06FmYWNC+bjN7A==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@nestjs/common": "^10.0.0 || ^11.0.0", + "axios": "^1.3.1", + "rxjs": "^7.0.0" + } + }, + "node_modules/@nestjs/common": { + "version": "11.1.5", + "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.5.tgz", + "integrity": "sha512-DQpWdr3ShO0BHWkHl3I4W/jR6R3pDtxyBlmrpTuZF+PXxQyBXNvsUne0Wyo6QHPEDi+pAz9XchBFoKbqOhcdTg==", + "dev": true, + "license": "MIT", + "dependencies": { + "file-type": "21.0.0", + "iterare": "1.2.1", + "load-esm": "1.0.2", + "tslib": "2.8.1", + "uid": "2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "class-transformer": ">=0.4.1", + "class-validator": ">=0.13.2", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, + "node_modules/@nestjs/common/node_modules/@lukeed/csprng": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", + "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@nestjs/common/node_modules/@tokenizer/inflate": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.2.7.tgz", + "integrity": "sha512-MADQgmZT1eKjp06jpI2yozxaU9uVs4GzzgSL+uEq7bVcJ9V1ZXQkeGNql1fsSI0gMy1vhvNTNbUqrx+pZfJVmg==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "fflate": "^0.8.2", + "token-types": "^6.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/@nestjs/common/node_modules/fflate": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.2.tgz", + "integrity": "sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==", + "dev": true, + "license": "MIT" + }, + "node_modules/@nestjs/common/node_modules/file-type": { + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/file-type/-/file-type-21.0.0.tgz", + "integrity": "sha512-ek5xNX2YBYlXhiUXui3D/BXa3LdqPmoLJ7rqEx2bKJ7EAUEfmXgW0Das7Dc6Nr9MvqaOnIqiPV0mZk/r/UpNAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tokenizer/inflate": "^0.2.7", + "strtok3": "^10.2.2", + "token-types": "^6.0.0", + "uint8array-extras": "^1.4.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sindresorhus/file-type?sponsor=1" + } + }, + "node_modules/@nestjs/common/node_modules/strtok3": { + "version": "10.3.4", + "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.4.tgz", + "integrity": "sha512-KIy5nylvC5le1OdaaoCJ07L+8iQzJHGH6pWDuzS+d07Cu7n1MZ2x26P8ZKIWfbK02+XIL8Mp4RkWeqdUCrDMfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tokenizer/token": "^0.3.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/@nestjs/common/node_modules/uid": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", + "integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lukeed/csprng": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@nestjs/core": { + "version": "11.1.5", + "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.5.tgz", + "integrity": "sha512-Qr25MEY9t8VsMETy7eXQ0cNXqu0lzuFrrTr+f+1G57ABCtV5Pogm7n9bF71OU2bnkDD32Bi4hQLeFR90cku3Tw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@nuxt/opencollective": "0.4.1", + "fast-safe-stringify": "2.1.1", + "iterare": "1.2.1", + "path-to-regexp": "8.2.0", + "tslib": "2.8.1", + "uid": "2.0.2" + }, + "engines": { + "node": ">= 20" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^11.0.0", + "@nestjs/microservices": "^11.0.0", + "@nestjs/platform-express": "^11.0.0", + "@nestjs/websockets": "^11.0.0", + "reflect-metadata": "^0.1.12 || ^0.2.0", + "rxjs": "^7.1.0" + }, + "peerDependenciesMeta": { + "@nestjs/microservices": { + "optional": true + }, + "@nestjs/platform-express": { + "optional": true + }, + "@nestjs/websockets": { + "optional": true + } + } + }, + "node_modules/@nestjs/core/node_modules/@lukeed/csprng": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", + "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@nestjs/core/node_modules/@nuxt/opencollective": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@nuxt/opencollective/-/opencollective-0.4.1.tgz", + "integrity": "sha512-GXD3wy50qYbxCJ652bDrDzgMr3NFEkIS374+IgFQKkCvk9yiYcLvX2XDYr7UyQxf4wK0e+yqDYRubZ0DtOxnmQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "consola": "^3.2.3" + }, + "bin": { + "opencollective": "bin/opencollective.js" + }, + "engines": { + "node": "^14.18.0 || >=16.10.0", + "npm": ">=5.10.0" + } + }, + "node_modules/@nestjs/core/node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/@nestjs/core/node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@nestjs/core/node_modules/uid": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", + "integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@lukeed/csprng": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@nuxtjs/opencollective": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@nuxtjs/opencollective/-/opencollective-0.3.2.tgz", + "integrity": "sha512-um0xL3fO7Mf4fDxcqx9KryrB7zgRM5JSlvGN5AGkP6JLM5XEKyjeAiPbNxdXVXQ16isuAhYpvP88NgL2BGd6aA==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "consola": "^2.15.0", + "node-fetch": "^2.6.1" + }, + "bin": { + "opencollective": "bin/opencollective.js" + }, + "engines": { + "node": ">=8.0.0", + "npm": ">=5.0.0" + } + }, + "node_modules/@nuxtjs/opencollective/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/@openapitools/openapi-generator-cli": { + "version": "2.21.4", + "resolved": "https://registry.npmjs.org/@openapitools/openapi-generator-cli/-/openapi-generator-cli-2.21.4.tgz", + "integrity": "sha512-s2OBgiNml0DL0ebkvAMQxZi7c8SUQMHssTUJwWsFDv4kVtBVDV4UzsCh9gQEXlNjuEcEgZoa5BIOai2sT0sE8g==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@nestjs/axios": "4.0.1", + "@nestjs/common": "11.1.5", + "@nestjs/core": "11.1.5", + "@nuxtjs/opencollective": "0.3.2", + "axios": "1.11.0", + "chalk": "4.1.2", + "commander": "8.3.0", + "compare-versions": "4.1.4", + "concurrently": "9.2.0", + "console.table": "0.10.0", + "fs-extra": "11.3.0", + "glob": "11.0.3", + "inquirer": "8.2.6", + "lodash": "4.17.21", + "proxy-agent": "6.5.0", + "reflect-metadata": "0.2.2", + "rxjs": "7.8.2", + "tslib": "2.8.1" + }, + "bin": { + "openapi-generator-cli": "main.js" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/openapi_generator" + } + }, + "node_modules/@polka/url": { + "version": "1.0.0-next.29", + "dev": true, + "license": "MIT" + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.46.2", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@sveltejs/acorn-typescript": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.5.tgz", + "integrity": "sha512-IwQk4yfwLdibDlrXVE04jTZYlLnwsTT2PIOQQGNLWfjavGifnk1JD1LcZjZaBTRcxZu2FfPfNLOE04DSu9lqtQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^8.9.0" + } + }, + "node_modules/@sveltejs/adapter-static": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.9.tgz", + "integrity": "sha512-aytHXcMi7lb9ljsWUzXYQ0p5X1z9oWud2olu/EpmH7aCu4m84h7QLvb5Wp+CFirKcwoNnYvYWhyP/L8Vh1ztdw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@sveltejs/kit": "^2.0.0" + } + }, + "node_modules/@sveltejs/kit": { + "version": "2.27.3", + "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.27.3.tgz", + "integrity": "sha512-jiG3NGZ8RRpi+ncjVnX+oR7uWEgzy//3YLGcTU5mHtjGraeGyNDr7GJFHlk7z0vi8bMXpXIUkEXj6p70FJmHvw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "@sveltejs/acorn-typescript": "^1.0.5", + "@types/cookie": "^0.6.0", + "acorn": "^8.14.1", + "cookie": "^0.6.0", + "devalue": "^5.1.0", + "esm-env": "^1.2.2", + "kleur": "^4.1.5", + "magic-string": "^0.30.5", + "mrmime": "^2.0.0", + "sade": "^1.8.1", + "set-cookie-parser": "^2.6.0", + "sirv": "^3.0.0" + }, + "bin": { + "svelte-kit": "svelte-kit.js" + }, + "engines": { + "node": ">=18.13" + }, + "peerDependencies": { + "@sveltejs/vite-plugin-svelte": "^3.0.0 || ^4.0.0-next.1 || ^5.0.0 || ^6.0.0-next.0", + "svelte": "^4.0.0 || ^5.0.0-next.0", + "vite": "^5.0.3 || ^6.0.0 || ^7.0.0-beta.0" + } + }, + "node_modules/@sveltejs/kit/node_modules/@standard-schema/spec": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", + "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sveltejs/kit/node_modules/devalue": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.1.1.tgz", + "integrity": "sha512-maua5KUiapvEwiEAe+XnlZ3Rh0GD+qI1J/nb9vrJc3muPXvcF/8gXYTWF76+5DAqHyDUtOIImEuo0YKE9mshVw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sveltejs/vite-plugin-svelte": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-6.1.0.tgz", + "integrity": "sha512-+U6lz1wvGEG/BvQyL4z/flyNdQ9xDNv5vrh+vWBWTHaebqT0c9RNggpZTo/XSPoHsSCWBlYaTlRX8pZ9GATXCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sveltejs/vite-plugin-svelte-inspector": "^5.0.0-next.1", + "debug": "^4.4.1", + "deepmerge": "^4.3.1", + "kleur": "^4.1.5", + "magic-string": "^0.30.17", + "vitefu": "^1.1.1" + }, + "engines": { + "node": "^20.19 || ^22.12 || >=24" + }, + "peerDependencies": { + "svelte": "^5.0.0", + "vite": "^6.3.0 || ^7.0.0" + } + }, + "node_modules/@sveltejs/vite-plugin-svelte-inspector": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte-inspector/-/vite-plugin-svelte-inspector-5.0.0.tgz", + "integrity": "sha512-iwQ8Z4ET6ZFSt/gC+tVfcsSBHwsqc6RumSaiLUkAurW3BCpJam65cmHw0oOlDMTO0u+PZi9hilBRYN+LZNHTUQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^4.4.1" + }, + "engines": { + "node": "^20.19 || ^22.12 || >=24" + }, + "peerDependencies": { + "@sveltejs/vite-plugin-svelte": "^6.0.0-next.0", + "svelte": "^5.0.0", + "vite": "^6.3.0 || ^7.0.0" + } + }, + "node_modules/@tailwindcss/forms": { + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.10.tgz", + "integrity": "sha512-utI1ONF6uf/pPNO68kmN1b8rEwNXv3czukalo8VtJH8ksIkZXr3Q3VYudZLkCsDd4Wku120uF02hYK25XGPorw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mini-svg-data-uri": "^1.2.3" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1 || >= 4.0.0-alpha.20 || >= 4.0.0-beta.1" + } + }, + "node_modules/@tailwindcss/node": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.11.tgz", + "integrity": "sha512-yzhzuGRmv5QyU9qLNg4GTlYI6STedBWRE7NjxP45CsFYYq9taI0zJXZBMqIC/c8fViNLhmrbpSFS57EoxUmD6Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.3.0", + "enhanced-resolve": "^5.18.1", + "jiti": "^2.4.2", + "lightningcss": "1.30.1", + "magic-string": "^0.30.17", + "source-map-js": "^1.2.1", + "tailwindcss": "4.1.11" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.1.11.tgz", + "integrity": "sha512-Q69XzrtAhuyfHo+5/HMgr1lAiPP/G40OMFAnws7xcFEYqcypZmdW8eGXaOUIeOl1dzPJBPENXgbjsOyhg2nkrg==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.4", + "tar": "^7.4.3" + }, + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.1.11", + "@tailwindcss/oxide-darwin-arm64": "4.1.11", + "@tailwindcss/oxide-darwin-x64": "4.1.11", + "@tailwindcss/oxide-freebsd-x64": "4.1.11", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.11", + "@tailwindcss/oxide-linux-arm64-gnu": "4.1.11", + "@tailwindcss/oxide-linux-arm64-musl": "4.1.11", + "@tailwindcss/oxide-linux-x64-gnu": "4.1.11", + "@tailwindcss/oxide-linux-x64-musl": "4.1.11", + "@tailwindcss/oxide-wasm32-wasi": "4.1.11", + "@tailwindcss/oxide-win32-arm64-msvc": "4.1.11", + "@tailwindcss/oxide-win32-x64-msvc": "4.1.11" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.1.11.tgz", + "integrity": "sha512-3IfFuATVRUMZZprEIx9OGDjG3Ou3jG4xQzNTvjDoKmU9JdmoCohQJ83MYd0GPnQIu89YoJqvMM0G3uqLRFtetg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.1.11.tgz", + "integrity": "sha512-ESgStEOEsyg8J5YcMb1xl8WFOXfeBmrhAwGsFxxB2CxY9evy63+AtpbDLAyRkJnxLy2WsD1qF13E97uQyP1lfQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.1.11.tgz", + "integrity": "sha512-EgnK8kRchgmgzG6jE10UQNaH9Mwi2n+yw1jWmof9Vyg2lpKNX2ioe7CJdf9M5f8V9uaQxInenZkOxnTVL3fhAw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.1.11.tgz", + "integrity": "sha512-xdqKtbpHs7pQhIKmqVpxStnY1skuNh4CtbcyOHeX1YBE0hArj2romsFGb6yUmzkq/6M24nkxDqU8GYrKrz+UcA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.1.11.tgz", + "integrity": "sha512-ryHQK2eyDYYMwB5wZL46uoxz2zzDZsFBwfjssgB7pzytAeCCa6glsiJGjhTEddq/4OsIjsLNMAiMlHNYnkEEeg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.1.11.tgz", + "integrity": "sha512-mYwqheq4BXF83j/w75ewkPJmPZIqqP1nhoghS9D57CLjsh3Nfq0m4ftTotRYtGnZd3eCztgbSPJ9QhfC91gDZQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.1.11.tgz", + "integrity": "sha512-m/NVRFNGlEHJrNVk3O6I9ggVuNjXHIPoD6bqay/pubtYC9QIdAMpS+cswZQPBLvVvEF6GtSNONbDkZrjWZXYNQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.11.tgz", + "integrity": "sha512-YW6sblI7xukSD2TdbbaeQVDysIm/UPJtObHJHKxDEcW2exAtY47j52f8jZXkqE1krdnkhCMGqP3dbniu1Te2Fg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.11.tgz", + "integrity": "sha512-e3C/RRhGunWYNC3aSF7exsQkdXzQ/M+aYuZHKnw4U7KQwTJotnWsGOIVih0s2qQzmEzOFIJ3+xt7iq67K/p56Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.1.11.tgz", + "integrity": "sha512-Xo1+/GU0JEN/C/dvcammKHzeM6NqKovG+6921MR6oadee5XPBaKOumrJCXvopJ/Qb5TH7LX/UAywbqrP4lax0g==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.4.3", + "@emnapi/runtime": "^1.4.3", + "@emnapi/wasi-threads": "^1.0.2", + "@napi-rs/wasm-runtime": "^0.2.11", + "@tybys/wasm-util": "^0.9.0", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.11.tgz", + "integrity": "sha512-UgKYx5PwEKrac3GPNPf6HVMNhUIGuUh4wlDFR2jYYdkX6pL/rn73zTq/4pzUm8fOjAn5L8zDeHp9iXmUGOXZ+w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.1.11.tgz", + "integrity": "sha512-YfHoggn1j0LK7wR82TOucWc5LDCguHnoS879idHekmmiR7g9HUtMw9MI0NHatS28u/Xlkfi9w5RJWgz2Dl+5Qg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/postcss": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/@tailwindcss/postcss/-/postcss-4.1.11.tgz", + "integrity": "sha512-q/EAIIpF6WpLhKEuQSEVMZNMIY8KhWoAemZ9eylNAih9jxMGAYPPWBn3I9QL/2jZ+e7OEz/tZkX5HwbBR4HohA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@alloc/quick-lru": "^5.2.0", + "@tailwindcss/node": "4.1.11", + "@tailwindcss/oxide": "4.1.11", + "postcss": "^8.4.41", + "tailwindcss": "4.1.11" + } + }, + "node_modules/@tailwindcss/typography": { + "version": "0.5.16", + "resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.16.tgz", + "integrity": "sha512-0wDLwCVF5V3x3b1SGXPCDcdsbDHMBe+lkFzBRaHeLvNi+nrrnZ1lA18u+OTWO8iSWU2GxUOCvlXtDuqftc1oiA==", + "license": "MIT", + "dependencies": { + "lodash.castarray": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.merge": "^4.6.2", + "postcss-selector-parser": "6.0.10" + }, + "peerDependencies": { + "tailwindcss": ">=3.0.0 || insiders || >=4.0.0-alpha.20 || >=4.0.0-beta.1" + } + }, + "node_modules/@tokenizer/token": { + "version": "0.3.0", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/cookie": { + "version": "0.6.0", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "24.2.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.2.0.tgz", + "integrity": "sha512-3xyG3pMCq3oYCNg7/ZP+E1ooTaGB4cG8JWRsqqOYQdbWNY4zbaV0Ennrd7stjiJEFZCaybcIgpTjJWHRfBSIDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.10.0" + } + }, + "node_modules/@types/swagger-schema-official": { + "version": "2.0.25", + "dev": true, + "license": "MIT" + }, + "node_modules/acorn": { + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "dev": true, + "license": "MIT" + }, + "node_modules/autoprefixer": { + "version": "10.4.21", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.21.tgz", + "integrity": "sha512-O+A6LWV5LDHSJD3LjHYoNi4VLsj/Whi7k6zG12xTYaU4cQ8oxQGckXNX8cRHK5yOZ/ppVHe0ZBXGzSV9jXdVbQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/autoprefixer" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "browserslist": "^4.24.4", + "caniuse-lite": "^1.0.30001702", + "fraction.js": "^4.3.7", + "normalize-range": "^0.1.2", + "picocolors": "^1.1.1", + "postcss-value-parser": "^4.2.0" + }, + "bin": { + "autoprefixer": "bin/autoprefixer" + }, + "engines": { + "node": "^10 || ^12 || >=14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/axios": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.11.0.tgz", + "integrity": "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.4", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios/node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/axios/node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/axios/node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/axios/node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/axios/node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/axios/node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/axios/node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/axios/node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/axios/node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/axios/node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/axios/node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/axios/node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/axios/node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/axios/node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/axios/node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/browserslist": { + "version": "4.25.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.1.tgz", + "integrity": "sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "caniuse-lite": "^1.0.30001726", + "electron-to-chromium": "^1.5.173", + "node-releases": "^2.0.19", + "update-browserslist-db": "^1.1.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/browserslist/node_modules/electron-to-chromium": { + "version": "1.5.199", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.199.tgz", + "integrity": "sha512-3gl0S7zQd88kCAZRO/DnxtBKuhMO4h0EaQIN3YgZfV6+pW+5+bf2AdQeHNESCoaQqo/gjGVYEf2YM4O5HJQqpQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/browserslist/node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/browserslist/node_modules/node-releases": { + "version": "2.0.19", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz", + "integrity": "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==", + "dev": true, + "license": "MIT" + }, + "node_modules/browserslist/node_modules/update-browserslist-db": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", + "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/c12": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chokidar": "^4.0.3", + "confbox": "^0.2.2", + "defu": "^6.1.4", + "dotenv": "^17.2.1", + "exsolve": "^1.0.7", + "giget": "^2.0.0", + "jiti": "^2.5.1", + "ohash": "^2.0.11", + "pathe": "^2.0.3", + "perfect-debounce": "^1.0.0", + "pkg-types": "^2.2.0", + "rc9": "^2.1.2" + }, + "peerDependencies": { + "magicast": "^0.3.5" + }, + "peerDependenciesMeta": { + "magicast": { + "optional": true + } + } + }, + "node_modules/c12/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/c12/node_modules/defu": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", + "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==", + "dev": true, + "license": "MIT" + }, + "node_modules/c12/node_modules/dotenv": { + "version": "17.2.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.1.tgz", + "integrity": "sha512-kQhDYKZecqnM0fCnzI5eIv5L4cAe/iRI+HqMbO/hbRdTAeXDG+M9FjipUxNfbARuEg4iHIbhnhs78BCHNbSxEQ==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, + "node_modules/c12/node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/c12/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/call-me-maybe": { + "version": "1.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001731", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001731.tgz", + "integrity": "sha512-lDdp2/wrOmTRWuoB5DpfNkC0rJDU8DqRa6nYL6HK6sytw70QMopt/NIc/9SM7ylItlBWfACXk0tEn37UWM/+mg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "dev": true, + "license": "MIT" + }, + "node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/citty": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/citty/-/citty-0.1.6.tgz", + "integrity": "sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "consola": "^3.2.3" + } + }, + "node_modules/citty/node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/codemirror": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.2.tgz", + "integrity": "sha512-VhydHotNW5w1UGK0Qj96BwSk/Zqbp9WbnyK2W/eVMv4QyF41INRGpjUhFJY7/uDNuudSc33a/PKr4iDqRduvHw==", + "license": "MIT", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/compare-versions": { + "version": "4.1.4", + "dev": true, + "license": "MIT" + }, + "node_modules/concurrently": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.0.tgz", + "integrity": "sha512-IsB/fiXTupmagMW4MNp2lx2cdSN2FfZq78vF90LBB+zZHArbIQZjQtzXCiXnvTxCZSvXanTqFLWBjw2UkLx1SQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.2", + "lodash": "^4.17.21", + "rxjs": "^7.8.1", + "shell-quote": "^1.8.1", + "supports-color": "^8.1.1", + "tree-kill": "^1.2.2", + "yargs": "^17.7.2" + }, + "bin": { + "conc": "dist/bin/concurrently.js", + "concurrently": "dist/bin/concurrently.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/open-cli-tools/concurrently?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/concurrently/node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/concurrently/node_modules/shell-quote": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz", + "integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/concurrently/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/concurrently/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/concurrently/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/concurrently/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/confbox": { + "version": "0.2.2", + "dev": true, + "license": "MIT" + }, + "node_modules/consola": { + "version": "2.15.3", + "resolved": "https://registry.npmjs.org/consola/-/consola-2.15.3.tgz", + "integrity": "sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/console.table": { + "version": "0.10.0", + "dev": true, + "license": "MIT", + "dependencies": { + "easy-table": "1.1.0" + }, + "engines": { + "node": "> 0.10" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/defaults": { + "version": "1.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/detect-libc": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", + "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "dev": true, + "license": "MIT" + }, + "node_modules/easy-table": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "wcwidth": ">=1.0.1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/enhanced-resolve": { + "version": "5.18.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz", + "integrity": "sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/es6-promise": { + "version": "3.3.1", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.25.8", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.8.tgz", + "integrity": "sha512-vVC0USHGtMi8+R4Kz8rt6JhEWLxsv9Rnu/lGYbPR8u47B+DCBksq9JarW0zOO7bs37hyOK1l2/oqtbciutL5+Q==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.8", + "@esbuild/android-arm": "0.25.8", + "@esbuild/android-arm64": "0.25.8", + "@esbuild/android-x64": "0.25.8", + "@esbuild/darwin-arm64": "0.25.8", + "@esbuild/darwin-x64": "0.25.8", + "@esbuild/freebsd-arm64": "0.25.8", + "@esbuild/freebsd-x64": "0.25.8", + "@esbuild/linux-arm": "0.25.8", + "@esbuild/linux-arm64": "0.25.8", + "@esbuild/linux-ia32": "0.25.8", + "@esbuild/linux-loong64": "0.25.8", + "@esbuild/linux-mips64el": "0.25.8", + "@esbuild/linux-ppc64": "0.25.8", + "@esbuild/linux-riscv64": "0.25.8", + "@esbuild/linux-s390x": "0.25.8", + "@esbuild/linux-x64": "0.25.8", + "@esbuild/netbsd-arm64": "0.25.8", + "@esbuild/netbsd-x64": "0.25.8", + "@esbuild/openbsd-arm64": "0.25.8", + "@esbuild/openbsd-x64": "0.25.8", + "@esbuild/openharmony-arm64": "0.25.8", + "@esbuild/sunos-x64": "0.25.8", + "@esbuild/win32-arm64": "0.25.8", + "@esbuild/win32-ia32": "0.25.8", + "@esbuild/win32-x64": "0.25.8" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/esm-env": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz", + "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/esprima": { + "version": "4.0.1", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esrap": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.1.0.tgz", + "integrity": "sha512-yzmPNpl7TBbMRC5Lj2JlJZNPml0tzqoqP5B1JXycNUwtqma9AKCO0M2wHrdgsHcy1WRW7S9rJknAMtByg3usgA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eta": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/eta/-/eta-2.2.0.tgz", + "integrity": "sha512-UVQ72Rqjy/ZKQalzV5dCCJP80GrmPrMxh6NlNf+erV6ObL0ZFkhCstWRawS85z3smdr3d2wXPsZEY7rDPfGd2g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + }, + "funding": { + "url": "https://github.com/eta-dev/eta?sponsor=1" + } + }, + "node_modules/exsolve": { + "version": "1.0.7", + "dev": true, + "license": "MIT" + }, + "node_modules/external-editor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fdir": { + "version": "6.4.6", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", + "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/figures": { + "version": "3.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/fraction.js": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", + "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + }, + "funding": { + "type": "patreon", + "url": "https://github.com/sponsors/rawify" + } + }, + "node_modules/fs-extra": { + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.3.0.tgz", + "integrity": "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/giget": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "citty": "^0.1.6", + "consola": "^3.4.0", + "defu": "^6.1.4", + "node-fetch-native": "^1.6.6", + "nypm": "^0.6.0", + "pathe": "^2.0.3" + }, + "bin": { + "giget": "dist/cli.mjs" + } + }, + "node_modules/giget/node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/giget/node_modules/defu": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", + "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==", + "dev": true, + "license": "MIT" + }, + "node_modules/giget/node_modules/node-fetch-native": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz", + "integrity": "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/giget/node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/glob": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz", + "integrity": "sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.3.1", + "jackspeak": "^4.1.1", + "minimatch": "^10.0.3", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/@isaacs/balanced-match": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", + "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/glob/node_modules/@isaacs/brace-expansion": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", + "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@isaacs/balanced-match": "^4.0.1" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/glob/node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/glob/node_modules/ansi-regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/glob/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/glob/node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/glob/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/glob/node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/jackspeak": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", + "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/lru-cache": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", + "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", + "dev": true, + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", + "integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@isaacs/brace-expansion": "^5.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, + "node_modules/glob/node_modules/path-scurry": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/glob/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hasown/node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/inquirer": { + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz", + "integrity": "sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.5.5", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6", + "wrap-ansi": "^6.0.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/inquirer/node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 10" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-interactive": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-reference": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", + "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.6" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "dev": true, + "license": "ISC" + }, + "node_modules/iterare": { + "version": "1.2.1", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=6" + } + }, + "node_modules/jiti": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.5.1.tgz", + "integrity": "sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/js-yaml/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/jsbn": { + "version": "1.1.0", + "dev": true, + "license": "MIT" + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/kleur": { + "version": "4.1.5", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/lightningcss": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.1.tgz", + "integrity": "sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-darwin-arm64": "1.30.1", + "lightningcss-darwin-x64": "1.30.1", + "lightningcss-freebsd-x64": "1.30.1", + "lightningcss-linux-arm-gnueabihf": "1.30.1", + "lightningcss-linux-arm64-gnu": "1.30.1", + "lightningcss-linux-arm64-musl": "1.30.1", + "lightningcss-linux-x64-gnu": "1.30.1", + "lightningcss-linux-x64-musl": "1.30.1", + "lightningcss-win32-arm64-msvc": "1.30.1", + "lightningcss-win32-x64-msvc": "1.30.1" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.1.tgz", + "integrity": "sha512-c8JK7hyE65X1MHMN+Viq9n11RRC7hgin3HhYKhrMyaXflk5GVplZ60IxyoVtzILeKr+xAJwg6zK6sjTBJ0FKYQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.1.tgz", + "integrity": "sha512-k1EvjakfumAQoTfcXUcHQZhSpLlkAuEkdMBsI/ivWw9hL+7FtilQc0Cy3hrx0AAQrVtQAbMI7YjCgYgvn37PzA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.1.tgz", + "integrity": "sha512-kmW6UGCGg2PcyUE59K5r0kWfKPAVy4SltVeut+umLCFoJ53RdCUWxcRDzO1eTaxf/7Q2H7LTquFHPL5R+Gjyig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.1.tgz", + "integrity": "sha512-MjxUShl1v8pit+6D/zSPq9S9dQ2NPFSQwGvxBCYaBYLPlCWuPh9/t1MRS8iUaR8i+a6w7aps+B4N0S1TYP/R+Q==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.1.tgz", + "integrity": "sha512-gB72maP8rmrKsnKYy8XUuXi/4OctJiuQjcuqWNlJQ6jZiWqtPvqFziskH3hnajfvKB27ynbVCucKSm2rkQp4Bw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.1.tgz", + "integrity": "sha512-jmUQVx4331m6LIX+0wUhBbmMX7TCfjF5FoOH6SD1CttzuYlGNVpA7QnrmLxrsub43ClTINfGSYyHe2HWeLl5CQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.1.tgz", + "integrity": "sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.1.tgz", + "integrity": "sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.1.tgz", + "integrity": "sha512-mSL4rqPi4iXq5YVqzSsJgMVFENoa4nGTT/GjO2c0Yl9OuQfPsIfncvLrEW6RbbB24WtZ3xP/2CCmI3tNkNV4oA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.1.tgz", + "integrity": "sha512-PVqXh48wh4T53F/1CCu8PIPCxLzWyCnn/9T5W1Jpmdy5h9Cwd+0YQS6/LwhHXSafuc61/xg9Lv5OrCby6a++jg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/load-esm": { + "version": "1.0.2", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + }, + { + "type": "buymeacoffee", + "url": "https://buymeacoffee.com/borewit" + } + ], + "license": "MIT", + "engines": { + "node": ">=13.2.0" + } + }, + "node_modules/locate-character": { + "version": "3.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.castarray": { + "version": "4.4.0", + "license": "MIT" + }, + "node_modules/lodash.isplainobject": { + "version": "4.0.6", + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types/node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/mini-svg-data-uri": { + "version": "1.4.4", + "dev": true, + "license": "MIT", + "bin": { + "mini-svg-data-uri": "cli.js" + } + }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minizlib": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz", + "integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.1.2" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/mrmime": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "dev": true, + "license": "MIT" + }, + "node_modules/mute-stream": { + "version": "0.0.8", + "dev": true, + "license": "ISC" + }, + "node_modules/node-fetch-h2": { + "version": "2.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "http2-client": "^1.2.5" + }, + "engines": { + "node": "4.x || >=6.0.0" + } + }, + "node_modules/node-fetch-h2/node_modules/http2-client": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/http2-client/-/http2-client-1.3.5.tgz", + "integrity": "sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-readfiles": { + "version": "0.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "es6-promise": "^3.2.1" + } + }, + "node_modules/normalize-range": { + "version": "0.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/nypm": { + "version": "0.6.1", + "dev": true, + "license": "MIT", + "dependencies": { + "citty": "^0.1.6", + "consola": "^3.4.2", + "pathe": "^2.0.3", + "pkg-types": "^2.2.0", + "tinyexec": "^1.0.1" + }, + "bin": { + "nypm": "dist/cli.mjs" + }, + "engines": { + "node": "^14.16.0 || >=16.10.0" + } + }, + "node_modules/nypm/node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/nypm/node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/nypm/node_modules/tinyexec": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.0.1.tgz", + "integrity": "sha512-5uC6DDlmeqiOwCPmK9jMSdOuZTh8bU39Ys6yidB+UTt5hfZUPGAypSgFRiEp+jbi9qH40BLDvy85jIU88wKSqw==", + "dev": true, + "license": "MIT" + }, + "node_modules/oas-kit-common": { + "version": "1.0.8", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "fast-safe-stringify": "^2.0.7" + } + }, + "node_modules/oas-kit-common/node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "dev": true, + "license": "MIT" + }, + "node_modules/oas-linter": { + "version": "3.2.2", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@exodus/schemasafe": "^1.0.0-rc.2", + "should": "^13.2.1", + "yaml": "^1.10.0" + }, + "funding": { + "url": "https://github.com/Mermade/oas-kit?sponsor=1" + } + }, + "node_modules/oas-linter/node_modules/@exodus/schemasafe": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@exodus/schemasafe/-/schemasafe-1.3.0.tgz", + "integrity": "sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==", + "dev": true, + "license": "MIT" + }, + "node_modules/oas-linter/node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 6" + } + }, + "node_modules/oas-schema-walker": { + "version": "1.1.5", + "dev": true, + "license": "BSD-3-Clause", + "funding": { + "url": "https://github.com/Mermade/oas-kit?sponsor=1" + } + }, + "node_modules/ohash": { + "version": "2.0.11", + "dev": true, + "license": "MIT" + }, + "node_modules/onetime": { + "version": "5.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora": { + "version": "5.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.2.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/perfect-debounce": { + "version": "1.0.0", + "dev": true, + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-types": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.2.2", + "exsolve": "^1.0.7", + "pathe": "^2.0.3" + } + }, + "node_modules/pkg-types/node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/postcss": { + "version": "8.5.6", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", + "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.0.10", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.10.tgz", + "integrity": "sha512-IQ7TZdoaqbT+LCpShg46jnZVlhWD2w6iQYAcYXfHARZ7X1t/UGhhceQDs5X0cGqKvYlHNOuv7Oa1xmb0oQuA3w==", + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/postcss/node_modules/nanoid": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", + "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/proxy-agent": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.5.0.tgz", + "integrity": "sha512-TmatMXdr2KlRiA2CyDu8GqR8EjahTG3aY3nXjdzFyoZbmB8hrBsTyMezhULIXKnC0jpfjlmiZ3+EaCzoInSu/A==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.6", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.1.0", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", + "dev": true, + "license": "MIT" + }, + "node_modules/proxy-agent/node_modules/agent-base": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/proxy-agent/node_modules/basic-ftp": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", + "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/proxy-agent/node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/proxy-agent/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/proxy-agent/node_modules/get-uri": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.5.tgz", + "integrity": "sha512-b1O07XYq8eRuVzBNgJLstU6FYc1tS6wnMtF1I1D9lE8LxZSOGZ7LhxN54yPP6mGw5f2CkXY2BQUL9Fx41qvcIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/proxy-agent/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/proxy-agent/node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/proxy-agent/node_modules/pac-proxy-agent": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.2.0.tgz", + "integrity": "sha512-TEB8ESquiLMc0lV8vcd5Ql/JAKAoyzHFXaStwjkzpOpC5Yv+pIzLfHvjTSdf3vpa2bMiUQrg9i6276yn8666aA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.6", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.5" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "dev": true, + "license": "MIT", + "dependencies": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true, + "license": "MIT" + }, + "node_modules/proxy-agent/node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/proxy-agent/node_modules/socks": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.6.tgz", + "integrity": "sha512-pe4Y2yzru68lXCb38aAqRf5gvN8YdjP1lok5o0J7BOHljkyCGKVz7H3vpVIXKD27rj2giOJ7DwVyk/GWrPHDWA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/proxy-agent/node_modules/socks-proxy-agent": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.5.tgz", + "integrity": "sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/rc9": { + "version": "2.1.2", + "dev": true, + "license": "MIT", + "dependencies": { + "defu": "^6.1.4", + "destr": "^2.0.3" + } + }, + "node_modules/rc9/node_modules/defu": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz", + "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==", + "dev": true, + "license": "MIT" + }, + "node_modules/rc9/node_modules/destr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", + "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", + "dev": true, + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/reflect-metadata": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/require-directory": { + "version": "2.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/restore-cursor/node_modules/signal-exit": { + "version": "3.0.7", + "dev": true, + "license": "ISC" + }, + "node_modules/run-async": { + "version": "2.4.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/sade": { + "version": "1.8.1", + "dev": true, + "license": "MIT", + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/set-cookie-parser": { + "version": "2.7.1", + "dev": true, + "license": "MIT" + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/should": { + "version": "13.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "should-equal": "^2.0.0", + "should-format": "^3.0.3", + "should-type": "^1.4.0", + "should-type-adaptors": "^1.0.1", + "should-util": "^1.0.0" + } + }, + "node_modules/should-equal": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "should-type": "^1.4.0" + } + }, + "node_modules/should-format": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "should-type": "^1.3.0", + "should-type-adaptors": "^1.0.1" + } + }, + "node_modules/should-type": { + "version": "1.4.0", + "dev": true, + "license": "MIT" + }, + "node_modules/should-type-adaptors": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "should-type": "^1.3.0", + "should-util": "^1.0.0" + } + }, + "node_modules/should-util": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/sirv": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "@polka/url": "^1.0.0-next.24", + "mrmime": "^2.0.0", + "totalist": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/sirv/node_modules/totalist": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", + "integrity": "sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "dev": true, + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/svelte": { + "version": "5.38.0", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.38.0.tgz", + "integrity": "sha512-cWF1Oc2IM/QbktdK89u5lt9MdKxRtQnRKnf2tq6KOhYuhLOd2hbMuTiJ+vWMzAeMDe81AzbCgLd4GVtOJ4fDRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ampproject/remapping": "^2.3.0", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@sveltejs/acorn-typescript": "^1.0.5", + "@types/estree": "^1.0.5", + "acorn": "^8.12.1", + "aria-query": "^5.3.1", + "axobject-query": "^4.1.0", + "clsx": "^2.1.1", + "esm-env": "^1.2.1", + "esrap": "^2.1.0", + "is-reference": "^3.0.3", + "locate-character": "^3.0.0", + "magic-string": "^0.30.11", + "zimmerframe": "^1.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/svelte-check": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.3.1.tgz", + "integrity": "sha512-lkh8gff5gpHLjxIV+IaApMxQhTGnir2pNUAqcNgeKkvK5bT/30Ey/nzBxNLDlkztCH4dP7PixkMt9SWEKFPBWg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "chokidar": "^4.0.1", + "fdir": "^6.2.0", + "picocolors": "^1.0.0", + "sade": "^1.7.4" + }, + "bin": { + "svelte-check": "bin/svelte-check" + }, + "engines": { + "node": ">= 18.0.0" + }, + "peerDependencies": { + "svelte": "^4.0.0 || ^5.0.0-next.0", + "typescript": ">=5.0.0" + } + }, + "node_modules/svelte-check/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/svelte-check/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/svelte/node_modules/aria-query": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/svelte/node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/swagger-schema-official": { + "version": "2.0.0-bab6bed", + "dev": true, + "license": "ISC" + }, + "node_modules/swagger-typescript-api": { + "version": "13.2.7", + "resolved": "https://registry.npmjs.org/swagger-typescript-api/-/swagger-typescript-api-13.2.7.tgz", + "integrity": "sha512-rfqqoRFpZJPl477M/snMJPM90EvI8WqhuUHSF5ecC2r/w376T29+QXNJFVPsJmbFu5rBc/8m3vhArtMctjONdw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@biomejs/js-api": "1.0.0", + "@biomejs/wasm-nodejs": "2.0.5", + "@types/swagger-schema-official": "^2.0.25", + "c12": "^3.0.4", + "citty": "^0.1.6", + "consola": "^3.4.2", + "eta": "^2.2.0", + "js-yaml": "^4.1.0", + "lodash": "^4.17.21", + "nanoid": "^5.1.5", + "swagger-schema-official": "2.0.0-bab6bed", + "swagger2openapi": "^7.0.8", + "typescript": "~5.8.3" + }, + "bin": { + "sta": "dist/cli.js", + "swagger-typescript-api": "dist/cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/swagger-typescript-api/node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, + "node_modules/swagger-typescript-api/node_modules/nanoid": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.1.5.tgz", + "integrity": "sha512-Ir/+ZpE9fDsNH0hQ3C68uyThDXzYcim2EqcZ8zn8Chtt1iylPT9xXJB0kPCnqzgcEGikO9RxSrh63MsmVCU7Fw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.js" + }, + "engines": { + "node": "^18 || >=20" + } + }, + "node_modules/swagger-typescript-api/node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/swagger2openapi": { + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/swagger2openapi/-/swagger2openapi-7.0.8.tgz", + "integrity": "sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "call-me-maybe": "^1.0.1", + "node-fetch": "^2.6.1", + "node-fetch-h2": "^2.3.0", + "node-readfiles": "^0.2.0", + "oas-kit-common": "^1.0.8", + "oas-resolver": "^2.5.6", + "oas-schema-walker": "^1.1.5", + "oas-validator": "^5.0.8", + "reftools": "^1.1.9", + "yaml": "^1.10.0", + "yargs": "^17.0.1" + }, + "bin": { + "boast": "boast.js", + "oas-validate": "oas-validate.js", + "swagger2openapi": "swagger2openapi.js" + }, + "funding": { + "url": "https://github.com/Mermade/oas-kit?sponsor=1" + } + }, + "node_modules/swagger2openapi/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/swagger2openapi/node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/swagger2openapi/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/swagger2openapi/node_modules/oas-resolver": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/oas-resolver/-/oas-resolver-2.5.6.tgz", + "integrity": "sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "node-fetch-h2": "^2.3.0", + "oas-kit-common": "^1.0.8", + "reftools": "^1.1.9", + "yaml": "^1.10.0", + "yargs": "^17.0.1" + }, + "bin": { + "resolve": "resolve.js" + }, + "funding": { + "url": "https://github.com/Mermade/oas-kit?sponsor=1" + } + }, + "node_modules/swagger2openapi/node_modules/oas-validator": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/oas-validator/-/oas-validator-5.0.8.tgz", + "integrity": "sha512-cu20/HE5N5HKqVygs3dt94eYJfBi0TsZvPVXDhbXQHiEityDN+RROTleefoKRKKJ9dFAF2JBkDHgvWj0sjKGmw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "call-me-maybe": "^1.0.1", + "oas-kit-common": "^1.0.8", + "oas-linter": "^3.2.2", + "oas-resolver": "^2.5.6", + "oas-schema-walker": "^1.1.5", + "reftools": "^1.1.9", + "should": "^13.2.1", + "yaml": "^1.10.0" + }, + "funding": { + "url": "https://github.com/Mermade/oas-kit?sponsor=1" + } + }, + "node_modules/swagger2openapi/node_modules/reftools": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/reftools/-/reftools-1.1.9.tgz", + "integrity": "sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w==", + "dev": true, + "license": "BSD-3-Clause", + "funding": { + "url": "https://github.com/Mermade/oas-kit?sponsor=1" + } + }, + "node_modules/swagger2openapi/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/swagger2openapi/node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/swagger2openapi/node_modules/yaml": { + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", + "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 6" + } + }, + "node_modules/swagger2openapi/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/swagger2openapi/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/tailwindcss": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.11.tgz", + "integrity": "sha512-2E9TBm6MDD/xKYe+dvJZAmg3yxIEDNRc0jwlNyDg/4Fil2QcSLjFKGVff0lAf1jjeaArlG/M75Ey/EYr/OJtBA==", + "license": "MIT" + }, + "node_modules/tapable": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.2.tgz", + "integrity": "sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/through": { + "version": "2.3.8", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", + "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.4.4", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tmp": { + "version": "0.0.33", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/token-types": { + "version": "6.0.4", + "dev": true, + "license": "MIT", + "dependencies": { + "@tokenizer/token": "^0.3.0", + "ieee754": "^1.2.1" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Borewit" + } + }, + "node_modules/tr46": { + "version": "0.0.3", + "dev": true, + "license": "MIT" + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, + "node_modules/type-fest": { + "version": "0.21.3", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.9.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz", + "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/uint8array-extras": { + "version": "1.4.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/undici-types": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.10.0.tgz", + "integrity": "sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==", + "dev": true, + "license": "MIT" + }, + "node_modules/universalify": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "license": "MIT" + }, + "node_modules/vite": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.1.1.tgz", + "integrity": "sha512-yJ+Mp7OyV+4S+afWo+QyoL9jFWD11QFH0i5i7JypnfTcA1rmgxCbiA8WwAICDEtZ1Z1hzrVhN8R8rGTqkTY8ZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.25.0", + "fdir": "^6.4.6", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.14" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite/node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.46.2.tgz", + "integrity": "sha512-Zj3Hl6sN34xJtMv7Anwb5Gu01yujyE/cLBDB2gnHTAHaWS1Z38L7kuSG+oAh0giZMqG060f/YBStXtMH6FvPMA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-android-arm64": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.46.2.tgz", + "integrity": "sha512-nTeCWY83kN64oQ5MGz3CgtPx8NSOhC5lWtsjTs+8JAJNLcP3QbLCtDDgUKQc/Ro/frpMq4SHUaHN6AMltcEoLQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.46.2.tgz", + "integrity": "sha512-HV7bW2Fb/F5KPdM/9bApunQh68YVDU8sO8BvcW9OngQVN3HHHkw99wFupuUJfGR9pYLLAjcAOA6iO+evsbBaPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-darwin-x64": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.46.2.tgz", + "integrity": "sha512-SSj8TlYV5nJixSsm/y3QXfhspSiLYP11zpfwp6G/YDXctf3Xkdnk4woJIF5VQe0of2OjzTt8EsxnJDCdHd2xMA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.46.2.tgz", + "integrity": "sha512-ZyrsG4TIT9xnOlLsSSi9w/X29tCbK1yegE49RYm3tu3wF1L/B6LVMqnEWyDB26d9Ecx9zrmXCiPmIabVuLmNSg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.46.2.tgz", + "integrity": "sha512-pCgHFoOECwVCJ5GFq8+gR8SBKnMO+xe5UEqbemxBpCKYQddRQMgomv1104RnLSg7nNvgKy05sLsY51+OVRyiVw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.46.2.tgz", + "integrity": "sha512-EtP8aquZ0xQg0ETFcxUbU71MZlHaw9MChwrQzatiE8U/bvi5uv/oChExXC4mWhjiqK7azGJBqU0tt5H123SzVA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.46.2.tgz", + "integrity": "sha512-qO7F7U3u1nfxYRPM8HqFtLd+raev2K137dsV08q/LRKRLEc7RsiDWihUnrINdsWQxPR9jqZ8DIIZ1zJJAm5PjQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.46.2.tgz", + "integrity": "sha512-3dRaqLfcOXYsfvw5xMrxAk9Lb1f395gkoBYzSFcc/scgRFptRXL9DOaDpMiehf9CO8ZDRJW2z45b6fpU5nwjng==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.46.2.tgz", + "integrity": "sha512-fhHFTutA7SM+IrR6lIfiHskxmpmPTJUXpWIsBXpeEwNgZzZZSg/q4i6FU4J8qOGyJ0TR+wXBwx/L7Ho9z0+uDg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-linux-loongarch64-gnu": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.46.2.tgz", + "integrity": "sha512-i7wfGFXu8x4+FRqPymzjD+Hyav8l95UIZ773j7J7zRYc3Xsxy2wIn4x+llpunexXe6laaO72iEjeeGyUFmjKeA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.46.2.tgz", + "integrity": "sha512-B/l0dFcHVUnqcGZWKcWBSV2PF01YUt0Rvlurci5P+neqY/yMKchGU8ullZvIv5e8Y1C6wOn+U03mrDylP5q9Yw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.46.2.tgz", + "integrity": "sha512-32k4ENb5ygtkMwPMucAb8MtV8olkPT03oiTxJbgkJa7lJ7dZMr0GCFJlyvy+K8iq7F/iuOr41ZdUHaOiqyR3iQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.46.2.tgz", + "integrity": "sha512-t5B2loThlFEauloaQkZg9gxV05BYeITLvLkWOkRXogP4qHXLkWSbSHKM9S6H1schf/0YGP/qNKtiISlxvfmmZw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.46.2.tgz", + "integrity": "sha512-YKjekwTEKgbB7n17gmODSmJVUIvj8CX7q5442/CK80L8nqOUbMtf8b01QkG3jOqyr1rotrAnW6B/qiHwfcuWQA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.46.2.tgz", + "integrity": "sha512-7kX69DIrBeD7yNp4A5b81izs8BqoZkCIaxQaOpumcJ1S/kmqNFjPhDu1LHeVXv0SexfHQv5cqHsxLOjETuqDuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.46.2.tgz", + "integrity": "sha512-wiJWMIpeaak/jsbaq2HMh/rzZxHVW1rU6coyeNNpMwk5isiPjSTx0a4YLSlYDwBH/WBvLz+EtsNqQScZTLJy3g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.46.2.tgz", + "integrity": "sha512-gBgaUDESVzMgWZhcyjfs9QFK16D8K6QZpwAaVNJxYDLHWayOta4ZMjGm/vsAEy3hvlS2GosVFlBlP9/Wb85DqQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/vite/node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.46.2.tgz", + "integrity": "sha512-CvUo2ixeIQGtF6WvuB87XWqPQkoFAFqW+HUo/WzHwuHDvIwZCtjdWXoYCcr06iKGydiqTclC4jU/TNObC/xKZg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/vite/node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/vite/node_modules/rollup": { + "version": "4.46.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.46.2.tgz", + "integrity": "sha512-WMmLFI+Boh6xbop+OAGo9cQ3OgX9MIg7xOQjn+pTCwOkk+FNDAeAemXkJ3HzDJrVXleLOFVa1ipuc1AmEx1Dwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.8" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.46.2", + "@rollup/rollup-android-arm64": "4.46.2", + "@rollup/rollup-darwin-arm64": "4.46.2", + "@rollup/rollup-darwin-x64": "4.46.2", + "@rollup/rollup-freebsd-arm64": "4.46.2", + "@rollup/rollup-freebsd-x64": "4.46.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.46.2", + "@rollup/rollup-linux-arm-musleabihf": "4.46.2", + "@rollup/rollup-linux-arm64-gnu": "4.46.2", + "@rollup/rollup-linux-arm64-musl": "4.46.2", + "@rollup/rollup-linux-loongarch64-gnu": "4.46.2", + "@rollup/rollup-linux-ppc64-gnu": "4.46.2", + "@rollup/rollup-linux-riscv64-gnu": "4.46.2", + "@rollup/rollup-linux-riscv64-musl": "4.46.2", + "@rollup/rollup-linux-s390x-gnu": "4.46.2", + "@rollup/rollup-linux-x64-gnu": "4.46.2", + "@rollup/rollup-linux-x64-musl": "4.46.2", + "@rollup/rollup-win32-arm64-msvc": "4.46.2", + "@rollup/rollup-win32-ia32-msvc": "4.46.2", + "@rollup/rollup-win32-x64-msvc": "4.46.2", + "fsevents": "~2.3.2" + } + }, + "node_modules/vitefu": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.1.tgz", + "integrity": "sha512-B/Fegf3i8zh0yFbpzZ21amWzHmuNlLlmJT6n7bu5e+pCHUKQIfXSYokrqOBGEMMe9UG2sostKQF9mml/vYaWJQ==", + "dev": true, + "license": "MIT", + "workspaces": [ + "tests/deps/*", + "tests/projects/*", + "tests/projects/workspace/packages/*" + ], + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0-beta.0" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, + "node_modules/wcwidth": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "defaults": "^1.0.3" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "dev": true, + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "wrap-ansi", + "version": "7.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, + "node_modules/zimmerframe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz", + "integrity": "sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/webapp/package.json b/webapp/package.json new file mode 100644 index 00000000..93b9ef61 --- /dev/null +++ b/webapp/package.json @@ -0,0 +1,43 @@ +{ + "name": "garm-webapp", + "version": "0.0.1", + "private": true, + "scripts": { + "dev": "NODE_ENV=development vite dev --host 0.0.0.0 --port 5173", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch" + }, + "devDependencies": { + "@openapitools/openapi-generator-cli": "^2.21.4", + "@sveltejs/adapter-static": "^3.0.1", + "@sveltejs/kit": "^2.0.0", + "@sveltejs/vite-plugin-svelte": "^6.1.0", + "@tailwindcss/forms": "^0.5.7", + "@tailwindcss/postcss": "^4.1.11", + "@types/node": "^24.2.0", + "autoprefixer": "^10.4.16", + "postcss": "^8.4.32", + "svelte": "^5.38.0", + "svelte-check": "^4.3.1", + "swagger-typescript-api": "^13.2.7", + "tailwindcss": "^4.1.11", + "typescript": "^5.0.0", + "vite": "^7.1.1" + }, + "type": "module", + "dependencies": { + "@codemirror/lang-json": "^6.0.2", + "@codemirror/state": "^6.5.2", + "@codemirror/theme-one-dark": "^6.1.3", + "@codemirror/view": "^6.38.1", + "@tailwindcss/typography": "^0.5.10", + "codemirror": "^6.0.2" + }, + "description": "", + "main": "postcss.config.js", + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/webapp/postcss.config.js b/webapp/postcss.config.js new file mode 100644 index 00000000..571e3e11 --- /dev/null +++ b/webapp/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + '@tailwindcss/postcss': {}, + autoprefixer: {} + } +}; \ No newline at end of file diff --git a/webapp/src/app.css b/webapp/src/app.css new file mode 100644 index 00000000..5b1d339f --- /dev/null +++ b/webapp/src/app.css @@ -0,0 +1,18 @@ +@import "tailwindcss"; + +@theme { + --breakpoint-sm: 640px; + --breakpoint-md: 768px; + --breakpoint-lg: 1024px; + --breakpoint-xl: 1280px; + --breakpoint-2xl: 1536px; +} + +/* Configure dark mode to use class strategy in Tailwind v4 */ +@variant dark (.dark &); + +@layer base { + html { + font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; + } +} \ No newline at end of file diff --git a/webapp/src/app.d.ts b/webapp/src/app.d.ts new file mode 100644 index 00000000..f451d6bf --- /dev/null +++ b/webapp/src/app.d.ts @@ -0,0 +1,10 @@ +declare global { + namespace App { + interface Error {} + interface Locals {} + interface PageData {} + interface Platform {} + } +} + +export {}; \ No newline at end of file diff --git a/webapp/src/app.html b/webapp/src/app.html new file mode 100644 index 00000000..44b27308 --- /dev/null +++ b/webapp/src/app.html @@ -0,0 +1,78 @@ + + + + + + + + + + + + + %sveltekit.head% + + +
                %sveltekit.body%
                + + diff --git a/webapp/src/lib/api/client.ts b/webapp/src/lib/api/client.ts new file mode 100644 index 00000000..4ceea8df --- /dev/null +++ b/webapp/src/lib/api/client.ts @@ -0,0 +1,77 @@ +// Importing from the generated client wrapper +import { + GeneratedGarmApiClient, + type Repository, + type Organization, + type Enterprise, + type Endpoint, + type Pool, + type ScaleSet, + type Instance, + type ForgeCredentials, + type Provider, + type ControllerInfo, + type CreateRepoParams, + type CreateOrgParams, + type CreateEnterpriseParams, + type CreatePoolParams, + type CreateScaleSetParams, + type UpdateEntityParams, + type UpdatePoolParams, + type LoginRequest, + type LoginResponse, +} from './generated-client.js'; + +// Import endpoint and credentials types directly +import type { + CreateGithubEndpointParams as CreateEndpointParams, + UpdateGithubEndpointParams as UpdateEndpointParams, + CreateGithubCredentialsParams as CreateCredentialsParams, + UpdateGithubCredentialsParams as UpdateCredentialsParams, +} from './generated/api'; + +// Re-export types for compatibility +export type { + Repository, + Organization, + Enterprise, + Endpoint, + Pool, + ScaleSet, + Instance, + ForgeCredentials, + Provider, + ControllerInfo, + CreateRepoParams, + CreateOrgParams, + CreateEnterpriseParams, + CreateEndpointParams, + UpdateEndpointParams, + CreateCredentialsParams, + UpdateCredentialsParams, + CreatePoolParams, + CreateScaleSetParams, + UpdateEntityParams, + UpdatePoolParams, + LoginRequest, + LoginResponse, +}; + +// Legacy APIError type for backward compatibility +export interface APIError { + error: string; + details?: string; +} + +// GarmApiClient now extends/wraps the generated client +export class GarmApiClient extends GeneratedGarmApiClient { + constructor(baseUrl: string = '') { + super(baseUrl); + } + + // All methods are inherited from GeneratedGarmApiClient + // This class now acts as a simple wrapper for backward compatibility +} + +// Create a singleton instance +export const garmApi = new GarmApiClient(); diff --git a/webapp/src/lib/api/generated-client.ts b/webapp/src/lib/api/generated-client.ts new file mode 100644 index 00000000..ce45d28b --- /dev/null +++ b/webapp/src/lib/api/generated-client.ts @@ -0,0 +1,596 @@ +// Generated API Client Wrapper for GARM +// This wraps the auto-generated OpenAPI client to match our existing interface + +import { + LoginApi, + ControllerInfoApi, + ControllerApi, + EndpointsApi, + CredentialsApi, + RepositoriesApi, + OrganizationsApi, + EnterprisesApi, + PoolsApi, + ScalesetsApi, + InstancesApi, + ProvidersApi, + FirstRunApi, + HooksApi, + type Repository, + type Organization, + type Enterprise, + type ForgeEndpoint, + type Pool, + type ScaleSet, + type Instance, + type ForgeCredentials, + type Provider, + type ControllerInfo, + type CreateRepoParams, + type CreateOrgParams, + type CreateEnterpriseParams, + type CreateGithubEndpointParams, + type CreateGiteaEndpointParams, + type UpdateGithubEndpointParams, + type UpdateGiteaEndpointParams, + type CreateGithubCredentialsParams, + type CreateGiteaCredentialsParams, + type UpdateGithubCredentialsParams, + type UpdateGiteaCredentialsParams, + type CreatePoolParams, + type CreateScaleSetParams, + type UpdateEntityParams, + type UpdatePoolParams, + type PasswordLoginParams, + type JWTResponse, + type NewUserParams, + type User, + type UpdateControllerParams, + type HookInfo, + Configuration +} from './generated/index'; + +// Re-export types for compatibility +export type { + Repository, + Organization, + Enterprise, + ForgeEndpoint as Endpoint, + Pool, + ScaleSet, + Instance, + ForgeCredentials, + Provider, + ControllerInfo, + CreateRepoParams, + CreateOrgParams, + CreateEnterpriseParams, + CreateGithubEndpointParams as CreateEndpointParams, + UpdateGithubEndpointParams as UpdateEndpointParams, + CreateGithubCredentialsParams as CreateCredentialsParams, + UpdateGithubCredentialsParams as UpdateCredentialsParams, + CreatePoolParams, + CreateScaleSetParams, + UpdateEntityParams, + UpdatePoolParams, + PasswordLoginParams, + JWTResponse, + NewUserParams, + User, + UpdateControllerParams, +}; + +// Define common request types for compatibility +export interface LoginRequest { + username: string; + password: string; +} + +export interface LoginResponse { + token: string; +} + +export class GeneratedGarmApiClient { + private baseUrl: string; + private token?: string; + private config: Configuration; + + // Check if we're in development mode (cross-origin setup) + private isDevelopmentMode(): boolean { + if (typeof window === 'undefined') return false; + // Development mode: either VITE_GARM_API_URL is set OR we detect cross-origin + return !!(import.meta.env.VITE_GARM_API_URL) || window.location.port === '5173'; + } + + // Generated API client instances + private loginApi: LoginApi; + private controllerInfoApi: ControllerInfoApi; + private controllerApi: ControllerApi; + private endpointsApi: EndpointsApi; + private credentialsApi: CredentialsApi; + private repositoriesApi: RepositoriesApi; + private organizationsApi: OrganizationsApi; + private enterprisesApi: EnterprisesApi; + private poolsApi: PoolsApi; + private scaleSetsApi: ScalesetsApi; + private instancesApi: InstancesApi; + private providersApi: ProvidersApi; + private firstRunApi: FirstRunApi; + private hooksApi: HooksApi; + + constructor(baseUrl: string = '') { + this.baseUrl = baseUrl || window.location.origin; + + // Create configuration for the generated client + const isDevMode = this.isDevelopmentMode(); + this.config = new Configuration({ + basePath: `${this.baseUrl}/api/v1`, + accessToken: () => this.token || '', + baseOptions: { + // In development mode, don't send cookies (use Bearer token only) + // In production mode, include cookies for authentication + withCredentials: !isDevMode, + }, + }); + + // Initialize generated API clients + this.loginApi = new LoginApi(this.config); + this.controllerInfoApi = new ControllerInfoApi(this.config); + this.controllerApi = new ControllerApi(this.config); + this.endpointsApi = new EndpointsApi(this.config); + this.credentialsApi = new CredentialsApi(this.config); + this.repositoriesApi = new RepositoriesApi(this.config); + this.organizationsApi = new OrganizationsApi(this.config); + this.enterprisesApi = new EnterprisesApi(this.config); + this.poolsApi = new PoolsApi(this.config); + this.scaleSetsApi = new ScalesetsApi(this.config); + this.instancesApi = new InstancesApi(this.config); + this.providersApi = new ProvidersApi(this.config); + this.firstRunApi = new FirstRunApi(this.config); + this.hooksApi = new HooksApi(this.config); + } + + // Set authentication token + setToken(token: string) { + this.token = token; + + // Update configuration for all clients + const isDevMode = this.isDevelopmentMode(); + this.config = new Configuration({ + basePath: `${this.baseUrl}/api/v1`, + accessToken: () => token, + baseOptions: { + // In development mode, don't send cookies (use Bearer token only) + // In production mode, include cookies for authentication + withCredentials: !isDevMode, + }, + }); + + // Recreate all API instances with new config + this.loginApi = new LoginApi(this.config); + this.controllerInfoApi = new ControllerInfoApi(this.config); + this.controllerApi = new ControllerApi(this.config); + this.endpointsApi = new EndpointsApi(this.config); + this.credentialsApi = new CredentialsApi(this.config); + this.repositoriesApi = new RepositoriesApi(this.config); + this.organizationsApi = new OrganizationsApi(this.config); + this.enterprisesApi = new EnterprisesApi(this.config); + this.poolsApi = new PoolsApi(this.config); + this.scaleSetsApi = new ScalesetsApi(this.config); + this.instancesApi = new InstancesApi(this.config); + this.providersApi = new ProvidersApi(this.config); + this.firstRunApi = new FirstRunApi(this.config); + this.hooksApi = new HooksApi(this.config); + } + + // Authentication + async login(credentials: LoginRequest): Promise { + const params: PasswordLoginParams = { + username: credentials.username, + password: credentials.password, + }; + const response = await this.loginApi.login(params); + const token = response.data.token; + if (token) { + this.setToken(token); + return { token }; + } + throw new Error('Login failed'); + } + + async getControllerInfo(): Promise { + const response = await this.controllerInfoApi.controllerInfo(); + return response.data; + } + + // GitHub Endpoints + async listGithubEndpoints(): Promise { + const response = await this.endpointsApi.listGithubEndpoints(); + return response.data || []; + } + + async getGithubEndpoint(name: string): Promise { + const response = await this.endpointsApi.getGithubEndpoint(name); + return response.data; + } + + async createGithubEndpoint(params: CreateGithubEndpointParams): Promise { + const response = await this.endpointsApi.createGithubEndpoint(params); + return response.data; + } + + async updateGithubEndpoint(name: string, params: UpdateGithubEndpointParams): Promise { + const response = await this.endpointsApi.updateGithubEndpoint(name, params); + return response.data; + } + + async deleteGithubEndpoint(name: string): Promise { + await this.endpointsApi.deleteGithubEndpoint(name); + } + + // Gitea Endpoints + async listGiteaEndpoints(): Promise { + const response = await this.endpointsApi.listGiteaEndpoints(); + return response.data || []; + } + + async getGiteaEndpoint(name: string): Promise { + const response = await this.endpointsApi.getGiteaEndpoint(name); + return response.data; + } + + async createGiteaEndpoint(params: CreateGiteaEndpointParams): Promise { + const response = await this.endpointsApi.createGiteaEndpoint(params); + return response.data; + } + + async updateGiteaEndpoint(name: string, params: UpdateGiteaEndpointParams): Promise { + const response = await this.endpointsApi.updateGiteaEndpoint(name, params); + return response.data; + } + + async deleteGiteaEndpoint(name: string): Promise { + await this.endpointsApi.deleteGiteaEndpoint(name); + } + + // Combined Endpoints helper + async listAllEndpoints(): Promise { + const [githubEndpoints, giteaEndpoints] = await Promise.all([ + this.listGithubEndpoints().catch(() => []), + this.listGiteaEndpoints().catch(() => []) + ]); + + return [ + ...githubEndpoints.map(ep => ({ ...ep, endpoint_type: 'github' as const })), + ...giteaEndpoints.map(ep => ({ ...ep, endpoint_type: 'gitea' as const })) + ]; + } + + // GitHub Credentials + async listGithubCredentials(): Promise { + const response = await this.credentialsApi.listCredentials(); + return response.data || []; + } + + async getGithubCredentials(id: number): Promise { + const response = await this.credentialsApi.getCredentials(id); + return response.data; + } + + async createGithubCredentials(params: CreateGithubCredentialsParams): Promise { + const response = await this.credentialsApi.createCredentials(params); + return response.data; + } + + async updateGithubCredentials(id: number, params: UpdateGithubCredentialsParams): Promise { + const response = await this.credentialsApi.updateCredentials(id, params); + return response.data; + } + + async deleteGithubCredentials(id: number): Promise { + await this.credentialsApi.deleteCredentials(id); + } + + // Gitea Credentials + async listGiteaCredentials(): Promise { + const response = await this.credentialsApi.listGiteaCredentials(); + return response.data || []; + } + + async getGiteaCredentials(id: number): Promise { + const response = await this.credentialsApi.getGiteaCredentials(id); + return response.data; + } + + async createGiteaCredentials(params: CreateGiteaCredentialsParams): Promise { + const response = await this.credentialsApi.createGiteaCredentials(params); + return response.data; + } + + async updateGiteaCredentials(id: number, params: UpdateGiteaCredentialsParams): Promise { + const response = await this.credentialsApi.updateGiteaCredentials(id, params); + return response.data; + } + + async deleteGiteaCredentials(id: number): Promise { + await this.credentialsApi.deleteGiteaCredentials(id); + } + + // Combined Credentials helper + async listAllCredentials(): Promise { + const [githubCredentials, giteaCredentials] = await Promise.all([ + this.listGithubCredentials().catch(() => []), + this.listGiteaCredentials().catch(() => []) + ]); + + return [...githubCredentials, ...giteaCredentials]; + } + + // Repositories + async installRepositoryWebhook(repoId: string, params: any = {}): Promise { + await this.repositoriesApi.installRepoWebhook(repoId, params); + } + + async uninstallRepositoryWebhook(repoId: string): Promise { + await this.hooksApi.uninstallRepoWebhook(repoId); + } + + async getRepositoryWebhookInfo(repoId: string): Promise { + const response = await this.hooksApi.getRepoWebhookInfo(repoId); + return response.data; + } + async listRepositories(): Promise { + const response = await this.repositoriesApi.listRepos(); + return response.data || []; + } + + async getRepository(id: string): Promise { + const response = await this.repositoriesApi.getRepo(id); + return response.data; + } + + async createRepository(params: CreateRepoParams): Promise { + const response = await this.repositoriesApi.createRepo(params); + return response.data; + } + + async updateRepository(id: string, params: UpdateEntityParams): Promise { + const response = await this.repositoriesApi.updateRepo(id, params); + return response.data; + } + + async deleteRepository(id: string): Promise { + await this.repositoriesApi.deleteRepo(id); + } + + async installRepoWebhook(id: string): Promise { + await this.repositoriesApi.installRepoWebhook(id, {}); + } + + async listRepositoryPools(id: string): Promise { + const response = await this.repositoriesApi.listRepoPools(id); + return response.data || []; + } + + async listRepositoryInstances(id: string): Promise { + const response = await this.repositoriesApi.listRepoInstances(id); + return response.data || []; + } + + async createRepositoryPool(id: string, params: CreatePoolParams): Promise { + const response = await this.repositoriesApi.createRepoPool(id, params); + return response.data; + } + + // Organizations + async installOrganizationWebhook(orgId: string, params: any = {}): Promise { + await this.organizationsApi.installOrgWebhook(orgId, params); + } + + async uninstallOrganizationWebhook(orgId: string): Promise { + await this.hooksApi.uninstallOrgWebhook(orgId); + } + + async getOrganizationWebhookInfo(orgId: string): Promise { + const response = await this.hooksApi.getOrgWebhookInfo(orgId); + return response.data; + } + async listOrganizations(): Promise { + const response = await this.organizationsApi.listOrgs(); + return response.data || []; + } + + async getOrganization(id: string): Promise { + const response = await this.organizationsApi.getOrg(id); + return response.data; + } + + async createOrganization(params: CreateOrgParams): Promise { + const response = await this.organizationsApi.createOrg(params); + return response.data; + } + + async updateOrganization(id: string, params: UpdateEntityParams): Promise { + const response = await this.organizationsApi.updateOrg(id, params); + return response.data; + } + + async deleteOrganization(id: string): Promise { + await this.organizationsApi.deleteOrg(id); + } + + async listOrganizationPools(id: string): Promise { + const response = await this.organizationsApi.listOrgPools(id); + return response.data || []; + } + + async listOrganizationInstances(id: string): Promise { + const response = await this.organizationsApi.listOrgInstances(id); + return response.data || []; + } + + async createOrganizationPool(id: string, params: CreatePoolParams): Promise { + const response = await this.organizationsApi.createOrgPool(id, params); + return response.data; + } + + // Enterprises + async listEnterprises(): Promise { + const response = await this.enterprisesApi.listEnterprises(); + return response.data || []; + } + + async getEnterprise(id: string): Promise { + const response = await this.enterprisesApi.getEnterprise(id); + return response.data; + } + + async createEnterprise(params: CreateEnterpriseParams): Promise { + const response = await this.enterprisesApi.createEnterprise(params); + return response.data; + } + + async updateEnterprise(id: string, params: UpdateEntityParams): Promise { + const response = await this.enterprisesApi.updateEnterprise(id, params); + return response.data; + } + + async deleteEnterprise(id: string): Promise { + await this.enterprisesApi.deleteEnterprise(id); + } + + async listEnterprisePools(id: string): Promise { + const response = await this.enterprisesApi.listEnterprisePools(id); + return response.data || []; + } + + async listEnterpriseInstances(id: string): Promise { + const response = await this.enterprisesApi.listEnterpriseInstances(id); + return response.data || []; + } + + async createEnterprisePool(id: string, params: CreatePoolParams): Promise { + const response = await this.enterprisesApi.createEnterprisePool(id, params); + return response.data; + } + + // Scale sets for repositories, organizations, and enterprises + async createRepositoryScaleSet(id: string, params: CreateScaleSetParams): Promise { + const response = await this.repositoriesApi.createRepoScaleSet(id, params); + return response.data; + } + + async listRepositoryScaleSets(id: string): Promise { + const response = await this.repositoriesApi.listRepoScaleSets(id); + return response.data || []; + } + + async createOrganizationScaleSet(id: string, params: CreateScaleSetParams): Promise { + const response = await this.organizationsApi.createOrgScaleSet(id, params); + return response.data; + } + + async listOrganizationScaleSets(id: string): Promise { + const response = await this.organizationsApi.listOrgScaleSets(id); + return response.data || []; + } + + async createEnterpriseScaleSet(id: string, params: CreateScaleSetParams): Promise { + const response = await this.enterprisesApi.createEnterpriseScaleSet(id, params); + return response.data; + } + + async listEnterpriseScaleSets(id: string): Promise { + const response = await this.enterprisesApi.listEnterpriseScaleSets(id); + return response.data || []; + } + + // Pools + async listPools(): Promise { + const response = await this.poolsApi.listPools(); + return response.data || []; + } + + async listAllPools(): Promise { + return this.listPools(); + } + + async getPool(id: string): Promise { + const response = await this.poolsApi.getPool(id); + return response.data; + } + + async updatePool(id: string, params: UpdatePoolParams): Promise { + const response = await this.poolsApi.updatePool(id, params); + return response.data; + } + + async deletePool(id: string): Promise { + await this.poolsApi.deletePool(id); + } + + // Scale Sets + async listScaleSets(): Promise { + const response = await this.scaleSetsApi.listScalesets(); + return response.data || []; + } + + async getScaleSet(id: number): Promise { + const response = await this.scaleSetsApi.getScaleSet(id.toString()); + return response.data; + } + + async updateScaleSet(id: number, params: Partial): Promise { + const response = await this.scaleSetsApi.updateScaleSet(id.toString(), params); + return response.data; + } + + async deleteScaleSet(id: number): Promise { + await this.scaleSetsApi.deleteScaleSet(id.toString()); + } + + // Instances + async listInstances(): Promise { + const response = await this.instancesApi.listInstances(); + return response.data || []; + } + + async getInstance(name: string): Promise { + const response = await this.instancesApi.getInstance(name); + return response.data; + } + + async deleteInstance(name: string): Promise { + await this.instancesApi.deleteInstance(name); + } + + // Providers + async listProviders(): Promise { + const response = await this.providersApi.listProviders(); + return response.data || []; + } + + // Compatibility aliases + async listCredentials(): Promise { + return this.listAllCredentials(); + } + + async listEndpoints(): Promise { + return this.listAllEndpoints(); + } + + // First-run initialization + async firstRun(params: NewUserParams): Promise { + const response = await this.firstRunApi.firstRun(params); + return response.data; + } + + // Controller management + async updateController(params: UpdateControllerParams): Promise { + const response = await this.controllerApi.updateController(params); + return response.data; + } +} + +// Create a singleton instance +export const generatedGarmApi = new GeneratedGarmApiClient(); \ No newline at end of file diff --git a/webapp/src/lib/api/generated/.gitignore b/webapp/src/lib/api/generated/.gitignore new file mode 100644 index 00000000..149b5765 --- /dev/null +++ b/webapp/src/lib/api/generated/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/webapp/src/lib/api/generated/.npmignore b/webapp/src/lib/api/generated/.npmignore new file mode 100644 index 00000000..999d88df --- /dev/null +++ b/webapp/src/lib/api/generated/.npmignore @@ -0,0 +1 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/webapp/src/lib/api/generated/.openapi-generator-ignore b/webapp/src/lib/api/generated/.openapi-generator-ignore new file mode 100644 index 00000000..7484ee59 --- /dev/null +++ b/webapp/src/lib/api/generated/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/webapp/src/lib/api/generated/.openapi-generator/FILES b/webapp/src/lib/api/generated/.openapi-generator/FILES new file mode 100644 index 00000000..5f89d927 --- /dev/null +++ b/webapp/src/lib/api/generated/.openapi-generator/FILES @@ -0,0 +1,70 @@ +.gitignore +.npmignore +.openapi-generator-ignore +api.ts +base.ts +common.ts +configuration.ts +docs/APIErrorResponse.md +docs/Address.md +docs/ControllerApi.md +docs/ControllerInfo.md +docs/ControllerInfoApi.md +docs/CreateEnterpriseParams.md +docs/CreateGiteaCredentialsParams.md +docs/CreateGiteaEndpointParams.md +docs/CreateGithubCredentialsParams.md +docs/CreateGithubEndpointParams.md +docs/CreateOrgParams.md +docs/CreatePoolParams.md +docs/CreateRepoParams.md +docs/CreateScaleSetParams.md +docs/CredentialsApi.md +docs/EndpointsApi.md +docs/Enterprise.md +docs/EnterprisesApi.md +docs/EntityEvent.md +docs/FirstRunApi.md +docs/ForgeCredentials.md +docs/ForgeEndpoint.md +docs/ForgeEntity.md +docs/GithubApp.md +docs/GithubPAT.md +docs/GithubRateLimit.md +docs/HookInfo.md +docs/HooksApi.md +docs/InstallWebhookParams.md +docs/Instance.md +docs/InstancesApi.md +docs/JWTResponse.md +docs/Job.md +docs/JobsApi.md +docs/LoginApi.md +docs/MetricsTokenApi.md +docs/NewUserParams.md +docs/Organization.md +docs/OrganizationsApi.md +docs/PasswordLoginParams.md +docs/Pool.md +docs/PoolManagerStatus.md +docs/PoolsApi.md +docs/Provider.md +docs/ProvidersApi.md +docs/RepositoriesApi.md +docs/Repository.md +docs/RunnerPrefix.md +docs/ScaleSet.md +docs/ScalesetsApi.md +docs/StatusMessage.md +docs/Tag.md +docs/UpdateControllerParams.md +docs/UpdateEntityParams.md +docs/UpdateGiteaCredentialsParams.md +docs/UpdateGiteaEndpointParams.md +docs/UpdateGithubCredentialsParams.md +docs/UpdateGithubEndpointParams.md +docs/UpdatePoolParams.md +docs/UpdateScaleSetParams.md +docs/User.md +git_push.sh +index.ts diff --git a/webapp/src/lib/api/generated/.openapi-generator/VERSION b/webapp/src/lib/api/generated/.openapi-generator/VERSION new file mode 100644 index 00000000..e465da43 --- /dev/null +++ b/webapp/src/lib/api/generated/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0 diff --git a/webapp/src/lib/api/generated/api.ts b/webapp/src/lib/api/generated/api.ts new file mode 100644 index 00000000..41d28ce1 --- /dev/null +++ b/webapp/src/lib/api/generated/api.ts @@ -0,0 +1,11684 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Garm API. + * The Garm API generated using go-swagger. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from './configuration'; +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +import type { RequestArgs } from './base'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base'; + +/** + * + * @export + * @interface APIErrorResponse + */ +export interface APIErrorResponse { + /** + * + * @type {string} + * @memberof APIErrorResponse + */ + 'details'?: string; + /** + * + * @type {string} + * @memberof APIErrorResponse + */ + 'error'?: string; +} +/** + * + * @export + * @interface Address + */ +export interface Address { + /** + * + * @type {string} + * @memberof Address + */ + 'address'?: string; + /** + * + * @type {string} + * @memberof Address + */ + 'type'?: string; +} +/** + * + * @export + * @interface ControllerInfo + */ +export interface ControllerInfo { + /** + * CallbackURL is the URL where instances can send updates back to the controller. This URL is used by instances to send status updates back to the controller. The URL itself may be made available to instances via a reverse proxy or a load balancer. That means that the user is responsible for telling GARM what the public URL is, by setting this field. + * @type {string} + * @memberof ControllerInfo + */ + 'callback_url'?: string; + /** + * ControllerID is the unique ID of this controller. This ID gets generated automatically on controller init. + * @type {string} + * @memberof ControllerInfo + */ + 'controller_id'?: string; + /** + * ControllerWebhookURL is the controller specific URL where webhooks will be received. This field holds the WebhookURL defined above to which we append the ControllerID. Functionally it is the same as WebhookURL, but it allows us to safely manage webhooks from GARM without accidentally removing webhooks from other services or GARM controllers. + * @type {string} + * @memberof ControllerInfo + */ + 'controller_webhook_url'?: string; + /** + * Hostname is the hostname of the machine that runs this controller. In the future, this field will be migrated to a separate table that will keep track of each the controller nodes that are part of a cluster. This will happen when we implement controller scale-out capability. + * @type {string} + * @memberof ControllerInfo + */ + 'hostname'?: string; + /** + * MetadataURL is the public metadata URL of the GARM instance. This URL is used by instances to fetch information they need to set themselves up. The URL itself may be made available to runners via a reverse proxy or a load balancer. That means that the user is responsible for telling GARM what the public URL is, by setting this field. + * @type {string} + * @memberof ControllerInfo + */ + 'metadata_url'?: string; + /** + * MinimumJobAgeBackoff is the minimum time in seconds that a job must be in queued state before GARM will attempt to allocate a runner for it. When set to a non zero value, GARM will ignore the job until the job\'s age is greater than this value. When using the min_idle_runners feature of a pool, this gives enough time for potential idle runners to pick up the job before GARM attempts to allocate a new runner, thus avoiding the need to potentially scale down runners later. + * @type {number} + * @memberof ControllerInfo + */ + 'minimum_job_age_backoff'?: number; + /** + * Version is the version of the GARM controller. + * @type {string} + * @memberof ControllerInfo + */ + 'version'?: string; + /** + * WebhookURL is the base URL where the controller will receive webhooks from github. When webhook management is used, this URL is used as a base to which the controller UUID is appended and which will receive the webhooks. The URL itself may be made available to instances via a reverse proxy or a load balancer. That means that the user is responsible for telling GARM what the public URL is, by setting this field. + * @type {string} + * @memberof ControllerInfo + */ + 'webhook_url'?: string; +} +/** + * + * @export + * @interface CreateEnterpriseParams + */ +export interface CreateEnterpriseParams { + /** + * + * @type {string} + * @memberof CreateEnterpriseParams + */ + 'credentials_name'?: string; + /** + * + * @type {string} + * @memberof CreateEnterpriseParams + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof CreateEnterpriseParams + */ + 'pool_balancer_type'?: string; + /** + * + * @type {string} + * @memberof CreateEnterpriseParams + */ + 'webhook_secret'?: string; +} +/** + * + * @export + * @interface CreateGiteaCredentialsParams + */ +export interface CreateGiteaCredentialsParams { + /** + * + * @type {GithubApp} + * @memberof CreateGiteaCredentialsParams + */ + 'app'?: GithubApp; + /** + * + * @type {string} + * @memberof CreateGiteaCredentialsParams + */ + 'auth_type'?: string; + /** + * + * @type {string} + * @memberof CreateGiteaCredentialsParams + */ + 'description'?: string; + /** + * + * @type {string} + * @memberof CreateGiteaCredentialsParams + */ + 'endpoint'?: string; + /** + * + * @type {string} + * @memberof CreateGiteaCredentialsParams + */ + 'name'?: string; + /** + * + * @type {GithubPAT} + * @memberof CreateGiteaCredentialsParams + */ + 'pat'?: GithubPAT; +} +/** + * + * @export + * @interface CreateGiteaEndpointParams + */ +export interface CreateGiteaEndpointParams { + /** + * + * @type {string} + * @memberof CreateGiteaEndpointParams + */ + 'api_base_url'?: string; + /** + * + * @type {string} + * @memberof CreateGiteaEndpointParams + */ + 'base_url'?: string; + /** + * + * @type {Array} + * @memberof CreateGiteaEndpointParams + */ + 'ca_cert_bundle'?: Array; + /** + * + * @type {string} + * @memberof CreateGiteaEndpointParams + */ + 'description'?: string; + /** + * + * @type {string} + * @memberof CreateGiteaEndpointParams + */ + 'name'?: string; +} +/** + * + * @export + * @interface CreateGithubCredentialsParams + */ +export interface CreateGithubCredentialsParams { + /** + * + * @type {GithubApp} + * @memberof CreateGithubCredentialsParams + */ + 'app'?: GithubApp; + /** + * + * @type {string} + * @memberof CreateGithubCredentialsParams + */ + 'auth_type'?: string; + /** + * + * @type {string} + * @memberof CreateGithubCredentialsParams + */ + 'description'?: string; + /** + * + * @type {string} + * @memberof CreateGithubCredentialsParams + */ + 'endpoint'?: string; + /** + * + * @type {string} + * @memberof CreateGithubCredentialsParams + */ + 'name'?: string; + /** + * + * @type {GithubPAT} + * @memberof CreateGithubCredentialsParams + */ + 'pat'?: GithubPAT; +} +/** + * + * @export + * @interface CreateGithubEndpointParams + */ +export interface CreateGithubEndpointParams { + /** + * + * @type {string} + * @memberof CreateGithubEndpointParams + */ + 'api_base_url'?: string; + /** + * + * @type {string} + * @memberof CreateGithubEndpointParams + */ + 'base_url'?: string; + /** + * + * @type {Array} + * @memberof CreateGithubEndpointParams + */ + 'ca_cert_bundle'?: Array; + /** + * + * @type {string} + * @memberof CreateGithubEndpointParams + */ + 'description'?: string; + /** + * + * @type {string} + * @memberof CreateGithubEndpointParams + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof CreateGithubEndpointParams + */ + 'upload_base_url'?: string; +} +/** + * + * @export + * @interface CreateOrgParams + */ +export interface CreateOrgParams { + /** + * + * @type {string} + * @memberof CreateOrgParams + */ + 'credentials_name'?: string; + /** + * + * @type {string} + * @memberof CreateOrgParams + */ + 'forge_type'?: string; + /** + * + * @type {string} + * @memberof CreateOrgParams + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof CreateOrgParams + */ + 'pool_balancer_type'?: string; + /** + * + * @type {string} + * @memberof CreateOrgParams + */ + 'webhook_secret'?: string; +} +/** + * + * @export + * @interface CreatePoolParams + */ +export interface CreatePoolParams { + /** + * + * @type {boolean} + * @memberof CreatePoolParams + */ + 'enabled'?: boolean; + /** + * + * @type {object} + * @memberof CreatePoolParams + */ + 'extra_specs'?: object; + /** + * + * @type {string} + * @memberof CreatePoolParams + */ + 'flavor'?: string; + /** + * GithubRunnerGroup is the github runner group in which the runners of this pool will be added to. The runner group must be created by someone with access to the enterprise. + * @type {string} + * @memberof CreatePoolParams + */ + 'github-runner-group'?: string; + /** + * + * @type {string} + * @memberof CreatePoolParams + */ + 'image'?: string; + /** + * + * @type {number} + * @memberof CreatePoolParams + */ + 'max_runners'?: number; + /** + * + * @type {number} + * @memberof CreatePoolParams + */ + 'min_idle_runners'?: number; + /** + * + * @type {string} + * @memberof CreatePoolParams + */ + 'os_arch'?: string; + /** + * + * @type {string} + * @memberof CreatePoolParams + */ + 'os_type'?: string; + /** + * + * @type {number} + * @memberof CreatePoolParams + */ + 'priority'?: number; + /** + * + * @type {string} + * @memberof CreatePoolParams + */ + 'provider_name'?: string; + /** + * + * @type {number} + * @memberof CreatePoolParams + */ + 'runner_bootstrap_timeout'?: number; + /** + * + * @type {string} + * @memberof CreatePoolParams + */ + 'runner_prefix'?: string; + /** + * + * @type {Array} + * @memberof CreatePoolParams + */ + 'tags'?: Array; +} +/** + * + * @export + * @interface CreateRepoParams + */ +export interface CreateRepoParams { + /** + * + * @type {string} + * @memberof CreateRepoParams + */ + 'credentials_name'?: string; + /** + * + * @type {string} + * @memberof CreateRepoParams + */ + 'forge_type'?: string; + /** + * + * @type {string} + * @memberof CreateRepoParams + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof CreateRepoParams + */ + 'owner'?: string; + /** + * + * @type {string} + * @memberof CreateRepoParams + */ + 'pool_balancer_type'?: string; + /** + * + * @type {string} + * @memberof CreateRepoParams + */ + 'webhook_secret'?: string; +} +/** + * + * @export + * @interface CreateScaleSetParams + */ +export interface CreateScaleSetParams { + /** + * + * @type {boolean} + * @memberof CreateScaleSetParams + */ + 'disable_update'?: boolean; + /** + * + * @type {boolean} + * @memberof CreateScaleSetParams + */ + 'enabled'?: boolean; + /** + * + * @type {object} + * @memberof CreateScaleSetParams + */ + 'extra_specs'?: object; + /** + * + * @type {string} + * @memberof CreateScaleSetParams + */ + 'flavor'?: string; + /** + * GithubRunnerGroup is the github runner group in which the runners of this pool will be added to. The runner group must be created by someone with access to the enterprise. + * @type {string} + * @memberof CreateScaleSetParams + */ + 'github-runner-group'?: string; + /** + * + * @type {string} + * @memberof CreateScaleSetParams + */ + 'image'?: string; + /** + * + * @type {number} + * @memberof CreateScaleSetParams + */ + 'max_runners'?: number; + /** + * + * @type {number} + * @memberof CreateScaleSetParams + */ + 'min_idle_runners'?: number; + /** + * + * @type {string} + * @memberof CreateScaleSetParams + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof CreateScaleSetParams + */ + 'os_arch'?: string; + /** + * + * @type {string} + * @memberof CreateScaleSetParams + */ + 'os_type'?: string; + /** + * + * @type {string} + * @memberof CreateScaleSetParams + */ + 'provider_name'?: string; + /** + * + * @type {number} + * @memberof CreateScaleSetParams + */ + 'runner_bootstrap_timeout'?: number; + /** + * + * @type {string} + * @memberof CreateScaleSetParams + */ + 'runner_prefix'?: string; + /** + * + * @type {number} + * @memberof CreateScaleSetParams + */ + 'scale_set_id'?: number; + /** + * + * @type {Array} + * @memberof CreateScaleSetParams + */ + 'tags'?: Array; +} +/** + * + * @export + * @interface Enterprise + */ +export interface Enterprise { + /** + * + * @type {string} + * @memberof Enterprise + */ + 'created_at'?: string; + /** + * + * @type {ForgeCredentials} + * @memberof Enterprise + */ + 'credentials'?: ForgeCredentials; + /** + * + * @type {number} + * @memberof Enterprise + */ + 'credentials_id'?: number; + /** + * CredentialName is the name of the credentials associated with the enterprise. This field is now deprecated. Use CredentialsID instead. This field will be removed in v0.2.0. + * @type {string} + * @memberof Enterprise + */ + 'credentials_name'?: string; + /** + * + * @type {ForgeEndpoint} + * @memberof Enterprise + */ + 'endpoint'?: ForgeEndpoint; + /** + * + * @type {Array} + * @memberof Enterprise + */ + 'events'?: Array; + /** + * + * @type {string} + * @memberof Enterprise + */ + 'id'?: string; + /** + * + * @type {string} + * @memberof Enterprise + */ + 'name'?: string; + /** + * + * @type {Array} + * @memberof Enterprise + */ + 'pool'?: Array; + /** + * + * @type {string} + * @memberof Enterprise + */ + 'pool_balancing_type'?: string; + /** + * + * @type {PoolManagerStatus} + * @memberof Enterprise + */ + 'pool_manager_status'?: PoolManagerStatus; + /** + * + * @type {string} + * @memberof Enterprise + */ + 'updated_at'?: string; +} +/** + * + * @export + * @interface EntityEvent + */ +export interface EntityEvent { + /** + * + * @type {string} + * @memberof EntityEvent + */ + 'created_at'?: string; + /** + * + * @type {string} + * @memberof EntityEvent + */ + 'event_level'?: string; + /** + * + * @type {string} + * @memberof EntityEvent + */ + 'event_type'?: string; + /** + * + * @type {number} + * @memberof EntityEvent + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof EntityEvent + */ + 'message'?: string; +} +/** + * + * @export + * @interface ForgeCredentials + */ +export interface ForgeCredentials { + /** + * + * @type {string} + * @memberof ForgeCredentials + */ + 'api_base_url'?: string; + /** + * + * @type {string} + * @memberof ForgeCredentials + */ + 'auth-type'?: string; + /** + * + * @type {string} + * @memberof ForgeCredentials + */ + 'base_url'?: string; + /** + * + * @type {Array} + * @memberof ForgeCredentials + */ + 'ca_bundle'?: Array; + /** + * + * @type {string} + * @memberof ForgeCredentials + */ + 'created_at'?: string; + /** + * + * @type {string} + * @memberof ForgeCredentials + */ + 'description'?: string; + /** + * + * @type {ForgeEndpoint} + * @memberof ForgeCredentials + */ + 'endpoint'?: ForgeEndpoint; + /** + * + * @type {Array} + * @memberof ForgeCredentials + */ + 'enterprises'?: Array; + /** + * + * @type {string} + * @memberof ForgeCredentials + */ + 'forge_type'?: string; + /** + * + * @type {number} + * @memberof ForgeCredentials + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof ForgeCredentials + */ + 'name'?: string; + /** + * + * @type {Array} + * @memberof ForgeCredentials + */ + 'organizations'?: Array; + /** + * + * @type {GithubRateLimit} + * @memberof ForgeCredentials + */ + 'rate_limit'?: GithubRateLimit; + /** + * + * @type {Array} + * @memberof ForgeCredentials + */ + 'repositories'?: Array; + /** + * + * @type {string} + * @memberof ForgeCredentials + */ + 'updated_at'?: string; + /** + * + * @type {string} + * @memberof ForgeCredentials + */ + 'upload_base_url'?: string; +} +/** + * + * @export + * @interface ForgeEndpoint + */ +export interface ForgeEndpoint { + /** + * + * @type {string} + * @memberof ForgeEndpoint + */ + 'api_base_url'?: string; + /** + * + * @type {string} + * @memberof ForgeEndpoint + */ + 'base_url'?: string; + /** + * + * @type {Array} + * @memberof ForgeEndpoint + */ + 'ca_cert_bundle'?: Array; + /** + * + * @type {string} + * @memberof ForgeEndpoint + */ + 'created_at'?: string; + /** + * + * @type {string} + * @memberof ForgeEndpoint + */ + 'description'?: string; + /** + * + * @type {string} + * @memberof ForgeEndpoint + */ + 'endpoint_type'?: string; + /** + * + * @type {string} + * @memberof ForgeEndpoint + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof ForgeEndpoint + */ + 'updated_at'?: string; + /** + * + * @type {string} + * @memberof ForgeEndpoint + */ + 'upload_base_url'?: string; +} +/** + * + * @export + * @interface ForgeEntity + */ +export interface ForgeEntity { + /** + * + * @type {number} + * @memberof ForgeEntity + */ + 'agent_id'?: number; + /** + * + * @type {string} + * @memberof ForgeEntity + */ + 'os_name'?: string; + /** + * + * @type {string} + * @memberof ForgeEntity + */ + 'os_version'?: string; +} +/** + * + * @export + * @interface GithubApp + */ +export interface GithubApp { + /** + * + * @type {number} + * @memberof GithubApp + */ + 'app_id'?: number; + /** + * + * @type {number} + * @memberof GithubApp + */ + 'installation_id'?: number; + /** + * + * @type {Array} + * @memberof GithubApp + */ + 'private_key_bytes'?: Array; +} +/** + * + * @export + * @interface GithubPAT + */ +export interface GithubPAT { + /** + * + * @type {string} + * @memberof GithubPAT + */ + 'oauth2_token'?: string; +} +/** + * + * @export + * @interface GithubRateLimit + */ +export interface GithubRateLimit { + /** + * + * @type {number} + * @memberof GithubRateLimit + */ + 'limit'?: number; + /** + * + * @type {number} + * @memberof GithubRateLimit + */ + 'remaining'?: number; + /** + * + * @type {number} + * @memberof GithubRateLimit + */ + 'reset'?: number; + /** + * + * @type {number} + * @memberof GithubRateLimit + */ + 'used'?: number; +} +/** + * + * @export + * @interface HookInfo + */ +export interface HookInfo { + /** + * + * @type {boolean} + * @memberof HookInfo + */ + 'active'?: boolean; + /** + * + * @type {Array} + * @memberof HookInfo + */ + 'events'?: Array; + /** + * + * @type {number} + * @memberof HookInfo + */ + 'id'?: number; + /** + * + * @type {boolean} + * @memberof HookInfo + */ + 'insecure_ssl'?: boolean; + /** + * + * @type {string} + * @memberof HookInfo + */ + 'url'?: string; +} +/** + * + * @export + * @interface InstallWebhookParams + */ +export interface InstallWebhookParams { + /** + * + * @type {boolean} + * @memberof InstallWebhookParams + */ + 'insecure_ssl'?: boolean; + /** + * + * @type {string} + * @memberof InstallWebhookParams + */ + 'webhook_endpoint_type'?: string; +} +/** + * + * @export + * @interface Instance + */ +export interface Instance { + /** + * Addresses is a list of IP addresses the provider reports for this instance. + * @type {Array
                } + * @memberof Instance + */ + 'addresses'?: Array
                ; + /** + * AgentID is the github runner agent ID. + * @type {number} + * @memberof Instance + */ + 'agent_id'?: number; + /** + * CreatedAt is the timestamp of the creation of this runner. + * @type {string} + * @memberof Instance + */ + 'created_at'?: string; + /** + * GithubRunnerGroup is the github runner group to which the runner belongs. The runner group must be created by someone with access to the enterprise. + * @type {string} + * @memberof Instance + */ + 'github-runner-group'?: string; + /** + * ID is the database ID of this instance. + * @type {string} + * @memberof Instance + */ + 'id'?: string; + /** + * + * @type {Job} + * @memberof Instance + */ + 'job'?: Job; + /** + * Name is the name associated with an instance. Depending on the provider, this may or may not be useful in the context of the provider, but we can use it internally to identify the instance. + * @type {string} + * @memberof Instance + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof Instance + */ + 'os_arch'?: string; + /** + * OSName is the name of the OS. Eg: ubuntu, centos, etc. + * @type {string} + * @memberof Instance + */ + 'os_name'?: string; + /** + * + * @type {string} + * @memberof Instance + */ + 'os_type'?: string; + /** + * OSVersion is the version of the operating system. + * @type {string} + * @memberof Instance + */ + 'os_version'?: string; + /** + * PoolID is the ID of the garm pool to which a runner belongs. + * @type {string} + * @memberof Instance + */ + 'pool_id'?: string; + /** + * ProviderFault holds any error messages captured from the IaaS provider that is responsible for managing the lifecycle of the runner. + * @type {Array} + * @memberof Instance + */ + 'provider_fault'?: Array; + /** + * PeoviderID is the unique ID the provider associated with the compute instance. We use this to identify the instance in the provider. + * @type {string} + * @memberof Instance + */ + 'provider_id'?: string; + /** + * ProviderName is the name of the IaaS where the instance was created. + * @type {string} + * @memberof Instance + */ + 'provider_name'?: string; + /** + * + * @type {string} + * @memberof Instance + */ + 'runner_status'?: string; + /** + * ScaleSetID is the ID of the scale set to which a runner belongs. + * @type {number} + * @memberof Instance + */ + 'scale_set_id'?: number; + /** + * + * @type {string} + * @memberof Instance + */ + 'status'?: string; + /** + * StatusMessages is a list of status messages sent back by the runner as it sets itself up. + * @type {Array} + * @memberof Instance + */ + 'status_messages'?: Array; + /** + * UpdatedAt is the timestamp of the last update to this runner. + * @type {string} + * @memberof Instance + */ + 'updated_at'?: string; +} +/** + * JWTResponse holds the JWT token returned as a result of a successful auth + * @export + * @interface JWTResponse + */ +export interface JWTResponse { + /** + * + * @type {string} + * @memberof JWTResponse + */ + 'token'?: string; +} +/** + * + * @export + * @interface Job + */ +export interface Job { + /** + * Action is the specific activity that triggered the event. + * @type {string} + * @memberof Job + */ + 'action'?: string; + /** + * + * @type {string} + * @memberof Job + */ + 'completed_at'?: string; + /** + * Conclusion is the outcome of the job. Possible values: \"success\", \"failure\", \"neutral\", \"cancelled\", \"skipped\", \"timed_out\", \"action_required\" + * @type {string} + * @memberof Job + */ + 'conclusion'?: string; + /** + * + * @type {string} + * @memberof Job + */ + 'created_at'?: string; + /** + * + * @type {string} + * @memberof Job + */ + 'enterprise_id'?: string; + /** + * ID is the ID of the job. + * @type {number} + * @memberof Job + */ + 'id'?: number; + /** + * + * @type {Array} + * @memberof Job + */ + 'labels'?: Array; + /** + * + * @type {string} + * @memberof Job + */ + 'locked_by'?: string; + /** + * Name is the name if the job that was triggered. + * @type {string} + * @memberof Job + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof Job + */ + 'org_id'?: string; + /** + * The entity that received the hook. Webhooks may be configured on the repo, the org and/or the enterprise. If we only configure a repo to use garm, we\'ll only ever receive a webhook from the repo. But if we configure the parent org of the repo and the parent enterprise of the org to use garm, a webhook will be sent for each entity type, in response to one workflow event. Thus, we will get 3 webhooks with the same run_id and job id. Record all involved entities in the same job if we have them configured in garm. + * @type {string} + * @memberof Job + */ + 'repo_id'?: string; + /** + * repository in which the job was triggered. + * @type {string} + * @memberof Job + */ + 'repository_name'?: string; + /** + * + * @type {string} + * @memberof Job + */ + 'repository_owner'?: string; + /** + * RunID is the ID of the workflow run. A run may have multiple jobs. + * @type {number} + * @memberof Job + */ + 'run_id'?: number; + /** + * + * @type {number} + * @memberof Job + */ + 'runner_group_id'?: number; + /** + * + * @type {string} + * @memberof Job + */ + 'runner_group_name'?: string; + /** + * + * @type {number} + * @memberof Job + */ + 'runner_id'?: number; + /** + * + * @type {string} + * @memberof Job + */ + 'runner_name'?: string; + /** + * ScaleSetJobID is the job ID when generated for a scale set. + * @type {string} + * @memberof Job + */ + 'scaleset_job_id'?: string; + /** + * + * @type {string} + * @memberof Job + */ + 'started_at'?: string; + /** + * Status is the phase of the lifecycle that the job is currently in. \"queued\", \"in_progress\" and \"completed\". + * @type {string} + * @memberof Job + */ + 'status'?: string; + /** + * + * @type {string} + * @memberof Job + */ + 'updated_at'?: string; + /** + * + * @type {number} + * @memberof Job + */ + 'workflow_job_id'?: number; +} +/** + * NewUserParams holds the needed information to create a new user + * @export + * @interface NewUserParams + */ +export interface NewUserParams { + /** + * + * @type {string} + * @memberof NewUserParams + */ + 'email'?: string; + /** + * + * @type {string} + * @memberof NewUserParams + */ + 'full_name'?: string; + /** + * + * @type {string} + * @memberof NewUserParams + */ + 'password'?: string; + /** + * + * @type {string} + * @memberof NewUserParams + */ + 'username'?: string; +} +/** + * + * @export + * @interface Organization + */ +export interface Organization { + /** + * + * @type {string} + * @memberof Organization + */ + 'created_at'?: string; + /** + * + * @type {ForgeCredentials} + * @memberof Organization + */ + 'credentials'?: ForgeCredentials; + /** + * + * @type {number} + * @memberof Organization + */ + 'credentials_id'?: number; + /** + * CredentialName is the name of the credentials associated with the enterprise. This field is now deprecated. Use CredentialsID instead. This field will be removed in v0.2.0. + * @type {string} + * @memberof Organization + */ + 'credentials_name'?: string; + /** + * + * @type {ForgeEndpoint} + * @memberof Organization + */ + 'endpoint'?: ForgeEndpoint; + /** + * + * @type {Array} + * @memberof Organization + */ + 'events'?: Array; + /** + * + * @type {string} + * @memberof Organization + */ + 'id'?: string; + /** + * + * @type {string} + * @memberof Organization + */ + 'name'?: string; + /** + * + * @type {Array} + * @memberof Organization + */ + 'pool'?: Array; + /** + * + * @type {string} + * @memberof Organization + */ + 'pool_balancing_type'?: string; + /** + * + * @type {PoolManagerStatus} + * @memberof Organization + */ + 'pool_manager_status'?: PoolManagerStatus; + /** + * + * @type {string} + * @memberof Organization + */ + 'updated_at'?: string; +} +/** + * + * @export + * @interface PasswordLoginParams + */ +export interface PasswordLoginParams { + /** + * + * @type {string} + * @memberof PasswordLoginParams + */ + 'password'?: string; + /** + * + * @type {string} + * @memberof PasswordLoginParams + */ + 'username'?: string; +} +/** + * + * @export + * @interface Pool + */ +export interface Pool { + /** + * + * @type {string} + * @memberof Pool + */ + 'created_at'?: string; + /** + * + * @type {boolean} + * @memberof Pool + */ + 'enabled'?: boolean; + /** + * + * @type {ForgeEndpoint} + * @memberof Pool + */ + 'endpoint'?: ForgeEndpoint; + /** + * + * @type {string} + * @memberof Pool + */ + 'enterprise_id'?: string; + /** + * + * @type {string} + * @memberof Pool + */ + 'enterprise_name'?: string; + /** + * ExtraSpecs is an opaque raw json that gets sent to the provider as part of the bootstrap params for instances. It can contain any kind of data needed by providers. The contents of this field means nothing to garm itself. We don\'t act on the information in this field at all. We only validate that it\'s a proper json. + * @type {object} + * @memberof Pool + */ + 'extra_specs'?: object; + /** + * + * @type {string} + * @memberof Pool + */ + 'flavor'?: string; + /** + * GithubRunnerGroup is the github runner group in which the runners will be added. The runner group must be created by someone with access to the enterprise. + * @type {string} + * @memberof Pool + */ + 'github-runner-group'?: string; + /** + * + * @type {string} + * @memberof Pool + */ + 'id'?: string; + /** + * + * @type {string} + * @memberof Pool + */ + 'image'?: string; + /** + * + * @type {Array} + * @memberof Pool + */ + 'instances'?: Array; + /** + * + * @type {number} + * @memberof Pool + */ + 'max_runners'?: number; + /** + * + * @type {number} + * @memberof Pool + */ + 'min_idle_runners'?: number; + /** + * + * @type {string} + * @memberof Pool + */ + 'org_id'?: string; + /** + * + * @type {string} + * @memberof Pool + */ + 'org_name'?: string; + /** + * + * @type {string} + * @memberof Pool + */ + 'os_arch'?: string; + /** + * + * @type {string} + * @memberof Pool + */ + 'os_type'?: string; + /** + * Priority is the priority of the pool. The higher the number, the higher the priority. When fetching matching pools for a set of tags, the result will be sorted in descending order of priority. + * @type {number} + * @memberof Pool + */ + 'priority'?: number; + /** + * + * @type {string} + * @memberof Pool + */ + 'provider_name'?: string; + /** + * + * @type {string} + * @memberof Pool + */ + 'repo_id'?: string; + /** + * + * @type {string} + * @memberof Pool + */ + 'repo_name'?: string; + /** + * + * @type {number} + * @memberof Pool + */ + 'runner_bootstrap_timeout'?: number; + /** + * + * @type {string} + * @memberof Pool + */ + 'runner_prefix'?: string; + /** + * + * @type {Array} + * @memberof Pool + */ + 'tags'?: Array; + /** + * + * @type {string} + * @memberof Pool + */ + 'updated_at'?: string; +} +/** + * + * @export + * @interface PoolManagerStatus + */ +export interface PoolManagerStatus { + /** + * + * @type {string} + * @memberof PoolManagerStatus + */ + 'failure_reason'?: string; + /** + * + * @type {boolean} + * @memberof PoolManagerStatus + */ + 'running'?: boolean; +} +/** + * + * @export + * @interface Provider + */ +export interface Provider { + /** + * + * @type {string} + * @memberof Provider + */ + 'description'?: string; + /** + * + * @type {string} + * @memberof Provider + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof Provider + */ + 'type'?: string; +} +/** + * + * @export + * @interface Repository + */ +export interface Repository { + /** + * + * @type {string} + * @memberof Repository + */ + 'created_at'?: string; + /** + * + * @type {ForgeCredentials} + * @memberof Repository + */ + 'credentials'?: ForgeCredentials; + /** + * + * @type {number} + * @memberof Repository + */ + 'credentials_id'?: number; + /** + * CredentialName is the name of the credentials associated with the enterprise. This field is now deprecated. Use CredentialsID instead. This field will be removed in v0.2.0. + * @type {string} + * @memberof Repository + */ + 'credentials_name'?: string; + /** + * + * @type {ForgeEndpoint} + * @memberof Repository + */ + 'endpoint'?: ForgeEndpoint; + /** + * + * @type {Array} + * @memberof Repository + */ + 'events'?: Array; + /** + * + * @type {string} + * @memberof Repository + */ + 'id'?: string; + /** + * + * @type {string} + * @memberof Repository + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof Repository + */ + 'owner'?: string; + /** + * + * @type {Array} + * @memberof Repository + */ + 'pool'?: Array; + /** + * + * @type {string} + * @memberof Repository + */ + 'pool_balancing_type'?: string; + /** + * + * @type {PoolManagerStatus} + * @memberof Repository + */ + 'pool_manager_status'?: PoolManagerStatus; + /** + * + * @type {string} + * @memberof Repository + */ + 'updated_at'?: string; +} +/** + * + * @export + * @interface RunnerPrefix + */ +export interface RunnerPrefix { + /** + * + * @type {string} + * @memberof RunnerPrefix + */ + 'runner_prefix'?: string; +} +/** + * + * @export + * @interface ScaleSet + */ +export interface ScaleSet { + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'created_at'?: string; + /** + * + * @type {number} + * @memberof ScaleSet + */ + 'desired_runner_count'?: number; + /** + * + * @type {boolean} + * @memberof ScaleSet + */ + 'disable_update'?: boolean; + /** + * + * @type {boolean} + * @memberof ScaleSet + */ + 'enabled'?: boolean; + /** + * + * @type {ForgeEndpoint} + * @memberof ScaleSet + */ + 'endpoint'?: ForgeEndpoint; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'enterprise_id'?: string; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'enterprise_name'?: string; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'extended_state'?: string; + /** + * ExtraSpecs is an opaque raw json that gets sent to the provider as part of the bootstrap params for instances. It can contain any kind of data needed by providers. The contents of this field means nothing to garm itself. We don\'t act on the information in this field at all. We only validate that it\'s a proper json. + * @type {object} + * @memberof ScaleSet + */ + 'extra_specs'?: object; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'flavor'?: string; + /** + * GithubRunnerGroup is the github runner group in which the runners will be added. The runner group must be created by someone with access to the enterprise. + * @type {string} + * @memberof ScaleSet + */ + 'github-runner-group'?: string; + /** + * + * @type {number} + * @memberof ScaleSet + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'image'?: string; + /** + * + * @type {Array} + * @memberof ScaleSet + */ + 'instances'?: Array; + /** + * + * @type {number} + * @memberof ScaleSet + */ + 'max_runners'?: number; + /** + * + * @type {number} + * @memberof ScaleSet + */ + 'min_idle_runners'?: number; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'org_id'?: string; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'org_name'?: string; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'os_arch'?: string; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'os_type'?: string; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'provider_name'?: string; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'repo_id'?: string; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'repo_name'?: string; + /** + * + * @type {number} + * @memberof ScaleSet + */ + 'runner_bootstrap_timeout'?: number; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'runner_prefix'?: string; + /** + * + * @type {number} + * @memberof ScaleSet + */ + 'scale_set_id'?: number; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'state'?: string; + /** + * + * @type {Array} + * @memberof ScaleSet + */ + 'status_messages'?: Array; + /** + * + * @type {string} + * @memberof ScaleSet + */ + 'updated_at'?: string; +} +/** + * + * @export + * @interface StatusMessage + */ +export interface StatusMessage { + /** + * + * @type {string} + * @memberof StatusMessage + */ + 'created_at'?: string; + /** + * + * @type {string} + * @memberof StatusMessage + */ + 'event_level'?: string; + /** + * + * @type {string} + * @memberof StatusMessage + */ + 'event_type'?: string; + /** + * + * @type {string} + * @memberof StatusMessage + */ + 'message'?: string; +} +/** + * + * @export + * @interface Tag + */ +export interface Tag { + /** + * + * @type {string} + * @memberof Tag + */ + 'id'?: string; + /** + * + * @type {string} + * @memberof Tag + */ + 'name'?: string; +} +/** + * + * @export + * @interface UpdateControllerParams + */ +export interface UpdateControllerParams { + /** + * + * @type {string} + * @memberof UpdateControllerParams + */ + 'callback_url'?: string; + /** + * + * @type {string} + * @memberof UpdateControllerParams + */ + 'metadata_url'?: string; + /** + * + * @type {number} + * @memberof UpdateControllerParams + */ + 'minimum_job_age_backoff'?: number; + /** + * + * @type {string} + * @memberof UpdateControllerParams + */ + 'webhook_url'?: string; +} +/** + * + * @export + * @interface UpdateEntityParams + */ +export interface UpdateEntityParams { + /** + * + * @type {string} + * @memberof UpdateEntityParams + */ + 'credentials_name'?: string; + /** + * + * @type {string} + * @memberof UpdateEntityParams + */ + 'pool_balancer_type'?: string; + /** + * + * @type {string} + * @memberof UpdateEntityParams + */ + 'webhook_secret'?: string; +} +/** + * + * @export + * @interface UpdateGiteaCredentialsParams + */ +export interface UpdateGiteaCredentialsParams { + /** + * + * @type {string} + * @memberof UpdateGiteaCredentialsParams + */ + 'description'?: string; + /** + * + * @type {string} + * @memberof UpdateGiteaCredentialsParams + */ + 'name'?: string; + /** + * + * @type {GithubPAT} + * @memberof UpdateGiteaCredentialsParams + */ + 'pat'?: GithubPAT; +} +/** + * + * @export + * @interface UpdateGiteaEndpointParams + */ +export interface UpdateGiteaEndpointParams { + /** + * + * @type {string} + * @memberof UpdateGiteaEndpointParams + */ + 'api_base_url'?: string; + /** + * + * @type {string} + * @memberof UpdateGiteaEndpointParams + */ + 'base_url'?: string; + /** + * + * @type {Array} + * @memberof UpdateGiteaEndpointParams + */ + 'ca_cert_bundle'?: Array; + /** + * + * @type {string} + * @memberof UpdateGiteaEndpointParams + */ + 'description'?: string; +} +/** + * + * @export + * @interface UpdateGithubCredentialsParams + */ +export interface UpdateGithubCredentialsParams { + /** + * + * @type {GithubApp} + * @memberof UpdateGithubCredentialsParams + */ + 'app'?: GithubApp; + /** + * + * @type {string} + * @memberof UpdateGithubCredentialsParams + */ + 'description'?: string; + /** + * + * @type {string} + * @memberof UpdateGithubCredentialsParams + */ + 'name'?: string; + /** + * + * @type {GithubPAT} + * @memberof UpdateGithubCredentialsParams + */ + 'pat'?: GithubPAT; +} +/** + * + * @export + * @interface UpdateGithubEndpointParams + */ +export interface UpdateGithubEndpointParams { + /** + * + * @type {string} + * @memberof UpdateGithubEndpointParams + */ + 'api_base_url'?: string; + /** + * + * @type {string} + * @memberof UpdateGithubEndpointParams + */ + 'base_url'?: string; + /** + * + * @type {Array} + * @memberof UpdateGithubEndpointParams + */ + 'ca_cert_bundle'?: Array; + /** + * + * @type {string} + * @memberof UpdateGithubEndpointParams + */ + 'description'?: string; + /** + * + * @type {string} + * @memberof UpdateGithubEndpointParams + */ + 'upload_base_url'?: string; +} +/** + * + * @export + * @interface UpdatePoolParams + */ +export interface UpdatePoolParams { + /** + * + * @type {boolean} + * @memberof UpdatePoolParams + */ + 'enabled'?: boolean; + /** + * + * @type {object} + * @memberof UpdatePoolParams + */ + 'extra_specs'?: object; + /** + * + * @type {string} + * @memberof UpdatePoolParams + */ + 'flavor'?: string; + /** + * GithubRunnerGroup is the github runner group in which the runners of this pool will be added to. The runner group must be created by someone with access to the enterprise. + * @type {string} + * @memberof UpdatePoolParams + */ + 'github-runner-group'?: string; + /** + * + * @type {string} + * @memberof UpdatePoolParams + */ + 'image'?: string; + /** + * + * @type {number} + * @memberof UpdatePoolParams + */ + 'max_runners'?: number; + /** + * + * @type {number} + * @memberof UpdatePoolParams + */ + 'min_idle_runners'?: number; + /** + * + * @type {string} + * @memberof UpdatePoolParams + */ + 'os_arch'?: string; + /** + * + * @type {string} + * @memberof UpdatePoolParams + */ + 'os_type'?: string; + /** + * + * @type {number} + * @memberof UpdatePoolParams + */ + 'priority'?: number; + /** + * + * @type {number} + * @memberof UpdatePoolParams + */ + 'runner_bootstrap_timeout'?: number; + /** + * + * @type {string} + * @memberof UpdatePoolParams + */ + 'runner_prefix'?: string; + /** + * + * @type {Array} + * @memberof UpdatePoolParams + */ + 'tags'?: Array; +} +/** + * + * @export + * @interface UpdateScaleSetParams + */ +export interface UpdateScaleSetParams { + /** + * + * @type {boolean} + * @memberof UpdateScaleSetParams + */ + 'enabled'?: boolean; + /** + * + * @type {string} + * @memberof UpdateScaleSetParams + */ + 'extended_state'?: string; + /** + * + * @type {object} + * @memberof UpdateScaleSetParams + */ + 'extra_specs'?: object; + /** + * + * @type {string} + * @memberof UpdateScaleSetParams + */ + 'flavor'?: string; + /** + * + * @type {string} + * @memberof UpdateScaleSetParams + */ + 'image'?: string; + /** + * + * @type {number} + * @memberof UpdateScaleSetParams + */ + 'max_runners'?: number; + /** + * + * @type {number} + * @memberof UpdateScaleSetParams + */ + 'min_idle_runners'?: number; + /** + * + * @type {string} + * @memberof UpdateScaleSetParams + */ + 'name'?: string; + /** + * + * @type {string} + * @memberof UpdateScaleSetParams + */ + 'os_arch'?: string; + /** + * + * @type {string} + * @memberof UpdateScaleSetParams + */ + 'os_type'?: string; + /** + * + * @type {number} + * @memberof UpdateScaleSetParams + */ + 'runner_bootstrap_timeout'?: number; + /** + * GithubRunnerGroup is the github runner group in which the runners of this pool will be added to. The runner group must be created by someone with access to the enterprise. + * @type {string} + * @memberof UpdateScaleSetParams + */ + 'runner_group'?: string; + /** + * + * @type {string} + * @memberof UpdateScaleSetParams + */ + 'runner_prefix'?: string; + /** + * + * @type {string} + * @memberof UpdateScaleSetParams + */ + 'state'?: string; +} +/** + * Users holds information about a particular user + * @export + * @interface User + */ +export interface User { + /** + * + * @type {string} + * @memberof User + */ + 'created_at'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'email'?: string; + /** + * + * @type {boolean} + * @memberof User + */ + 'enabled'?: boolean; + /** + * + * @type {string} + * @memberof User + */ + 'full_name'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'id'?: string; + /** + * + * @type {boolean} + * @memberof User + */ + 'is_admin'?: boolean; + /** + * + * @type {string} + * @memberof User + */ + 'updated_at'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'username'?: string; +} + +/** + * ControllerApi - axios parameter creator + * @export + */ +export const ControllerApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Update controller. + * @param {UpdateControllerParams} body Parameters used when updating the controller. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateController: async (body: UpdateControllerParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('updateController', 'body', body) + const localVarPath = `/controller`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * ControllerApi - functional programming interface + * @export + */ +export const ControllerApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ControllerApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Update controller. + * @param {UpdateControllerParams} body Parameters used when updating the controller. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateController(body: UpdateControllerParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateController(body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ControllerApi.updateController']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * ControllerApi - factory interface + * @export + */ +export const ControllerApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ControllerApiFp(configuration) + return { + /** + * + * @summary Update controller. + * @param {UpdateControllerParams} body Parameters used when updating the controller. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateController(body: UpdateControllerParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateController(body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * ControllerApi - object-oriented interface + * @export + * @class ControllerApi + * @extends {BaseAPI} + */ +export class ControllerApi extends BaseAPI { + /** + * + * @summary Update controller. + * @param {UpdateControllerParams} body Parameters used when updating the controller. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ControllerApi + */ + public updateController(body: UpdateControllerParams, options?: RawAxiosRequestConfig) { + return ControllerApiFp(this.configuration).updateController(body, options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * ControllerInfoApi - axios parameter creator + * @export + */ +export const ControllerInfoApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Get controller info. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + controllerInfo: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/controller-info`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * ControllerInfoApi - functional programming interface + * @export + */ +export const ControllerInfoApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ControllerInfoApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Get controller info. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async controllerInfo(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.controllerInfo(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ControllerInfoApi.controllerInfo']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * ControllerInfoApi - factory interface + * @export + */ +export const ControllerInfoApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ControllerInfoApiFp(configuration) + return { + /** + * + * @summary Get controller info. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + controllerInfo(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.controllerInfo(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * ControllerInfoApi - object-oriented interface + * @export + * @class ControllerInfoApi + * @extends {BaseAPI} + */ +export class ControllerInfoApi extends BaseAPI { + /** + * + * @summary Get controller info. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ControllerInfoApi + */ + public controllerInfo(options?: RawAxiosRequestConfig) { + return ControllerInfoApiFp(this.configuration).controllerInfo(options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * CredentialsApi - axios parameter creator + * @export + */ +export const CredentialsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Create a GitHub credential. + * @param {CreateGithubCredentialsParams} body Parameters used when creating a GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createCredentials: async (body: CreateGithubCredentialsParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createCredentials', 'body', body) + const localVarPath = `/github/credentials`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Create a Gitea credential. + * @param {CreateGiteaCredentialsParams} body Parameters used when creating a Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGiteaCredentials: async (body: CreateGiteaCredentialsParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createGiteaCredentials', 'body', body) + const localVarPath = `/gitea/credentials`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete a GitHub credential. + * @param {number} id ID of the GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteCredentials: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('deleteCredentials', 'id', id) + const localVarPath = `/github/credentials/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete a Gitea credential. + * @param {number} id ID of the Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGiteaCredentials: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('deleteGiteaCredentials', 'id', id) + const localVarPath = `/gitea/credentials/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get a GitHub credential. + * @param {number} id ID of the GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getCredentials: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getCredentials', 'id', id) + const localVarPath = `/github/credentials/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get a Gitea credential. + * @param {number} id ID of the Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getGiteaCredentials: async (id: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('getGiteaCredentials', 'id', id) + const localVarPath = `/gitea/credentials/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List all credentials. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listCredentials: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/github/credentials`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List all credentials. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listGiteaCredentials: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/gitea/credentials`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update a GitHub credential. + * @param {number} id ID of the GitHub credential. + * @param {UpdateGithubCredentialsParams} body Parameters used when updating a GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateCredentials: async (id: number, body: UpdateGithubCredentialsParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('updateCredentials', 'id', id) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateCredentials', 'body', body) + const localVarPath = `/github/credentials/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update a Gitea credential. + * @param {number} id ID of the Gitea credential. + * @param {UpdateGiteaCredentialsParams} body Parameters used when updating a Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateGiteaCredentials: async (id: number, body: UpdateGiteaCredentialsParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'id' is not null or undefined + assertParamExists('updateGiteaCredentials', 'id', id) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateGiteaCredentials', 'body', body) + const localVarPath = `/gitea/credentials/{id}` + .replace(`{${"id"}}`, encodeURIComponent(String(id))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * CredentialsApi - functional programming interface + * @export + */ +export const CredentialsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = CredentialsApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Create a GitHub credential. + * @param {CreateGithubCredentialsParams} body Parameters used when creating a GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createCredentials(body: CreateGithubCredentialsParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createCredentials(body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CredentialsApi.createCredentials']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Create a Gitea credential. + * @param {CreateGiteaCredentialsParams} body Parameters used when creating a Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createGiteaCredentials(body: CreateGiteaCredentialsParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createGiteaCredentials(body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CredentialsApi.createGiteaCredentials']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete a GitHub credential. + * @param {number} id ID of the GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteCredentials(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteCredentials(id, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CredentialsApi.deleteCredentials']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete a Gitea credential. + * @param {number} id ID of the Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteGiteaCredentials(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteGiteaCredentials(id, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CredentialsApi.deleteGiteaCredentials']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get a GitHub credential. + * @param {number} id ID of the GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getCredentials(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getCredentials(id, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CredentialsApi.getCredentials']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get a Gitea credential. + * @param {number} id ID of the Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getGiteaCredentials(id: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getGiteaCredentials(id, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CredentialsApi.getGiteaCredentials']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List all credentials. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listCredentials(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listCredentials(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CredentialsApi.listCredentials']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List all credentials. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listGiteaCredentials(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listGiteaCredentials(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CredentialsApi.listGiteaCredentials']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update a GitHub credential. + * @param {number} id ID of the GitHub credential. + * @param {UpdateGithubCredentialsParams} body Parameters used when updating a GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateCredentials(id: number, body: UpdateGithubCredentialsParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateCredentials(id, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CredentialsApi.updateCredentials']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update a Gitea credential. + * @param {number} id ID of the Gitea credential. + * @param {UpdateGiteaCredentialsParams} body Parameters used when updating a Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateGiteaCredentials(id: number, body: UpdateGiteaCredentialsParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateGiteaCredentials(id, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['CredentialsApi.updateGiteaCredentials']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * CredentialsApi - factory interface + * @export + */ +export const CredentialsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = CredentialsApiFp(configuration) + return { + /** + * + * @summary Create a GitHub credential. + * @param {CreateGithubCredentialsParams} body Parameters used when creating a GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createCredentials(body: CreateGithubCredentialsParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createCredentials(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Create a Gitea credential. + * @param {CreateGiteaCredentialsParams} body Parameters used when creating a Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGiteaCredentials(body: CreateGiteaCredentialsParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createGiteaCredentials(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete a GitHub credential. + * @param {number} id ID of the GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteCredentials(id: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteCredentials(id, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete a Gitea credential. + * @param {number} id ID of the Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGiteaCredentials(id: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteGiteaCredentials(id, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get a GitHub credential. + * @param {number} id ID of the GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getCredentials(id: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getCredentials(id, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get a Gitea credential. + * @param {number} id ID of the Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getGiteaCredentials(id: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getGiteaCredentials(id, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List all credentials. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listCredentials(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listCredentials(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List all credentials. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listGiteaCredentials(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listGiteaCredentials(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update a GitHub credential. + * @param {number} id ID of the GitHub credential. + * @param {UpdateGithubCredentialsParams} body Parameters used when updating a GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateCredentials(id: number, body: UpdateGithubCredentialsParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateCredentials(id, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update a Gitea credential. + * @param {number} id ID of the Gitea credential. + * @param {UpdateGiteaCredentialsParams} body Parameters used when updating a Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateGiteaCredentials(id: number, body: UpdateGiteaCredentialsParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateGiteaCredentials(id, body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * CredentialsApi - object-oriented interface + * @export + * @class CredentialsApi + * @extends {BaseAPI} + */ +export class CredentialsApi extends BaseAPI { + /** + * + * @summary Create a GitHub credential. + * @param {CreateGithubCredentialsParams} body Parameters used when creating a GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CredentialsApi + */ + public createCredentials(body: CreateGithubCredentialsParams, options?: RawAxiosRequestConfig) { + return CredentialsApiFp(this.configuration).createCredentials(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Create a Gitea credential. + * @param {CreateGiteaCredentialsParams} body Parameters used when creating a Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CredentialsApi + */ + public createGiteaCredentials(body: CreateGiteaCredentialsParams, options?: RawAxiosRequestConfig) { + return CredentialsApiFp(this.configuration).createGiteaCredentials(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete a GitHub credential. + * @param {number} id ID of the GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CredentialsApi + */ + public deleteCredentials(id: number, options?: RawAxiosRequestConfig) { + return CredentialsApiFp(this.configuration).deleteCredentials(id, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete a Gitea credential. + * @param {number} id ID of the Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CredentialsApi + */ + public deleteGiteaCredentials(id: number, options?: RawAxiosRequestConfig) { + return CredentialsApiFp(this.configuration).deleteGiteaCredentials(id, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get a GitHub credential. + * @param {number} id ID of the GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CredentialsApi + */ + public getCredentials(id: number, options?: RawAxiosRequestConfig) { + return CredentialsApiFp(this.configuration).getCredentials(id, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get a Gitea credential. + * @param {number} id ID of the Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CredentialsApi + */ + public getGiteaCredentials(id: number, options?: RawAxiosRequestConfig) { + return CredentialsApiFp(this.configuration).getGiteaCredentials(id, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List all credentials. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CredentialsApi + */ + public listCredentials(options?: RawAxiosRequestConfig) { + return CredentialsApiFp(this.configuration).listCredentials(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List all credentials. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CredentialsApi + */ + public listGiteaCredentials(options?: RawAxiosRequestConfig) { + return CredentialsApiFp(this.configuration).listGiteaCredentials(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update a GitHub credential. + * @param {number} id ID of the GitHub credential. + * @param {UpdateGithubCredentialsParams} body Parameters used when updating a GitHub credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CredentialsApi + */ + public updateCredentials(id: number, body: UpdateGithubCredentialsParams, options?: RawAxiosRequestConfig) { + return CredentialsApiFp(this.configuration).updateCredentials(id, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update a Gitea credential. + * @param {number} id ID of the Gitea credential. + * @param {UpdateGiteaCredentialsParams} body Parameters used when updating a Gitea credential. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof CredentialsApi + */ + public updateGiteaCredentials(id: number, body: UpdateGiteaCredentialsParams, options?: RawAxiosRequestConfig) { + return CredentialsApiFp(this.configuration).updateGiteaCredentials(id, body, options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * EndpointsApi - axios parameter creator + * @export + */ +export const EndpointsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Create a Gitea Endpoint. + * @param {CreateGiteaEndpointParams} body Parameters used when creating a Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGiteaEndpoint: async (body: CreateGiteaEndpointParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createGiteaEndpoint', 'body', body) + const localVarPath = `/gitea/endpoints`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Create a GitHub Endpoint. + * @param {CreateGithubEndpointParams} body Parameters used when creating a GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGithubEndpoint: async (body: CreateGithubEndpointParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createGithubEndpoint', 'body', body) + const localVarPath = `/github/endpoints`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete a Gitea Endpoint. + * @param {string} name The name of the Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGiteaEndpoint: async (name: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('deleteGiteaEndpoint', 'name', name) + const localVarPath = `/gitea/endpoints/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete a GitHub Endpoint. + * @param {string} name The name of the GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGithubEndpoint: async (name: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('deleteGithubEndpoint', 'name', name) + const localVarPath = `/github/endpoints/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get a Gitea Endpoint. + * @param {string} name The name of the Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getGiteaEndpoint: async (name: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('getGiteaEndpoint', 'name', name) + const localVarPath = `/gitea/endpoints/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get a GitHub Endpoint. + * @param {string} name The name of the GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getGithubEndpoint: async (name: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('getGithubEndpoint', 'name', name) + const localVarPath = `/github/endpoints/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List all Gitea Endpoints. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listGiteaEndpoints: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/gitea/endpoints`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List all GitHub Endpoints. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listGithubEndpoints: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/github/endpoints`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update a Gitea Endpoint. + * @param {string} name The name of the Gitea endpoint. + * @param {UpdateGiteaEndpointParams} body Parameters used when updating a Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateGiteaEndpoint: async (name: string, body: UpdateGiteaEndpointParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('updateGiteaEndpoint', 'name', name) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateGiteaEndpoint', 'body', body) + const localVarPath = `/gitea/endpoints/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update a GitHub Endpoint. + * @param {string} name The name of the GitHub endpoint. + * @param {UpdateGithubEndpointParams} body Parameters used when updating a GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateGithubEndpoint: async (name: string, body: UpdateGithubEndpointParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'name' is not null or undefined + assertParamExists('updateGithubEndpoint', 'name', name) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateGithubEndpoint', 'body', body) + const localVarPath = `/github/endpoints/{name}` + .replace(`{${"name"}}`, encodeURIComponent(String(name))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * EndpointsApi - functional programming interface + * @export + */ +export const EndpointsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = EndpointsApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Create a Gitea Endpoint. + * @param {CreateGiteaEndpointParams} body Parameters used when creating a Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createGiteaEndpoint(body: CreateGiteaEndpointParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createGiteaEndpoint(body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EndpointsApi.createGiteaEndpoint']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Create a GitHub Endpoint. + * @param {CreateGithubEndpointParams} body Parameters used when creating a GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createGithubEndpoint(body: CreateGithubEndpointParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createGithubEndpoint(body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EndpointsApi.createGithubEndpoint']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete a Gitea Endpoint. + * @param {string} name The name of the Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteGiteaEndpoint(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteGiteaEndpoint(name, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EndpointsApi.deleteGiteaEndpoint']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete a GitHub Endpoint. + * @param {string} name The name of the GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteGithubEndpoint(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteGithubEndpoint(name, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EndpointsApi.deleteGithubEndpoint']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get a Gitea Endpoint. + * @param {string} name The name of the Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getGiteaEndpoint(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getGiteaEndpoint(name, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EndpointsApi.getGiteaEndpoint']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get a GitHub Endpoint. + * @param {string} name The name of the GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getGithubEndpoint(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getGithubEndpoint(name, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EndpointsApi.getGithubEndpoint']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List all Gitea Endpoints. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listGiteaEndpoints(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listGiteaEndpoints(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EndpointsApi.listGiteaEndpoints']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List all GitHub Endpoints. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listGithubEndpoints(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listGithubEndpoints(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EndpointsApi.listGithubEndpoints']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update a Gitea Endpoint. + * @param {string} name The name of the Gitea endpoint. + * @param {UpdateGiteaEndpointParams} body Parameters used when updating a Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateGiteaEndpoint(name: string, body: UpdateGiteaEndpointParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateGiteaEndpoint(name, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EndpointsApi.updateGiteaEndpoint']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update a GitHub Endpoint. + * @param {string} name The name of the GitHub endpoint. + * @param {UpdateGithubEndpointParams} body Parameters used when updating a GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateGithubEndpoint(name: string, body: UpdateGithubEndpointParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateGithubEndpoint(name, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EndpointsApi.updateGithubEndpoint']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * EndpointsApi - factory interface + * @export + */ +export const EndpointsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = EndpointsApiFp(configuration) + return { + /** + * + * @summary Create a Gitea Endpoint. + * @param {CreateGiteaEndpointParams} body Parameters used when creating a Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGiteaEndpoint(body: CreateGiteaEndpointParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createGiteaEndpoint(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Create a GitHub Endpoint. + * @param {CreateGithubEndpointParams} body Parameters used when creating a GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createGithubEndpoint(body: CreateGithubEndpointParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createGithubEndpoint(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete a Gitea Endpoint. + * @param {string} name The name of the Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGiteaEndpoint(name: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteGiteaEndpoint(name, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete a GitHub Endpoint. + * @param {string} name The name of the GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteGithubEndpoint(name: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteGithubEndpoint(name, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get a Gitea Endpoint. + * @param {string} name The name of the Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getGiteaEndpoint(name: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getGiteaEndpoint(name, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get a GitHub Endpoint. + * @param {string} name The name of the GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getGithubEndpoint(name: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getGithubEndpoint(name, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List all Gitea Endpoints. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listGiteaEndpoints(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listGiteaEndpoints(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List all GitHub Endpoints. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listGithubEndpoints(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listGithubEndpoints(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update a Gitea Endpoint. + * @param {string} name The name of the Gitea endpoint. + * @param {UpdateGiteaEndpointParams} body Parameters used when updating a Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateGiteaEndpoint(name: string, body: UpdateGiteaEndpointParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateGiteaEndpoint(name, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update a GitHub Endpoint. + * @param {string} name The name of the GitHub endpoint. + * @param {UpdateGithubEndpointParams} body Parameters used when updating a GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateGithubEndpoint(name: string, body: UpdateGithubEndpointParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateGithubEndpoint(name, body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * EndpointsApi - object-oriented interface + * @export + * @class EndpointsApi + * @extends {BaseAPI} + */ +export class EndpointsApi extends BaseAPI { + /** + * + * @summary Create a Gitea Endpoint. + * @param {CreateGiteaEndpointParams} body Parameters used when creating a Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EndpointsApi + */ + public createGiteaEndpoint(body: CreateGiteaEndpointParams, options?: RawAxiosRequestConfig) { + return EndpointsApiFp(this.configuration).createGiteaEndpoint(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Create a GitHub Endpoint. + * @param {CreateGithubEndpointParams} body Parameters used when creating a GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EndpointsApi + */ + public createGithubEndpoint(body: CreateGithubEndpointParams, options?: RawAxiosRequestConfig) { + return EndpointsApiFp(this.configuration).createGithubEndpoint(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete a Gitea Endpoint. + * @param {string} name The name of the Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EndpointsApi + */ + public deleteGiteaEndpoint(name: string, options?: RawAxiosRequestConfig) { + return EndpointsApiFp(this.configuration).deleteGiteaEndpoint(name, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete a GitHub Endpoint. + * @param {string} name The name of the GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EndpointsApi + */ + public deleteGithubEndpoint(name: string, options?: RawAxiosRequestConfig) { + return EndpointsApiFp(this.configuration).deleteGithubEndpoint(name, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get a Gitea Endpoint. + * @param {string} name The name of the Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EndpointsApi + */ + public getGiteaEndpoint(name: string, options?: RawAxiosRequestConfig) { + return EndpointsApiFp(this.configuration).getGiteaEndpoint(name, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get a GitHub Endpoint. + * @param {string} name The name of the GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EndpointsApi + */ + public getGithubEndpoint(name: string, options?: RawAxiosRequestConfig) { + return EndpointsApiFp(this.configuration).getGithubEndpoint(name, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List all Gitea Endpoints. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EndpointsApi + */ + public listGiteaEndpoints(options?: RawAxiosRequestConfig) { + return EndpointsApiFp(this.configuration).listGiteaEndpoints(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List all GitHub Endpoints. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EndpointsApi + */ + public listGithubEndpoints(options?: RawAxiosRequestConfig) { + return EndpointsApiFp(this.configuration).listGithubEndpoints(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update a Gitea Endpoint. + * @param {string} name The name of the Gitea endpoint. + * @param {UpdateGiteaEndpointParams} body Parameters used when updating a Gitea endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EndpointsApi + */ + public updateGiteaEndpoint(name: string, body: UpdateGiteaEndpointParams, options?: RawAxiosRequestConfig) { + return EndpointsApiFp(this.configuration).updateGiteaEndpoint(name, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update a GitHub Endpoint. + * @param {string} name The name of the GitHub endpoint. + * @param {UpdateGithubEndpointParams} body Parameters used when updating a GitHub endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EndpointsApi + */ + public updateGithubEndpoint(name: string, body: UpdateGithubEndpointParams, options?: RawAxiosRequestConfig) { + return EndpointsApiFp(this.configuration).updateGithubEndpoint(name, body, options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * EnterprisesApi - axios parameter creator + * @export + */ +export const EnterprisesApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Create enterprise with the given parameters. + * @param {CreateEnterpriseParams} body Parameters used to create the enterprise. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createEnterprise: async (body: CreateEnterpriseParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createEnterprise', 'body', body) + const localVarPath = `/enterprises`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreatePoolParams} body Parameters used when creating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createEnterprisePool: async (enterpriseID: string, body: CreatePoolParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('createEnterprisePool', 'enterpriseID', enterpriseID) + // verify required parameter 'body' is not null or undefined + assertParamExists('createEnterprisePool', 'body', body) + const localVarPath = `/enterprises/{enterpriseID}/pools` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreateScaleSetParams} body Parameters used when creating the enterprise scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createEnterpriseScaleSet: async (enterpriseID: string, body: CreateScaleSetParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('createEnterpriseScaleSet', 'enterpriseID', enterpriseID) + // verify required parameter 'body' is not null or undefined + assertParamExists('createEnterpriseScaleSet', 'body', body) + const localVarPath = `/enterprises/{enterpriseID}/scalesets` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete enterprise by ID. + * @param {string} enterpriseID ID of the enterprise to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteEnterprise: async (enterpriseID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('deleteEnterprise', 'enterpriseID', enterpriseID) + const localVarPath = `/enterprises/{enterpriseID}` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteEnterprisePool: async (enterpriseID: string, poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('deleteEnterprisePool', 'enterpriseID', enterpriseID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('deleteEnterprisePool', 'poolID', poolID) + const localVarPath = `/enterprises/{enterpriseID}/pools/{poolID}` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get enterprise by ID. + * @param {string} enterpriseID The ID of the enterprise to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getEnterprise: async (enterpriseID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('getEnterprise', 'enterpriseID', enterpriseID) + const localVarPath = `/enterprises/{enterpriseID}` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getEnterprisePool: async (enterpriseID: string, poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('getEnterprisePool', 'enterpriseID', enterpriseID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('getEnterprisePool', 'poolID', poolID) + const localVarPath = `/enterprises/{enterpriseID}/pools/{poolID}` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List enterprise instances. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterpriseInstances: async (enterpriseID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('listEnterpriseInstances', 'enterpriseID', enterpriseID) + const localVarPath = `/enterprises/{enterpriseID}/instances` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List enterprise pools. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterprisePools: async (enterpriseID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('listEnterprisePools', 'enterpriseID', enterpriseID) + const localVarPath = `/enterprises/{enterpriseID}/pools` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List enterprise scale sets. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterpriseScaleSets: async (enterpriseID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('listEnterpriseScaleSets', 'enterpriseID', enterpriseID) + const localVarPath = `/enterprises/{enterpriseID}/scalesets` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List all enterprises. + * @param {string} [name] Exact enterprise name to filter by + * @param {string} [endpoint] Exact endpoint name to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterprises: async (name?: string, endpoint?: string, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/enterprises`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + if (name !== undefined) { + localVarQueryParameter['name'] = name; + } + + if (endpoint !== undefined) { + localVarQueryParameter['endpoint'] = endpoint; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update enterprise with the given parameters. + * @param {string} enterpriseID The ID of the enterprise to update. + * @param {UpdateEntityParams} body Parameters used when updating the enterprise. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateEnterprise: async (enterpriseID: string, body: UpdateEntityParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('updateEnterprise', 'enterpriseID', enterpriseID) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateEnterprise', 'body', body) + const localVarPath = `/enterprises/{enterpriseID}` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateEnterprisePool: async (enterpriseID: string, poolID: string, body: UpdatePoolParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('updateEnterprisePool', 'enterpriseID', enterpriseID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('updateEnterprisePool', 'poolID', poolID) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateEnterprisePool', 'body', body) + const localVarPath = `/enterprises/{enterpriseID}/pools/{poolID}` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * EnterprisesApi - functional programming interface + * @export + */ +export const EnterprisesApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = EnterprisesApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Create enterprise with the given parameters. + * @param {CreateEnterpriseParams} body Parameters used to create the enterprise. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createEnterprise(body: CreateEnterpriseParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createEnterprise(body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EnterprisesApi.createEnterprise']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreatePoolParams} body Parameters used when creating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createEnterprisePool(enterpriseID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createEnterprisePool(enterpriseID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EnterprisesApi.createEnterprisePool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreateScaleSetParams} body Parameters used when creating the enterprise scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createEnterpriseScaleSet(enterpriseID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createEnterpriseScaleSet(enterpriseID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EnterprisesApi.createEnterpriseScaleSet']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete enterprise by ID. + * @param {string} enterpriseID ID of the enterprise to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteEnterprise(enterpriseID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteEnterprise(enterpriseID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EnterprisesApi.deleteEnterprise']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteEnterprisePool(enterpriseID: string, poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteEnterprisePool(enterpriseID, poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EnterprisesApi.deleteEnterprisePool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get enterprise by ID. + * @param {string} enterpriseID The ID of the enterprise to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getEnterprise(enterpriseID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getEnterprise(enterpriseID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EnterprisesApi.getEnterprise']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getEnterprisePool(enterpriseID: string, poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getEnterprisePool(enterpriseID, poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EnterprisesApi.getEnterprisePool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List enterprise instances. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listEnterpriseInstances(enterpriseID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listEnterpriseInstances(enterpriseID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EnterprisesApi.listEnterpriseInstances']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List enterprise pools. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listEnterprisePools(enterpriseID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listEnterprisePools(enterpriseID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EnterprisesApi.listEnterprisePools']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List enterprise scale sets. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listEnterpriseScaleSets(enterpriseID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listEnterpriseScaleSets(enterpriseID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EnterprisesApi.listEnterpriseScaleSets']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List all enterprises. + * @param {string} [name] Exact enterprise name to filter by + * @param {string} [endpoint] Exact endpoint name to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listEnterprises(name?: string, endpoint?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listEnterprises(name, endpoint, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EnterprisesApi.listEnterprises']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update enterprise with the given parameters. + * @param {string} enterpriseID The ID of the enterprise to update. + * @param {UpdateEntityParams} body Parameters used when updating the enterprise. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateEnterprise(enterpriseID: string, body: UpdateEntityParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateEnterprise(enterpriseID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EnterprisesApi.updateEnterprise']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateEnterprisePool(enterpriseID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateEnterprisePool(enterpriseID, poolID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['EnterprisesApi.updateEnterprisePool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * EnterprisesApi - factory interface + * @export + */ +export const EnterprisesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = EnterprisesApiFp(configuration) + return { + /** + * + * @summary Create enterprise with the given parameters. + * @param {CreateEnterpriseParams} body Parameters used to create the enterprise. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createEnterprise(body: CreateEnterpriseParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createEnterprise(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreatePoolParams} body Parameters used when creating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createEnterprisePool(enterpriseID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createEnterprisePool(enterpriseID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreateScaleSetParams} body Parameters used when creating the enterprise scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createEnterpriseScaleSet(enterpriseID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createEnterpriseScaleSet(enterpriseID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete enterprise by ID. + * @param {string} enterpriseID ID of the enterprise to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteEnterprise(enterpriseID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteEnterprise(enterpriseID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteEnterprisePool(enterpriseID: string, poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteEnterprisePool(enterpriseID, poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get enterprise by ID. + * @param {string} enterpriseID The ID of the enterprise to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getEnterprise(enterpriseID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getEnterprise(enterpriseID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getEnterprisePool(enterpriseID: string, poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getEnterprisePool(enterpriseID, poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List enterprise instances. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterpriseInstances(enterpriseID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listEnterpriseInstances(enterpriseID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List enterprise pools. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterprisePools(enterpriseID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listEnterprisePools(enterpriseID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List enterprise scale sets. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterpriseScaleSets(enterpriseID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listEnterpriseScaleSets(enterpriseID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List all enterprises. + * @param {string} [name] Exact enterprise name to filter by + * @param {string} [endpoint] Exact endpoint name to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterprises(name?: string, endpoint?: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listEnterprises(name, endpoint, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update enterprise with the given parameters. + * @param {string} enterpriseID The ID of the enterprise to update. + * @param {UpdateEntityParams} body Parameters used when updating the enterprise. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateEnterprise(enterpriseID: string, body: UpdateEntityParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateEnterprise(enterpriseID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateEnterprisePool(enterpriseID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateEnterprisePool(enterpriseID, poolID, body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * EnterprisesApi - object-oriented interface + * @export + * @class EnterprisesApi + * @extends {BaseAPI} + */ +export class EnterprisesApi extends BaseAPI { + /** + * + * @summary Create enterprise with the given parameters. + * @param {CreateEnterpriseParams} body Parameters used to create the enterprise. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterprisesApi + */ + public createEnterprise(body: CreateEnterpriseParams, options?: RawAxiosRequestConfig) { + return EnterprisesApiFp(this.configuration).createEnterprise(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreatePoolParams} body Parameters used when creating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterprisesApi + */ + public createEnterprisePool(enterpriseID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig) { + return EnterprisesApiFp(this.configuration).createEnterprisePool(enterpriseID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreateScaleSetParams} body Parameters used when creating the enterprise scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterprisesApi + */ + public createEnterpriseScaleSet(enterpriseID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig) { + return EnterprisesApiFp(this.configuration).createEnterpriseScaleSet(enterpriseID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete enterprise by ID. + * @param {string} enterpriseID ID of the enterprise to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterprisesApi + */ + public deleteEnterprise(enterpriseID: string, options?: RawAxiosRequestConfig) { + return EnterprisesApiFp(this.configuration).deleteEnterprise(enterpriseID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterprisesApi + */ + public deleteEnterprisePool(enterpriseID: string, poolID: string, options?: RawAxiosRequestConfig) { + return EnterprisesApiFp(this.configuration).deleteEnterprisePool(enterpriseID, poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get enterprise by ID. + * @param {string} enterpriseID The ID of the enterprise to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterprisesApi + */ + public getEnterprise(enterpriseID: string, options?: RawAxiosRequestConfig) { + return EnterprisesApiFp(this.configuration).getEnterprise(enterpriseID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterprisesApi + */ + public getEnterprisePool(enterpriseID: string, poolID: string, options?: RawAxiosRequestConfig) { + return EnterprisesApiFp(this.configuration).getEnterprisePool(enterpriseID, poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List enterprise instances. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterprisesApi + */ + public listEnterpriseInstances(enterpriseID: string, options?: RawAxiosRequestConfig) { + return EnterprisesApiFp(this.configuration).listEnterpriseInstances(enterpriseID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List enterprise pools. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterprisesApi + */ + public listEnterprisePools(enterpriseID: string, options?: RawAxiosRequestConfig) { + return EnterprisesApiFp(this.configuration).listEnterprisePools(enterpriseID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List enterprise scale sets. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterprisesApi + */ + public listEnterpriseScaleSets(enterpriseID: string, options?: RawAxiosRequestConfig) { + return EnterprisesApiFp(this.configuration).listEnterpriseScaleSets(enterpriseID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List all enterprises. + * @param {string} [name] Exact enterprise name to filter by + * @param {string} [endpoint] Exact endpoint name to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterprisesApi + */ + public listEnterprises(name?: string, endpoint?: string, options?: RawAxiosRequestConfig) { + return EnterprisesApiFp(this.configuration).listEnterprises(name, endpoint, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update enterprise with the given parameters. + * @param {string} enterpriseID The ID of the enterprise to update. + * @param {UpdateEntityParams} body Parameters used when updating the enterprise. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterprisesApi + */ + public updateEnterprise(enterpriseID: string, body: UpdateEntityParams, options?: RawAxiosRequestConfig) { + return EnterprisesApiFp(this.configuration).updateEnterprise(enterpriseID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof EnterprisesApi + */ + public updateEnterprisePool(enterpriseID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig) { + return EnterprisesApiFp(this.configuration).updateEnterprisePool(enterpriseID, poolID, body, options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * FirstRunApi - axios parameter creator + * @export + */ +export const FirstRunApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Initialize the first run of the controller. + * @param {NewUserParams} body Create a new user. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + firstRun: async (body: NewUserParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('firstRun', 'body', body) + const localVarPath = `/first-run`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * FirstRunApi - functional programming interface + * @export + */ +export const FirstRunApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = FirstRunApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Initialize the first run of the controller. + * @param {NewUserParams} body Create a new user. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async firstRun(body: NewUserParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.firstRun(body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['FirstRunApi.firstRun']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * FirstRunApi - factory interface + * @export + */ +export const FirstRunApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = FirstRunApiFp(configuration) + return { + /** + * + * @summary Initialize the first run of the controller. + * @param {NewUserParams} body Create a new user. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + firstRun(body: NewUserParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.firstRun(body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * FirstRunApi - object-oriented interface + * @export + * @class FirstRunApi + * @extends {BaseAPI} + */ +export class FirstRunApi extends BaseAPI { + /** + * + * @summary Initialize the first run of the controller. + * @param {NewUserParams} body Create a new user. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof FirstRunApi + */ + public firstRun(body: NewUserParams, options?: RawAxiosRequestConfig) { + return FirstRunApiFp(this.configuration).firstRun(body, options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * HooksApi - axios parameter creator + * @export + */ +export const HooksApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Get information about the GARM installed webhook on an organization. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrgWebhookInfo: async (orgID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('getOrgWebhookInfo', 'orgID', orgID) + const localVarPath = `/organizations/{orgID}/webhook` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get information about the GARM installed webhook on a repository. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRepoWebhookInfo: async (repoID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('getRepoWebhookInfo', 'repoID', repoID) + const localVarPath = `/repositories/{repoID}/webhook` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} orgID Organization ID. + * @param {InstallWebhookParams} body Parameters used when creating the organization webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + installOrgWebhook: async (orgID: string, body: InstallWebhookParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('installOrgWebhook', 'orgID', orgID) + // verify required parameter 'body' is not null or undefined + assertParamExists('installOrgWebhook', 'body', body) + const localVarPath = `/organizations/{orgID}/webhook` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} repoID Repository ID. + * @param {InstallWebhookParams} body Parameters used when creating the repository webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + installRepoWebhook: async (repoID: string, body: InstallWebhookParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('installRepoWebhook', 'repoID', repoID) + // verify required parameter 'body' is not null or undefined + assertParamExists('installRepoWebhook', 'body', body) + const localVarPath = `/repositories/{repoID}/webhook` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Uninstall organization webhook. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uninstallOrgWebhook: async (orgID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('uninstallOrgWebhook', 'orgID', orgID) + const localVarPath = `/organizations/{orgID}/webhook` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Uninstall organization webhook. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uninstallRepoWebhook: async (repoID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('uninstallRepoWebhook', 'repoID', repoID) + const localVarPath = `/repositories/{repoID}/webhook` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * HooksApi - functional programming interface + * @export + */ +export const HooksApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = HooksApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Get information about the GARM installed webhook on an organization. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getOrgWebhookInfo(orgID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrgWebhookInfo(orgID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['HooksApi.getOrgWebhookInfo']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get information about the GARM installed webhook on a repository. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRepoWebhookInfo(repoID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRepoWebhookInfo(repoID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['HooksApi.getRepoWebhookInfo']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} orgID Organization ID. + * @param {InstallWebhookParams} body Parameters used when creating the organization webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async installOrgWebhook(orgID: string, body: InstallWebhookParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.installOrgWebhook(orgID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['HooksApi.installOrgWebhook']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} repoID Repository ID. + * @param {InstallWebhookParams} body Parameters used when creating the repository webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async installRepoWebhook(repoID: string, body: InstallWebhookParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.installRepoWebhook(repoID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['HooksApi.installRepoWebhook']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Uninstall organization webhook. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async uninstallOrgWebhook(orgID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.uninstallOrgWebhook(orgID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['HooksApi.uninstallOrgWebhook']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Uninstall organization webhook. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async uninstallRepoWebhook(repoID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.uninstallRepoWebhook(repoID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['HooksApi.uninstallRepoWebhook']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * HooksApi - factory interface + * @export + */ +export const HooksApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = HooksApiFp(configuration) + return { + /** + * + * @summary Get information about the GARM installed webhook on an organization. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrgWebhookInfo(orgID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getOrgWebhookInfo(orgID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get information about the GARM installed webhook on a repository. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRepoWebhookInfo(repoID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getRepoWebhookInfo(repoID, options).then((request) => request(axios, basePath)); + }, + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} orgID Organization ID. + * @param {InstallWebhookParams} body Parameters used when creating the organization webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + installOrgWebhook(orgID: string, body: InstallWebhookParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.installOrgWebhook(orgID, body, options).then((request) => request(axios, basePath)); + }, + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} repoID Repository ID. + * @param {InstallWebhookParams} body Parameters used when creating the repository webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + installRepoWebhook(repoID: string, body: InstallWebhookParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.installRepoWebhook(repoID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Uninstall organization webhook. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uninstallOrgWebhook(orgID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.uninstallOrgWebhook(orgID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Uninstall organization webhook. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uninstallRepoWebhook(repoID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.uninstallRepoWebhook(repoID, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * HooksApi - object-oriented interface + * @export + * @class HooksApi + * @extends {BaseAPI} + */ +export class HooksApi extends BaseAPI { + /** + * + * @summary Get information about the GARM installed webhook on an organization. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof HooksApi + */ + public getOrgWebhookInfo(orgID: string, options?: RawAxiosRequestConfig) { + return HooksApiFp(this.configuration).getOrgWebhookInfo(orgID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get information about the GARM installed webhook on a repository. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof HooksApi + */ + public getRepoWebhookInfo(repoID: string, options?: RawAxiosRequestConfig) { + return HooksApiFp(this.configuration).getRepoWebhookInfo(repoID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} orgID Organization ID. + * @param {InstallWebhookParams} body Parameters used when creating the organization webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof HooksApi + */ + public installOrgWebhook(orgID: string, body: InstallWebhookParams, options?: RawAxiosRequestConfig) { + return HooksApiFp(this.configuration).installOrgWebhook(orgID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} repoID Repository ID. + * @param {InstallWebhookParams} body Parameters used when creating the repository webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof HooksApi + */ + public installRepoWebhook(repoID: string, body: InstallWebhookParams, options?: RawAxiosRequestConfig) { + return HooksApiFp(this.configuration).installRepoWebhook(repoID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Uninstall organization webhook. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof HooksApi + */ + public uninstallOrgWebhook(orgID: string, options?: RawAxiosRequestConfig) { + return HooksApiFp(this.configuration).uninstallOrgWebhook(orgID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Uninstall organization webhook. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof HooksApi + */ + public uninstallRepoWebhook(repoID: string, options?: RawAxiosRequestConfig) { + return HooksApiFp(this.configuration).uninstallRepoWebhook(repoID, options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * InstancesApi - axios parameter creator + * @export + */ +export const InstancesApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Delete runner instance by name. + * @param {string} instanceName Runner instance name. + * @param {boolean} [forceRemove] If true GARM will ignore any provider error when removing the runner and will continue to remove the runner from github and the GARM database. + * @param {boolean} [bypassGHUnauthorized] If true GARM will ignore unauthorized errors returned by GitHub when removing a runner. This is useful if you want to clean up runners and your credentials have expired. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteInstance: async (instanceName: string, forceRemove?: boolean, bypassGHUnauthorized?: boolean, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'instanceName' is not null or undefined + assertParamExists('deleteInstance', 'instanceName', instanceName) + const localVarPath = `/instances/{instanceName}` + .replace(`{${"instanceName"}}`, encodeURIComponent(String(instanceName))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + if (forceRemove !== undefined) { + localVarQueryParameter['forceRemove'] = forceRemove; + } + + if (bypassGHUnauthorized !== undefined) { + localVarQueryParameter['bypassGHUnauthorized'] = bypassGHUnauthorized; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get runner instance by name. + * @param {string} instanceName Runner instance name. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstance: async (instanceName: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'instanceName' is not null or undefined + assertParamExists('getInstance', 'instanceName', instanceName) + const localVarPath = `/instances/{instanceName}` + .replace(`{${"instanceName"}}`, encodeURIComponent(String(instanceName))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List enterprise instances. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterpriseInstances: async (enterpriseID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('listEnterpriseInstances', 'enterpriseID', enterpriseID) + const localVarPath = `/enterprises/{enterpriseID}/instances` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get all runners\' instances. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listInstances: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/instances`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List organization instances. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgInstances: async (orgID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('listOrgInstances', 'orgID', orgID) + const localVarPath = `/organizations/{orgID}/instances` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List runner instances in a pool. + * @param {string} poolID Runner pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPoolInstances: async (poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'poolID' is not null or undefined + assertParamExists('listPoolInstances', 'poolID', poolID) + const localVarPath = `/pools/{poolID}/instances` + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List repository instances. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepoInstances: async (repoID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('listRepoInstances', 'repoID', repoID) + const localVarPath = `/repositories/{repoID}/instances` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List runner instances in a scale set. + * @param {string} scalesetID Runner scale set ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listScaleSetInstances: async (scalesetID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'scalesetID' is not null or undefined + assertParamExists('listScaleSetInstances', 'scalesetID', scalesetID) + const localVarPath = `/scalesets/{scalesetID}/instances` + .replace(`{${"scalesetID"}}`, encodeURIComponent(String(scalesetID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * InstancesApi - functional programming interface + * @export + */ +export const InstancesApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = InstancesApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Delete runner instance by name. + * @param {string} instanceName Runner instance name. + * @param {boolean} [forceRemove] If true GARM will ignore any provider error when removing the runner and will continue to remove the runner from github and the GARM database. + * @param {boolean} [bypassGHUnauthorized] If true GARM will ignore unauthorized errors returned by GitHub when removing a runner. This is useful if you want to clean up runners and your credentials have expired. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteInstance(instanceName: string, forceRemove?: boolean, bypassGHUnauthorized?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteInstance(instanceName, forceRemove, bypassGHUnauthorized, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['InstancesApi.deleteInstance']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get runner instance by name. + * @param {string} instanceName Runner instance name. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInstance(instanceName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInstance(instanceName, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['InstancesApi.getInstance']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List enterprise instances. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listEnterpriseInstances(enterpriseID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listEnterpriseInstances(enterpriseID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['InstancesApi.listEnterpriseInstances']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get all runners\' instances. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listInstances(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listInstances(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['InstancesApi.listInstances']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List organization instances. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listOrgInstances(orgID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listOrgInstances(orgID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['InstancesApi.listOrgInstances']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List runner instances in a pool. + * @param {string} poolID Runner pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listPoolInstances(poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listPoolInstances(poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['InstancesApi.listPoolInstances']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List repository instances. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listRepoInstances(repoID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listRepoInstances(repoID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['InstancesApi.listRepoInstances']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List runner instances in a scale set. + * @param {string} scalesetID Runner scale set ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listScaleSetInstances(scalesetID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listScaleSetInstances(scalesetID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['InstancesApi.listScaleSetInstances']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * InstancesApi - factory interface + * @export + */ +export const InstancesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = InstancesApiFp(configuration) + return { + /** + * + * @summary Delete runner instance by name. + * @param {string} instanceName Runner instance name. + * @param {boolean} [forceRemove] If true GARM will ignore any provider error when removing the runner and will continue to remove the runner from github and the GARM database. + * @param {boolean} [bypassGHUnauthorized] If true GARM will ignore unauthorized errors returned by GitHub when removing a runner. This is useful if you want to clean up runners and your credentials have expired. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteInstance(instanceName: string, forceRemove?: boolean, bypassGHUnauthorized?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteInstance(instanceName, forceRemove, bypassGHUnauthorized, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get runner instance by name. + * @param {string} instanceName Runner instance name. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInstance(instanceName: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getInstance(instanceName, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List enterprise instances. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterpriseInstances(enterpriseID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listEnterpriseInstances(enterpriseID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get all runners\' instances. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listInstances(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listInstances(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List organization instances. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgInstances(orgID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listOrgInstances(orgID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List runner instances in a pool. + * @param {string} poolID Runner pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPoolInstances(poolID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listPoolInstances(poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List repository instances. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepoInstances(repoID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listRepoInstances(repoID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List runner instances in a scale set. + * @param {string} scalesetID Runner scale set ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listScaleSetInstances(scalesetID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listScaleSetInstances(scalesetID, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * InstancesApi - object-oriented interface + * @export + * @class InstancesApi + * @extends {BaseAPI} + */ +export class InstancesApi extends BaseAPI { + /** + * + * @summary Delete runner instance by name. + * @param {string} instanceName Runner instance name. + * @param {boolean} [forceRemove] If true GARM will ignore any provider error when removing the runner and will continue to remove the runner from github and the GARM database. + * @param {boolean} [bypassGHUnauthorized] If true GARM will ignore unauthorized errors returned by GitHub when removing a runner. This is useful if you want to clean up runners and your credentials have expired. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InstancesApi + */ + public deleteInstance(instanceName: string, forceRemove?: boolean, bypassGHUnauthorized?: boolean, options?: RawAxiosRequestConfig) { + return InstancesApiFp(this.configuration).deleteInstance(instanceName, forceRemove, bypassGHUnauthorized, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get runner instance by name. + * @param {string} instanceName Runner instance name. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InstancesApi + */ + public getInstance(instanceName: string, options?: RawAxiosRequestConfig) { + return InstancesApiFp(this.configuration).getInstance(instanceName, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List enterprise instances. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InstancesApi + */ + public listEnterpriseInstances(enterpriseID: string, options?: RawAxiosRequestConfig) { + return InstancesApiFp(this.configuration).listEnterpriseInstances(enterpriseID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get all runners\' instances. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InstancesApi + */ + public listInstances(options?: RawAxiosRequestConfig) { + return InstancesApiFp(this.configuration).listInstances(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List organization instances. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InstancesApi + */ + public listOrgInstances(orgID: string, options?: RawAxiosRequestConfig) { + return InstancesApiFp(this.configuration).listOrgInstances(orgID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List runner instances in a pool. + * @param {string} poolID Runner pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InstancesApi + */ + public listPoolInstances(poolID: string, options?: RawAxiosRequestConfig) { + return InstancesApiFp(this.configuration).listPoolInstances(poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List repository instances. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InstancesApi + */ + public listRepoInstances(repoID: string, options?: RawAxiosRequestConfig) { + return InstancesApiFp(this.configuration).listRepoInstances(repoID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List runner instances in a scale set. + * @param {string} scalesetID Runner scale set ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof InstancesApi + */ + public listScaleSetInstances(scalesetID: string, options?: RawAxiosRequestConfig) { + return InstancesApiFp(this.configuration).listScaleSetInstances(scalesetID, options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * JobsApi - axios parameter creator + * @export + */ +export const JobsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary List all jobs. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listJobs: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/jobs`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * JobsApi - functional programming interface + * @export + */ +export const JobsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = JobsApiAxiosParamCreator(configuration) + return { + /** + * + * @summary List all jobs. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listJobs(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listJobs(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['JobsApi.listJobs']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * JobsApi - factory interface + * @export + */ +export const JobsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = JobsApiFp(configuration) + return { + /** + * + * @summary List all jobs. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listJobs(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listJobs(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * JobsApi - object-oriented interface + * @export + * @class JobsApi + * @extends {BaseAPI} + */ +export class JobsApi extends BaseAPI { + /** + * + * @summary List all jobs. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof JobsApi + */ + public listJobs(options?: RawAxiosRequestConfig) { + return JobsApiFp(this.configuration).listJobs(options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * LoginApi - axios parameter creator + * @export + */ +export const LoginApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Logs in a user and returns a JWT token. + * @param {PasswordLoginParams} body Login information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + login: async (body: PasswordLoginParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('login', 'body', body) + const localVarPath = `/auth/login`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * LoginApi - functional programming interface + * @export + */ +export const LoginApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = LoginApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Logs in a user and returns a JWT token. + * @param {PasswordLoginParams} body Login information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async login(body: PasswordLoginParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.login(body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['LoginApi.login']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * LoginApi - factory interface + * @export + */ +export const LoginApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = LoginApiFp(configuration) + return { + /** + * + * @summary Logs in a user and returns a JWT token. + * @param {PasswordLoginParams} body Login information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + login(body: PasswordLoginParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.login(body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * LoginApi - object-oriented interface + * @export + * @class LoginApi + * @extends {BaseAPI} + */ +export class LoginApi extends BaseAPI { + /** + * + * @summary Logs in a user and returns a JWT token. + * @param {PasswordLoginParams} body Login information. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof LoginApi + */ + public login(body: PasswordLoginParams, options?: RawAxiosRequestConfig) { + return LoginApiFp(this.configuration).login(body, options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * MetricsTokenApi - axios parameter creator + * @export + */ +export const MetricsTokenApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Returns a JWT token that can be used to access the metrics endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getMetricsToken: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/metrics-token`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * MetricsTokenApi - functional programming interface + * @export + */ +export const MetricsTokenApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = MetricsTokenApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Returns a JWT token that can be used to access the metrics endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getMetricsToken(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getMetricsToken(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['MetricsTokenApi.getMetricsToken']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * MetricsTokenApi - factory interface + * @export + */ +export const MetricsTokenApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = MetricsTokenApiFp(configuration) + return { + /** + * + * @summary Returns a JWT token that can be used to access the metrics endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getMetricsToken(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getMetricsToken(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * MetricsTokenApi - object-oriented interface + * @export + * @class MetricsTokenApi + * @extends {BaseAPI} + */ +export class MetricsTokenApi extends BaseAPI { + /** + * + * @summary Returns a JWT token that can be used to access the metrics endpoint. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof MetricsTokenApi + */ + public getMetricsToken(options?: RawAxiosRequestConfig) { + return MetricsTokenApiFp(this.configuration).getMetricsToken(options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * OrganizationsApi - axios parameter creator + * @export + */ +export const OrganizationsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Create organization with the parameters given. + * @param {CreateOrgParams} body Parameters used when creating the organization. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createOrg: async (body: CreateOrgParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createOrg', 'body', body) + const localVarPath = `/organizations`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Create organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreatePoolParams} body Parameters used when creating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createOrgPool: async (orgID: string, body: CreatePoolParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('createOrgPool', 'orgID', orgID) + // verify required parameter 'body' is not null or undefined + assertParamExists('createOrgPool', 'body', body) + const localVarPath = `/organizations/{orgID}/pools` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Create organization scale set with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreateScaleSetParams} body Parameters used when creating the organization scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createOrgScaleSet: async (orgID: string, body: CreateScaleSetParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('createOrgScaleSet', 'orgID', orgID) + // verify required parameter 'body' is not null or undefined + assertParamExists('createOrgScaleSet', 'body', body) + const localVarPath = `/organizations/{orgID}/scalesets` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete organization by ID. + * @param {string} orgID ID of the organization to delete. + * @param {boolean} [keepWebhook] If true and a webhook is installed for this organization, it will not be removed. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrg: async (orgID: string, keepWebhook?: boolean, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('deleteOrg', 'orgID', orgID) + const localVarPath = `/organizations/{orgID}` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + if (keepWebhook !== undefined) { + localVarQueryParameter['keepWebhook'] = keepWebhook; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrgPool: async (orgID: string, poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('deleteOrgPool', 'orgID', orgID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('deleteOrgPool', 'poolID', poolID) + const localVarPath = `/organizations/{orgID}/pools/{poolID}` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get organization by ID. + * @param {string} orgID ID of the organization to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrg: async (orgID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('getOrg', 'orgID', orgID) + const localVarPath = `/organizations/{orgID}` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrgPool: async (orgID: string, poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('getOrgPool', 'orgID', orgID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('getOrgPool', 'poolID', poolID) + const localVarPath = `/organizations/{orgID}/pools/{poolID}` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get information about the GARM installed webhook on an organization. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrgWebhookInfo: async (orgID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('getOrgWebhookInfo', 'orgID', orgID) + const localVarPath = `/organizations/{orgID}/webhook` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} orgID Organization ID. + * @param {InstallWebhookParams} body Parameters used when creating the organization webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + installOrgWebhook: async (orgID: string, body: InstallWebhookParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('installOrgWebhook', 'orgID', orgID) + // verify required parameter 'body' is not null or undefined + assertParamExists('installOrgWebhook', 'body', body) + const localVarPath = `/organizations/{orgID}/webhook` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List organization instances. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgInstances: async (orgID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('listOrgInstances', 'orgID', orgID) + const localVarPath = `/organizations/{orgID}/instances` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List organization pools. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgPools: async (orgID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('listOrgPools', 'orgID', orgID) + const localVarPath = `/organizations/{orgID}/pools` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List organization scale sets. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgScaleSets: async (orgID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('listOrgScaleSets', 'orgID', orgID) + const localVarPath = `/organizations/{orgID}/scalesets` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List organizations. + * @param {string} [name] Exact organization name to filter by + * @param {string} [endpoint] Exact endpoint name to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgs: async (name?: string, endpoint?: string, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/organizations`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + if (name !== undefined) { + localVarQueryParameter['name'] = name; + } + + if (endpoint !== undefined) { + localVarQueryParameter['endpoint'] = endpoint; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Uninstall organization webhook. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uninstallOrgWebhook: async (orgID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('uninstallOrgWebhook', 'orgID', orgID) + const localVarPath = `/organizations/{orgID}/webhook` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update organization with the parameters given. + * @param {string} orgID ID of the organization to update. + * @param {UpdateEntityParams} body Parameters used when updating the organization. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateOrg: async (orgID: string, body: UpdateEntityParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('updateOrg', 'orgID', orgID) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateOrg', 'body', body) + const localVarPath = `/organizations/{orgID}` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateOrgPool: async (orgID: string, poolID: string, body: UpdatePoolParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('updateOrgPool', 'orgID', orgID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('updateOrgPool', 'poolID', poolID) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateOrgPool', 'body', body) + const localVarPath = `/organizations/{orgID}/pools/{poolID}` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * OrganizationsApi - functional programming interface + * @export + */ +export const OrganizationsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = OrganizationsApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Create organization with the parameters given. + * @param {CreateOrgParams} body Parameters used when creating the organization. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createOrg(body: CreateOrgParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createOrg(body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.createOrg']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Create organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreatePoolParams} body Parameters used when creating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createOrgPool(orgID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createOrgPool(orgID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.createOrgPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Create organization scale set with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreateScaleSetParams} body Parameters used when creating the organization scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createOrgScaleSet(orgID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createOrgScaleSet(orgID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.createOrgScaleSet']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete organization by ID. + * @param {string} orgID ID of the organization to delete. + * @param {boolean} [keepWebhook] If true and a webhook is installed for this organization, it will not be removed. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteOrg(orgID: string, keepWebhook?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrg(orgID, keepWebhook, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.deleteOrg']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteOrgPool(orgID: string, poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrgPool(orgID, poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.deleteOrgPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get organization by ID. + * @param {string} orgID ID of the organization to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getOrg(orgID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrg(orgID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.getOrg']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getOrgPool(orgID: string, poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrgPool(orgID, poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.getOrgPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get information about the GARM installed webhook on an organization. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getOrgWebhookInfo(orgID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrgWebhookInfo(orgID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.getOrgWebhookInfo']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} orgID Organization ID. + * @param {InstallWebhookParams} body Parameters used when creating the organization webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async installOrgWebhook(orgID: string, body: InstallWebhookParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.installOrgWebhook(orgID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.installOrgWebhook']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List organization instances. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listOrgInstances(orgID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listOrgInstances(orgID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.listOrgInstances']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List organization pools. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listOrgPools(orgID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listOrgPools(orgID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.listOrgPools']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List organization scale sets. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listOrgScaleSets(orgID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listOrgScaleSets(orgID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.listOrgScaleSets']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List organizations. + * @param {string} [name] Exact organization name to filter by + * @param {string} [endpoint] Exact endpoint name to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listOrgs(name?: string, endpoint?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listOrgs(name, endpoint, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.listOrgs']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Uninstall organization webhook. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async uninstallOrgWebhook(orgID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.uninstallOrgWebhook(orgID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.uninstallOrgWebhook']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update organization with the parameters given. + * @param {string} orgID ID of the organization to update. + * @param {UpdateEntityParams} body Parameters used when updating the organization. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateOrg(orgID: string, body: UpdateEntityParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrg(orgID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.updateOrg']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateOrgPool(orgID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrgPool(orgID, poolID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['OrganizationsApi.updateOrgPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * OrganizationsApi - factory interface + * @export + */ +export const OrganizationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = OrganizationsApiFp(configuration) + return { + /** + * + * @summary Create organization with the parameters given. + * @param {CreateOrgParams} body Parameters used when creating the organization. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createOrg(body: CreateOrgParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createOrg(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Create organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreatePoolParams} body Parameters used when creating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createOrgPool(orgID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createOrgPool(orgID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Create organization scale set with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreateScaleSetParams} body Parameters used when creating the organization scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createOrgScaleSet(orgID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createOrgScaleSet(orgID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete organization by ID. + * @param {string} orgID ID of the organization to delete. + * @param {boolean} [keepWebhook] If true and a webhook is installed for this organization, it will not be removed. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrg(orgID: string, keepWebhook?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteOrg(orgID, keepWebhook, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrgPool(orgID: string, poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteOrgPool(orgID, poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get organization by ID. + * @param {string} orgID ID of the organization to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrg(orgID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getOrg(orgID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrgPool(orgID: string, poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getOrgPool(orgID, poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get information about the GARM installed webhook on an organization. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrgWebhookInfo(orgID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getOrgWebhookInfo(orgID, options).then((request) => request(axios, basePath)); + }, + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} orgID Organization ID. + * @param {InstallWebhookParams} body Parameters used when creating the organization webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + installOrgWebhook(orgID: string, body: InstallWebhookParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.installOrgWebhook(orgID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List organization instances. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgInstances(orgID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listOrgInstances(orgID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List organization pools. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgPools(orgID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listOrgPools(orgID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List organization scale sets. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgScaleSets(orgID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listOrgScaleSets(orgID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List organizations. + * @param {string} [name] Exact organization name to filter by + * @param {string} [endpoint] Exact endpoint name to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgs(name?: string, endpoint?: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listOrgs(name, endpoint, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Uninstall organization webhook. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uninstallOrgWebhook(orgID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.uninstallOrgWebhook(orgID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update organization with the parameters given. + * @param {string} orgID ID of the organization to update. + * @param {UpdateEntityParams} body Parameters used when updating the organization. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateOrg(orgID: string, body: UpdateEntityParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateOrg(orgID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateOrgPool(orgID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateOrgPool(orgID, poolID, body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * OrganizationsApi - object-oriented interface + * @export + * @class OrganizationsApi + * @extends {BaseAPI} + */ +export class OrganizationsApi extends BaseAPI { + /** + * + * @summary Create organization with the parameters given. + * @param {CreateOrgParams} body Parameters used when creating the organization. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public createOrg(body: CreateOrgParams, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).createOrg(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Create organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreatePoolParams} body Parameters used when creating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public createOrgPool(orgID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).createOrgPool(orgID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Create organization scale set with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreateScaleSetParams} body Parameters used when creating the organization scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public createOrgScaleSet(orgID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).createOrgScaleSet(orgID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete organization by ID. + * @param {string} orgID ID of the organization to delete. + * @param {boolean} [keepWebhook] If true and a webhook is installed for this organization, it will not be removed. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public deleteOrg(orgID: string, keepWebhook?: boolean, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).deleteOrg(orgID, keepWebhook, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public deleteOrgPool(orgID: string, poolID: string, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).deleteOrgPool(orgID, poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get organization by ID. + * @param {string} orgID ID of the organization to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public getOrg(orgID: string, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).getOrg(orgID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public getOrgPool(orgID: string, poolID: string, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).getOrgPool(orgID, poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get information about the GARM installed webhook on an organization. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public getOrgWebhookInfo(orgID: string, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).getOrgWebhookInfo(orgID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} orgID Organization ID. + * @param {InstallWebhookParams} body Parameters used when creating the organization webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public installOrgWebhook(orgID: string, body: InstallWebhookParams, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).installOrgWebhook(orgID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List organization instances. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public listOrgInstances(orgID: string, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).listOrgInstances(orgID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List organization pools. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public listOrgPools(orgID: string, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).listOrgPools(orgID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List organization scale sets. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public listOrgScaleSets(orgID: string, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).listOrgScaleSets(orgID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List organizations. + * @param {string} [name] Exact organization name to filter by + * @param {string} [endpoint] Exact endpoint name to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public listOrgs(name?: string, endpoint?: string, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).listOrgs(name, endpoint, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Uninstall organization webhook. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public uninstallOrgWebhook(orgID: string, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).uninstallOrgWebhook(orgID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update organization with the parameters given. + * @param {string} orgID ID of the organization to update. + * @param {UpdateEntityParams} body Parameters used when updating the organization. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public updateOrg(orgID: string, body: UpdateEntityParams, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).updateOrg(orgID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof OrganizationsApi + */ + public updateOrgPool(orgID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig) { + return OrganizationsApiFp(this.configuration).updateOrgPool(orgID, poolID, body, options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * PoolsApi - axios parameter creator + * @export + */ +export const PoolsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreatePoolParams} body Parameters used when creating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createEnterprisePool: async (enterpriseID: string, body: CreatePoolParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('createEnterprisePool', 'enterpriseID', enterpriseID) + // verify required parameter 'body' is not null or undefined + assertParamExists('createEnterprisePool', 'body', body) + const localVarPath = `/enterprises/{enterpriseID}/pools` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Create organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreatePoolParams} body Parameters used when creating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createOrgPool: async (orgID: string, body: CreatePoolParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('createOrgPool', 'orgID', orgID) + // verify required parameter 'body' is not null or undefined + assertParamExists('createOrgPool', 'body', body) + const localVarPath = `/organizations/{orgID}/pools` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Create repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreatePoolParams} body Parameters used when creating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRepoPool: async (repoID: string, body: CreatePoolParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('createRepoPool', 'repoID', repoID) + // verify required parameter 'body' is not null or undefined + assertParamExists('createRepoPool', 'body', body) + const localVarPath = `/repositories/{repoID}/pools` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteEnterprisePool: async (enterpriseID: string, poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('deleteEnterprisePool', 'enterpriseID', enterpriseID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('deleteEnterprisePool', 'poolID', poolID) + const localVarPath = `/enterprises/{enterpriseID}/pools/{poolID}` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrgPool: async (orgID: string, poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('deleteOrgPool', 'orgID', orgID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('deleteOrgPool', 'poolID', poolID) + const localVarPath = `/organizations/{orgID}/pools/{poolID}` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete pool by ID. + * @param {string} poolID ID of the pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePool: async (poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'poolID' is not null or undefined + assertParamExists('deletePool', 'poolID', poolID) + const localVarPath = `/pools/{poolID}` + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRepoPool: async (repoID: string, poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('deleteRepoPool', 'repoID', repoID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('deleteRepoPool', 'poolID', poolID) + const localVarPath = `/repositories/{repoID}/pools/{poolID}` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getEnterprisePool: async (enterpriseID: string, poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('getEnterprisePool', 'enterpriseID', enterpriseID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('getEnterprisePool', 'poolID', poolID) + const localVarPath = `/enterprises/{enterpriseID}/pools/{poolID}` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrgPool: async (orgID: string, poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('getOrgPool', 'orgID', orgID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('getOrgPool', 'poolID', poolID) + const localVarPath = `/organizations/{orgID}/pools/{poolID}` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get pool by ID. + * @param {string} poolID ID of the pool to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPool: async (poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'poolID' is not null or undefined + assertParamExists('getPool', 'poolID', poolID) + const localVarPath = `/pools/{poolID}` + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRepoPool: async (repoID: string, poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('getRepoPool', 'repoID', repoID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('getRepoPool', 'poolID', poolID) + const localVarPath = `/repositories/{repoID}/pools/{poolID}` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List enterprise pools. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterprisePools: async (enterpriseID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('listEnterprisePools', 'enterpriseID', enterpriseID) + const localVarPath = `/enterprises/{enterpriseID}/pools` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List organization pools. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgPools: async (orgID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('listOrgPools', 'orgID', orgID) + const localVarPath = `/organizations/{orgID}/pools` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List all pools. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPools: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/pools`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List repository pools. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepoPools: async (repoID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('listRepoPools', 'repoID', repoID) + const localVarPath = `/repositories/{repoID}/pools` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateEnterprisePool: async (enterpriseID: string, poolID: string, body: UpdatePoolParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('updateEnterprisePool', 'enterpriseID', enterpriseID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('updateEnterprisePool', 'poolID', poolID) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateEnterprisePool', 'body', body) + const localVarPath = `/enterprises/{enterpriseID}/pools/{poolID}` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateOrgPool: async (orgID: string, poolID: string, body: UpdatePoolParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('updateOrgPool', 'orgID', orgID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('updateOrgPool', 'poolID', poolID) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateOrgPool', 'body', body) + const localVarPath = `/organizations/{orgID}/pools/{poolID}` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update pool by ID. + * @param {string} poolID ID of the pool to update. + * @param {UpdatePoolParams} body Parameters to update the pool with. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePool: async (poolID: string, body: UpdatePoolParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'poolID' is not null or undefined + assertParamExists('updatePool', 'poolID', poolID) + // verify required parameter 'body' is not null or undefined + assertParamExists('updatePool', 'body', body) + const localVarPath = `/pools/{poolID}` + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateRepoPool: async (repoID: string, poolID: string, body: UpdatePoolParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('updateRepoPool', 'repoID', repoID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('updateRepoPool', 'poolID', poolID) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateRepoPool', 'body', body) + const localVarPath = `/repositories/{repoID}/pools/{poolID}` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * PoolsApi - functional programming interface + * @export + */ +export const PoolsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PoolsApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreatePoolParams} body Parameters used when creating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createEnterprisePool(enterpriseID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createEnterprisePool(enterpriseID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.createEnterprisePool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Create organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreatePoolParams} body Parameters used when creating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createOrgPool(orgID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createOrgPool(orgID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.createOrgPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Create repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreatePoolParams} body Parameters used when creating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createRepoPool(repoID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createRepoPool(repoID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.createRepoPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteEnterprisePool(enterpriseID: string, poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteEnterprisePool(enterpriseID, poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.deleteEnterprisePool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteOrgPool(orgID: string, poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrgPool(orgID, poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.deleteOrgPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete pool by ID. + * @param {string} poolID ID of the pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletePool(poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePool(poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.deletePool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteRepoPool(repoID: string, poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRepoPool(repoID, poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.deleteRepoPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getEnterprisePool(enterpriseID: string, poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getEnterprisePool(enterpriseID, poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.getEnterprisePool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getOrgPool(orgID: string, poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrgPool(orgID, poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.getOrgPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get pool by ID. + * @param {string} poolID ID of the pool to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getPool(poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPool(poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.getPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRepoPool(repoID: string, poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRepoPool(repoID, poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.getRepoPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List enterprise pools. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listEnterprisePools(enterpriseID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listEnterprisePools(enterpriseID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.listEnterprisePools']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List organization pools. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listOrgPools(orgID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listOrgPools(orgID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.listOrgPools']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List all pools. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listPools(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listPools(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.listPools']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List repository pools. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listRepoPools(repoID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listRepoPools(repoID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.listRepoPools']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateEnterprisePool(enterpriseID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateEnterprisePool(enterpriseID, poolID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.updateEnterprisePool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateOrgPool(orgID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateOrgPool(orgID, poolID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.updateOrgPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update pool by ID. + * @param {string} poolID ID of the pool to update. + * @param {UpdatePoolParams} body Parameters to update the pool with. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatePool(poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePool(poolID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.updatePool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateRepoPool(repoID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateRepoPool(repoID, poolID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['PoolsApi.updateRepoPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * PoolsApi - factory interface + * @export + */ +export const PoolsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PoolsApiFp(configuration) + return { + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreatePoolParams} body Parameters used when creating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createEnterprisePool(enterpriseID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createEnterprisePool(enterpriseID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Create organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreatePoolParams} body Parameters used when creating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createOrgPool(orgID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createOrgPool(orgID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Create repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreatePoolParams} body Parameters used when creating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRepoPool(repoID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createRepoPool(repoID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteEnterprisePool(enterpriseID: string, poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteEnterprisePool(enterpriseID, poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrgPool(orgID: string, poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteOrgPool(orgID, poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete pool by ID. + * @param {string} poolID ID of the pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePool(poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deletePool(poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRepoPool(repoID: string, poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteRepoPool(repoID, poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getEnterprisePool(enterpriseID: string, poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getEnterprisePool(enterpriseID, poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrgPool(orgID: string, poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getOrgPool(orgID, poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get pool by ID. + * @param {string} poolID ID of the pool to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPool(poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getPool(poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRepoPool(repoID: string, poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getRepoPool(repoID, poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List enterprise pools. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterprisePools(enterpriseID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listEnterprisePools(enterpriseID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List organization pools. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgPools(orgID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listOrgPools(orgID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List all pools. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listPools(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listPools(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List repository pools. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepoPools(repoID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listRepoPools(repoID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateEnterprisePool(enterpriseID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateEnterprisePool(enterpriseID, poolID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateOrgPool(orgID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateOrgPool(orgID, poolID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update pool by ID. + * @param {string} poolID ID of the pool to update. + * @param {UpdatePoolParams} body Parameters to update the pool with. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePool(poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updatePool(poolID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateRepoPool(repoID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateRepoPool(repoID, poolID, body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * PoolsApi - object-oriented interface + * @export + * @class PoolsApi + * @extends {BaseAPI} + */ +export class PoolsApi extends BaseAPI { + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreatePoolParams} body Parameters used when creating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public createEnterprisePool(enterpriseID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).createEnterprisePool(enterpriseID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Create organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreatePoolParams} body Parameters used when creating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public createOrgPool(orgID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).createOrgPool(orgID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Create repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreatePoolParams} body Parameters used when creating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public createRepoPool(repoID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).createRepoPool(repoID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public deleteEnterprisePool(enterpriseID: string, poolID: string, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).deleteEnterprisePool(enterpriseID, poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public deleteOrgPool(orgID: string, poolID: string, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).deleteOrgPool(orgID, poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete pool by ID. + * @param {string} poolID ID of the pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public deletePool(poolID: string, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).deletePool(poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public deleteRepoPool(repoID: string, poolID: string, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).deleteRepoPool(repoID, poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get enterprise pool by ID. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public getEnterprisePool(enterpriseID: string, poolID: string, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).getEnterprisePool(enterpriseID, poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get organization pool by ID. + * @param {string} orgID Organization ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public getOrgPool(orgID: string, poolID: string, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).getOrgPool(orgID, poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get pool by ID. + * @param {string} poolID ID of the pool to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public getPool(poolID: string, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).getPool(poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public getRepoPool(repoID: string, poolID: string, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).getRepoPool(repoID, poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List enterprise pools. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public listEnterprisePools(enterpriseID: string, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).listEnterprisePools(enterpriseID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List organization pools. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public listOrgPools(orgID: string, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).listOrgPools(orgID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List all pools. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public listPools(options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).listPools(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List repository pools. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public listRepoPools(repoID: string, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).listRepoPools(repoID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {string} poolID ID of the enterprise pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the enterprise pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public updateEnterprisePool(enterpriseID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).updateEnterprisePool(enterpriseID, poolID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update organization pool with the parameters given. + * @param {string} orgID Organization ID. + * @param {string} poolID ID of the organization pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the organization pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public updateOrgPool(orgID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).updateOrgPool(orgID, poolID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update pool by ID. + * @param {string} poolID ID of the pool to update. + * @param {UpdatePoolParams} body Parameters to update the pool with. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public updatePool(poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).updatePool(poolID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PoolsApi + */ + public updateRepoPool(repoID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig) { + return PoolsApiFp(this.configuration).updateRepoPool(repoID, poolID, body, options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * ProvidersApi - axios parameter creator + * @export + */ +export const ProvidersApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary List all providers. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listProviders: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/providers`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * ProvidersApi - functional programming interface + * @export + */ +export const ProvidersApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ProvidersApiAxiosParamCreator(configuration) + return { + /** + * + * @summary List all providers. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listProviders(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listProviders(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ProvidersApi.listProviders']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * ProvidersApi - factory interface + * @export + */ +export const ProvidersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ProvidersApiFp(configuration) + return { + /** + * + * @summary List all providers. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listProviders(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listProviders(options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * ProvidersApi - object-oriented interface + * @export + * @class ProvidersApi + * @extends {BaseAPI} + */ +export class ProvidersApi extends BaseAPI { + /** + * + * @summary List all providers. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ProvidersApi + */ + public listProviders(options?: RawAxiosRequestConfig) { + return ProvidersApiFp(this.configuration).listProviders(options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * RepositoriesApi - axios parameter creator + * @export + */ +export const RepositoriesApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Create repository with the parameters given. + * @param {CreateRepoParams} body Parameters used when creating the repository. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRepo: async (body: CreateRepoParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createRepo', 'body', body) + const localVarPath = `/repositories`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Create repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreatePoolParams} body Parameters used when creating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRepoPool: async (repoID: string, body: CreatePoolParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('createRepoPool', 'repoID', repoID) + // verify required parameter 'body' is not null or undefined + assertParamExists('createRepoPool', 'body', body) + const localVarPath = `/repositories/{repoID}/pools` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Create repository scale set with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreateScaleSetParams} body Parameters used when creating the repository scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRepoScaleSet: async (repoID: string, body: CreateScaleSetParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('createRepoScaleSet', 'repoID', repoID) + // verify required parameter 'body' is not null or undefined + assertParamExists('createRepoScaleSet', 'body', body) + const localVarPath = `/repositories/{repoID}/scalesets` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete repository by ID. + * @param {string} repoID ID of the repository to delete. + * @param {boolean} [keepWebhook] If true and a webhook is installed for this repo, it will not be removed. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRepo: async (repoID: string, keepWebhook?: boolean, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('deleteRepo', 'repoID', repoID) + const localVarPath = `/repositories/{repoID}` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + if (keepWebhook !== undefined) { + localVarQueryParameter['keepWebhook'] = keepWebhook; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRepoPool: async (repoID: string, poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('deleteRepoPool', 'repoID', repoID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('deleteRepoPool', 'poolID', poolID) + const localVarPath = `/repositories/{repoID}/pools/{poolID}` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get repository by ID. + * @param {string} repoID ID of the repository to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRepo: async (repoID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('getRepo', 'repoID', repoID) + const localVarPath = `/repositories/{repoID}` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRepoPool: async (repoID: string, poolID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('getRepoPool', 'repoID', repoID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('getRepoPool', 'poolID', poolID) + const localVarPath = `/repositories/{repoID}/pools/{poolID}` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get information about the GARM installed webhook on a repository. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRepoWebhookInfo: async (repoID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('getRepoWebhookInfo', 'repoID', repoID) + const localVarPath = `/repositories/{repoID}/webhook` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} repoID Repository ID. + * @param {InstallWebhookParams} body Parameters used when creating the repository webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + installRepoWebhook: async (repoID: string, body: InstallWebhookParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('installRepoWebhook', 'repoID', repoID) + // verify required parameter 'body' is not null or undefined + assertParamExists('installRepoWebhook', 'body', body) + const localVarPath = `/repositories/{repoID}/webhook` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List repository instances. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepoInstances: async (repoID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('listRepoInstances', 'repoID', repoID) + const localVarPath = `/repositories/{repoID}/instances` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List repository pools. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepoPools: async (repoID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('listRepoPools', 'repoID', repoID) + const localVarPath = `/repositories/{repoID}/pools` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List repository scale sets. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepoScaleSets: async (repoID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('listRepoScaleSets', 'repoID', repoID) + const localVarPath = `/repositories/{repoID}/scalesets` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List repositories. + * @param {string} [owner] Exact owner name to filter by + * @param {string} [name] Exact repository name to filter by + * @param {string} [endpoint] Exact endpoint name to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepos: async (owner?: string, name?: string, endpoint?: string, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/repositories`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + if (owner !== undefined) { + localVarQueryParameter['owner'] = owner; + } + + if (name !== undefined) { + localVarQueryParameter['name'] = name; + } + + if (endpoint !== undefined) { + localVarQueryParameter['endpoint'] = endpoint; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Uninstall organization webhook. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uninstallRepoWebhook: async (repoID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('uninstallRepoWebhook', 'repoID', repoID) + const localVarPath = `/repositories/{repoID}/webhook` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update repository with the parameters given. + * @param {string} repoID ID of the repository to update. + * @param {UpdateEntityParams} body Parameters used when updating the repository. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateRepo: async (repoID: string, body: UpdateEntityParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('updateRepo', 'repoID', repoID) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateRepo', 'body', body) + const localVarPath = `/repositories/{repoID}` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateRepoPool: async (repoID: string, poolID: string, body: UpdatePoolParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('updateRepoPool', 'repoID', repoID) + // verify required parameter 'poolID' is not null or undefined + assertParamExists('updateRepoPool', 'poolID', poolID) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateRepoPool', 'body', body) + const localVarPath = `/repositories/{repoID}/pools/{poolID}` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))) + .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * RepositoriesApi - functional programming interface + * @export + */ +export const RepositoriesApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = RepositoriesApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Create repository with the parameters given. + * @param {CreateRepoParams} body Parameters used when creating the repository. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createRepo(body: CreateRepoParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createRepo(body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.createRepo']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Create repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreatePoolParams} body Parameters used when creating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createRepoPool(repoID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createRepoPool(repoID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.createRepoPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Create repository scale set with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreateScaleSetParams} body Parameters used when creating the repository scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createRepoScaleSet(repoID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createRepoScaleSet(repoID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.createRepoScaleSet']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete repository by ID. + * @param {string} repoID ID of the repository to delete. + * @param {boolean} [keepWebhook] If true and a webhook is installed for this repo, it will not be removed. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteRepo(repoID: string, keepWebhook?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRepo(repoID, keepWebhook, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.deleteRepo']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteRepoPool(repoID: string, poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRepoPool(repoID, poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.deleteRepoPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get repository by ID. + * @param {string} repoID ID of the repository to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRepo(repoID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRepo(repoID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.getRepo']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRepoPool(repoID: string, poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRepoPool(repoID, poolID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.getRepoPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get information about the GARM installed webhook on a repository. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRepoWebhookInfo(repoID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRepoWebhookInfo(repoID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.getRepoWebhookInfo']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} repoID Repository ID. + * @param {InstallWebhookParams} body Parameters used when creating the repository webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async installRepoWebhook(repoID: string, body: InstallWebhookParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.installRepoWebhook(repoID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.installRepoWebhook']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List repository instances. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listRepoInstances(repoID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listRepoInstances(repoID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.listRepoInstances']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List repository pools. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listRepoPools(repoID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listRepoPools(repoID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.listRepoPools']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List repository scale sets. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listRepoScaleSets(repoID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listRepoScaleSets(repoID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.listRepoScaleSets']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List repositories. + * @param {string} [owner] Exact owner name to filter by + * @param {string} [name] Exact repository name to filter by + * @param {string} [endpoint] Exact endpoint name to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listRepos(owner?: string, name?: string, endpoint?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listRepos(owner, name, endpoint, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.listRepos']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Uninstall organization webhook. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async uninstallRepoWebhook(repoID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.uninstallRepoWebhook(repoID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.uninstallRepoWebhook']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update repository with the parameters given. + * @param {string} repoID ID of the repository to update. + * @param {UpdateEntityParams} body Parameters used when updating the repository. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateRepo(repoID: string, body: UpdateEntityParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateRepo(repoID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.updateRepo']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateRepoPool(repoID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateRepoPool(repoID, poolID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RepositoriesApi.updateRepoPool']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * RepositoriesApi - factory interface + * @export + */ +export const RepositoriesApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = RepositoriesApiFp(configuration) + return { + /** + * + * @summary Create repository with the parameters given. + * @param {CreateRepoParams} body Parameters used when creating the repository. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRepo(body: CreateRepoParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createRepo(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Create repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreatePoolParams} body Parameters used when creating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRepoPool(repoID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createRepoPool(repoID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Create repository scale set with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreateScaleSetParams} body Parameters used when creating the repository scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRepoScaleSet(repoID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createRepoScaleSet(repoID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete repository by ID. + * @param {string} repoID ID of the repository to delete. + * @param {boolean} [keepWebhook] If true and a webhook is installed for this repo, it will not be removed. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRepo(repoID: string, keepWebhook?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteRepo(repoID, keepWebhook, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteRepoPool(repoID: string, poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteRepoPool(repoID, poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get repository by ID. + * @param {string} repoID ID of the repository to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRepo(repoID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getRepo(repoID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRepoPool(repoID: string, poolID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getRepoPool(repoID, poolID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get information about the GARM installed webhook on a repository. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRepoWebhookInfo(repoID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getRepoWebhookInfo(repoID, options).then((request) => request(axios, basePath)); + }, + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} repoID Repository ID. + * @param {InstallWebhookParams} body Parameters used when creating the repository webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + installRepoWebhook(repoID: string, body: InstallWebhookParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.installRepoWebhook(repoID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List repository instances. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepoInstances(repoID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listRepoInstances(repoID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List repository pools. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepoPools(repoID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listRepoPools(repoID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List repository scale sets. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepoScaleSets(repoID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listRepoScaleSets(repoID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List repositories. + * @param {string} [owner] Exact owner name to filter by + * @param {string} [name] Exact repository name to filter by + * @param {string} [endpoint] Exact endpoint name to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepos(owner?: string, name?: string, endpoint?: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listRepos(owner, name, endpoint, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Uninstall organization webhook. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uninstallRepoWebhook(repoID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.uninstallRepoWebhook(repoID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update repository with the parameters given. + * @param {string} repoID ID of the repository to update. + * @param {UpdateEntityParams} body Parameters used when updating the repository. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateRepo(repoID: string, body: UpdateEntityParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateRepo(repoID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateRepoPool(repoID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateRepoPool(repoID, poolID, body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * RepositoriesApi - object-oriented interface + * @export + * @class RepositoriesApi + * @extends {BaseAPI} + */ +export class RepositoriesApi extends BaseAPI { + /** + * + * @summary Create repository with the parameters given. + * @param {CreateRepoParams} body Parameters used when creating the repository. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public createRepo(body: CreateRepoParams, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).createRepo(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Create repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreatePoolParams} body Parameters used when creating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public createRepoPool(repoID: string, body: CreatePoolParams, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).createRepoPool(repoID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Create repository scale set with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreateScaleSetParams} body Parameters used when creating the repository scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public createRepoScaleSet(repoID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).createRepoScaleSet(repoID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete repository by ID. + * @param {string} repoID ID of the repository to delete. + * @param {boolean} [keepWebhook] If true and a webhook is installed for this repo, it will not be removed. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public deleteRepo(repoID: string, keepWebhook?: boolean, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).deleteRepo(repoID, keepWebhook, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public deleteRepoPool(repoID: string, poolID: string, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).deleteRepoPool(repoID, poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get repository by ID. + * @param {string} repoID ID of the repository to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public getRepo(repoID: string, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).getRepo(repoID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get repository pool by ID. + * @param {string} repoID Repository ID. + * @param {string} poolID Pool ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public getRepoPool(repoID: string, poolID: string, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).getRepoPool(repoID, poolID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get information about the GARM installed webhook on a repository. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public getRepoWebhookInfo(repoID: string, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).getRepoWebhookInfo(repoID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Install the GARM webhook for an organization. The secret configured on the organization will be used to validate the requests. + * @param {string} repoID Repository ID. + * @param {InstallWebhookParams} body Parameters used when creating the repository webhook. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public installRepoWebhook(repoID: string, body: InstallWebhookParams, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).installRepoWebhook(repoID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List repository instances. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public listRepoInstances(repoID: string, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).listRepoInstances(repoID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List repository pools. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public listRepoPools(repoID: string, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).listRepoPools(repoID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List repository scale sets. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public listRepoScaleSets(repoID: string, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).listRepoScaleSets(repoID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List repositories. + * @param {string} [owner] Exact owner name to filter by + * @param {string} [name] Exact repository name to filter by + * @param {string} [endpoint] Exact endpoint name to filter by + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public listRepos(owner?: string, name?: string, endpoint?: string, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).listRepos(owner, name, endpoint, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Uninstall organization webhook. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public uninstallRepoWebhook(repoID: string, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).uninstallRepoWebhook(repoID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update repository with the parameters given. + * @param {string} repoID ID of the repository to update. + * @param {UpdateEntityParams} body Parameters used when updating the repository. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public updateRepo(repoID: string, body: UpdateEntityParams, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).updateRepo(repoID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update repository pool with the parameters given. + * @param {string} repoID Repository ID. + * @param {string} poolID ID of the repository pool to update. + * @param {UpdatePoolParams} body Parameters used when updating the repository pool. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RepositoriesApi + */ + public updateRepoPool(repoID: string, poolID: string, body: UpdatePoolParams, options?: RawAxiosRequestConfig) { + return RepositoriesApiFp(this.configuration).updateRepoPool(repoID, poolID, body, options).then((request) => request(this.axios, this.basePath)); + } +} + + + +/** + * ScalesetsApi - axios parameter creator + * @export + */ +export const ScalesetsApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreateScaleSetParams} body Parameters used when creating the enterprise scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createEnterpriseScaleSet: async (enterpriseID: string, body: CreateScaleSetParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('createEnterpriseScaleSet', 'enterpriseID', enterpriseID) + // verify required parameter 'body' is not null or undefined + assertParamExists('createEnterpriseScaleSet', 'body', body) + const localVarPath = `/enterprises/{enterpriseID}/scalesets` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Create organization scale set with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreateScaleSetParams} body Parameters used when creating the organization scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createOrgScaleSet: async (orgID: string, body: CreateScaleSetParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('createOrgScaleSet', 'orgID', orgID) + // verify required parameter 'body' is not null or undefined + assertParamExists('createOrgScaleSet', 'body', body) + const localVarPath = `/organizations/{orgID}/scalesets` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Create repository scale set with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreateScaleSetParams} body Parameters used when creating the repository scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRepoScaleSet: async (repoID: string, body: CreateScaleSetParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('createRepoScaleSet', 'repoID', repoID) + // verify required parameter 'body' is not null or undefined + assertParamExists('createRepoScaleSet', 'body', body) + const localVarPath = `/repositories/{repoID}/scalesets` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Delete scale set by ID. + * @param {string} scalesetID ID of the scale set to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteScaleSet: async (scalesetID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'scalesetID' is not null or undefined + assertParamExists('deleteScaleSet', 'scalesetID', scalesetID) + const localVarPath = `/scalesets/{scalesetID}` + .replace(`{${"scalesetID"}}`, encodeURIComponent(String(scalesetID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get scale set by ID. + * @param {string} scalesetID ID of the scale set to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getScaleSet: async (scalesetID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'scalesetID' is not null or undefined + assertParamExists('getScaleSet', 'scalesetID', scalesetID) + const localVarPath = `/scalesets/{scalesetID}` + .replace(`{${"scalesetID"}}`, encodeURIComponent(String(scalesetID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List enterprise scale sets. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterpriseScaleSets: async (enterpriseID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'enterpriseID' is not null or undefined + assertParamExists('listEnterpriseScaleSets', 'enterpriseID', enterpriseID) + const localVarPath = `/enterprises/{enterpriseID}/scalesets` + .replace(`{${"enterpriseID"}}`, encodeURIComponent(String(enterpriseID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List organization scale sets. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgScaleSets: async (orgID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'orgID' is not null or undefined + assertParamExists('listOrgScaleSets', 'orgID', orgID) + const localVarPath = `/organizations/{orgID}/scalesets` + .replace(`{${"orgID"}}`, encodeURIComponent(String(orgID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List repository scale sets. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepoScaleSets: async (repoID: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'repoID' is not null or undefined + assertParamExists('listRepoScaleSets', 'repoID', repoID) + const localVarPath = `/repositories/{repoID}/scalesets` + .replace(`{${"repoID"}}`, encodeURIComponent(String(repoID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary List all scalesets. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listScalesets: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/scalesets`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update scale set by ID. + * @param {string} scalesetID ID of the scale set to update. + * @param {UpdateScaleSetParams} body Parameters to update the scale set with. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateScaleSet: async (scalesetID: string, body: UpdateScaleSetParams, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'scalesetID' is not null or undefined + assertParamExists('updateScaleSet', 'scalesetID', scalesetID) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateScaleSet', 'body', body) + const localVarPath = `/scalesets/{scalesetID}` + .replace(`{${"scalesetID"}}`, encodeURIComponent(String(scalesetID))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication Bearer required + await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * ScalesetsApi - functional programming interface + * @export + */ +export const ScalesetsApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ScalesetsApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreateScaleSetParams} body Parameters used when creating the enterprise scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createEnterpriseScaleSet(enterpriseID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createEnterpriseScaleSet(enterpriseID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScalesetsApi.createEnterpriseScaleSet']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Create organization scale set with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreateScaleSetParams} body Parameters used when creating the organization scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createOrgScaleSet(orgID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createOrgScaleSet(orgID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScalesetsApi.createOrgScaleSet']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Create repository scale set with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreateScaleSetParams} body Parameters used when creating the repository scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createRepoScaleSet(repoID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createRepoScaleSet(repoID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScalesetsApi.createRepoScaleSet']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Delete scale set by ID. + * @param {string} scalesetID ID of the scale set to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteScaleSet(scalesetID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteScaleSet(scalesetID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScalesetsApi.deleteScaleSet']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Get scale set by ID. + * @param {string} scalesetID ID of the scale set to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getScaleSet(scalesetID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getScaleSet(scalesetID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScalesetsApi.getScaleSet']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List enterprise scale sets. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listEnterpriseScaleSets(enterpriseID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listEnterpriseScaleSets(enterpriseID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScalesetsApi.listEnterpriseScaleSets']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List organization scale sets. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listOrgScaleSets(orgID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listOrgScaleSets(orgID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScalesetsApi.listOrgScaleSets']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List repository scale sets. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listRepoScaleSets(repoID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listRepoScaleSets(repoID, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScalesetsApi.listRepoScaleSets']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary List all scalesets. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async listScalesets(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listScalesets(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScalesetsApi.listScalesets']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * + * @summary Update scale set by ID. + * @param {string} scalesetID ID of the scale set to update. + * @param {UpdateScaleSetParams} body Parameters to update the scale set with. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateScaleSet(scalesetID: string, body: UpdateScaleSetParams, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateScaleSet(scalesetID, body, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ScalesetsApi.updateScaleSet']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * ScalesetsApi - factory interface + * @export + */ +export const ScalesetsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ScalesetsApiFp(configuration) + return { + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreateScaleSetParams} body Parameters used when creating the enterprise scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createEnterpriseScaleSet(enterpriseID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createEnterpriseScaleSet(enterpriseID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Create organization scale set with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreateScaleSetParams} body Parameters used when creating the organization scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createOrgScaleSet(orgID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createOrgScaleSet(orgID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Create repository scale set with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreateScaleSetParams} body Parameters used when creating the repository scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createRepoScaleSet(repoID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.createRepoScaleSet(repoID, body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Delete scale set by ID. + * @param {string} scalesetID ID of the scale set to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteScaleSet(scalesetID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.deleteScaleSet(scalesetID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get scale set by ID. + * @param {string} scalesetID ID of the scale set to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getScaleSet(scalesetID: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getScaleSet(scalesetID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List enterprise scale sets. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listEnterpriseScaleSets(enterpriseID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listEnterpriseScaleSets(enterpriseID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List organization scale sets. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listOrgScaleSets(orgID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listOrgScaleSets(orgID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List repository scale sets. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listRepoScaleSets(repoID: string, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listRepoScaleSets(repoID, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary List all scalesets. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + listScalesets(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.listScalesets(options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update scale set by ID. + * @param {string} scalesetID ID of the scale set to update. + * @param {UpdateScaleSetParams} body Parameters to update the scale set with. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateScaleSet(scalesetID: string, body: UpdateScaleSetParams, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.updateScaleSet(scalesetID, body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * ScalesetsApi - object-oriented interface + * @export + * @class ScalesetsApi + * @extends {BaseAPI} + */ +export class ScalesetsApi extends BaseAPI { + /** + * + * @summary Create enterprise pool with the parameters given. + * @param {string} enterpriseID Enterprise ID. + * @param {CreateScaleSetParams} body Parameters used when creating the enterprise scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScalesetsApi + */ + public createEnterpriseScaleSet(enterpriseID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig) { + return ScalesetsApiFp(this.configuration).createEnterpriseScaleSet(enterpriseID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Create organization scale set with the parameters given. + * @param {string} orgID Organization ID. + * @param {CreateScaleSetParams} body Parameters used when creating the organization scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScalesetsApi + */ + public createOrgScaleSet(orgID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig) { + return ScalesetsApiFp(this.configuration).createOrgScaleSet(orgID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Create repository scale set with the parameters given. + * @param {string} repoID Repository ID. + * @param {CreateScaleSetParams} body Parameters used when creating the repository scale set. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScalesetsApi + */ + public createRepoScaleSet(repoID: string, body: CreateScaleSetParams, options?: RawAxiosRequestConfig) { + return ScalesetsApiFp(this.configuration).createRepoScaleSet(repoID, body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Delete scale set by ID. + * @param {string} scalesetID ID of the scale set to delete. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScalesetsApi + */ + public deleteScaleSet(scalesetID: string, options?: RawAxiosRequestConfig) { + return ScalesetsApiFp(this.configuration).deleteScaleSet(scalesetID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get scale set by ID. + * @param {string} scalesetID ID of the scale set to fetch. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScalesetsApi + */ + public getScaleSet(scalesetID: string, options?: RawAxiosRequestConfig) { + return ScalesetsApiFp(this.configuration).getScaleSet(scalesetID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List enterprise scale sets. + * @param {string} enterpriseID Enterprise ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScalesetsApi + */ + public listEnterpriseScaleSets(enterpriseID: string, options?: RawAxiosRequestConfig) { + return ScalesetsApiFp(this.configuration).listEnterpriseScaleSets(enterpriseID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List organization scale sets. + * @param {string} orgID Organization ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScalesetsApi + */ + public listOrgScaleSets(orgID: string, options?: RawAxiosRequestConfig) { + return ScalesetsApiFp(this.configuration).listOrgScaleSets(orgID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List repository scale sets. + * @param {string} repoID Repository ID. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScalesetsApi + */ + public listRepoScaleSets(repoID: string, options?: RawAxiosRequestConfig) { + return ScalesetsApiFp(this.configuration).listRepoScaleSets(repoID, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary List all scalesets. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScalesetsApi + */ + public listScalesets(options?: RawAxiosRequestConfig) { + return ScalesetsApiFp(this.configuration).listScalesets(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update scale set by ID. + * @param {string} scalesetID ID of the scale set to update. + * @param {UpdateScaleSetParams} body Parameters to update the scale set with. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ScalesetsApi + */ + public updateScaleSet(scalesetID: string, body: UpdateScaleSetParams, options?: RawAxiosRequestConfig) { + return ScalesetsApiFp(this.configuration).updateScaleSet(scalesetID, body, options).then((request) => request(this.axios, this.basePath)); + } +} + + + diff --git a/webapp/src/lib/api/generated/base.ts b/webapp/src/lib/api/generated/base.ts new file mode 100644 index 00000000..2fa2314d --- /dev/null +++ b/webapp/src/lib/api/generated/base.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Garm API. + * The Garm API generated using go-swagger. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from './configuration'; +// Some imports not used depending on template conditions +// @ts-ignore +import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; +import globalAxios from 'axios'; + +export const BASE_PATH = "/api/v1".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: RawAxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath ?? basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + constructor(public field: string, msg?: string) { + super(msg); + this.name = "RequiredError" + } +} + +interface ServerMap { + [key: string]: { + url: string, + description: string, + }[]; +} + +/** + * + * @export + */ +export const operationServerMap: ServerMap = { +} diff --git a/webapp/src/lib/api/generated/common.ts b/webapp/src/lib/api/generated/common.ts new file mode 100644 index 00000000..a1ef3fb4 --- /dev/null +++ b/webapp/src/lib/api/generated/common.ts @@ -0,0 +1,150 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Garm API. + * The Garm API generated using go-swagger. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Configuration } from "./configuration"; +import type { RequestArgs } from "./base"; +import type { AxiosInstance, AxiosResponse } from 'axios'; +import { RequiredError } from "./base"; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void { + if (parameter == null) return; + if (typeof parameter === "object") { + if (Array.isArray(parameter)) { + (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key)); + } + else { + Object.keys(parameter).forEach(currentKey => + setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`) + ); + } + } + else { + if (urlSearchParams.has(key)) { + urlSearchParams.append(key, parameter); + } + else { + urlSearchParams.set(key, parameter); + } + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + setFlattenedQueryParams(searchParams, objects); + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/webapp/src/lib/api/generated/configuration.ts b/webapp/src/lib/api/generated/configuration.ts new file mode 100644 index 00000000..d71ed227 --- /dev/null +++ b/webapp/src/lib/api/generated/configuration.ts @@ -0,0 +1,115 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Garm API. + * The Garm API generated using go-swagger. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + serverIndex?: number; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * override server index + * + * @type {number} + * @memberof Configuration + */ + serverIndex?: number; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.serverIndex = param.serverIndex; + this.baseOptions = { + ...param.baseOptions, + headers: { + ...param.baseOptions?.headers, + }, + }; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/webapp/src/lib/api/generated/index.ts b/webapp/src/lib/api/generated/index.ts new file mode 100644 index 00000000..c5c83e0c --- /dev/null +++ b/webapp/src/lib/api/generated/index.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Garm API. + * The Garm API generated using go-swagger. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; + diff --git a/webapp/src/lib/components/ActionButton.svelte b/webapp/src/lib/components/ActionButton.svelte new file mode 100644 index 00000000..61236bd1 --- /dev/null +++ b/webapp/src/lib/components/ActionButton.svelte @@ -0,0 +1,68 @@ + + + \ No newline at end of file diff --git a/webapp/src/lib/components/Badge.svelte b/webapp/src/lib/components/Badge.svelte new file mode 100644 index 00000000..cd75174f --- /dev/null +++ b/webapp/src/lib/components/Badge.svelte @@ -0,0 +1,48 @@ + + + + {text} + \ No newline at end of file diff --git a/webapp/src/lib/components/Button.svelte b/webapp/src/lib/components/Button.svelte new file mode 100644 index 00000000..3f98d4dc --- /dev/null +++ b/webapp/src/lib/components/Button.svelte @@ -0,0 +1,82 @@ + + + \ No newline at end of file diff --git a/webapp/src/lib/components/ControllerInfoCard.svelte b/webapp/src/lib/components/ControllerInfoCard.svelte new file mode 100644 index 00000000..36533d64 --- /dev/null +++ b/webapp/src/lib/components/ControllerInfoCard.svelte @@ -0,0 +1,403 @@ + + +
                +
                + +
                +
                +
                + + + +
                +
                +

                Controller Information

                +
                + + v{controllerInfo.version?.replace(/^v/, '') || 'Unknown'} + +
                +
                +
                + + +
                + + +
                + +
                +
                +

                Identity

                +
                + +
                +
                Controller ID
                +
                + {controllerInfo.controller_id} +
                +
                + + +
                +
                Hostname
                +
                + {controllerInfo.hostname || 'Unknown'} +
                +
                + + +
                +
                +
                Job Age Backoff
                +
                + +
                +
                +
                + {controllerInfo.minimum_job_age_backoff || 30}s +
                +
                +
                +
                +
                + + +
                +
                +

                Integration URLs

                +
                + + {#if controllerInfo.metadata_url} +
                +
                +
                Metadata
                +
                + +
                +
                +
                + {controllerInfo.metadata_url} +
                +
                + {/if} + + + {#if controllerInfo.callback_url} +
                +
                +
                Callback
                +
                + +
                +
                +
                + {controllerInfo.callback_url} +
                +
                + {/if} + + + {#if controllerInfo.webhook_url} +
                +
                +
                Webhook
                +
                + +
                +
                +
                + {controllerInfo.webhook_url} +
                +
                + {/if} + + + {#if !controllerInfo.metadata_url && !controllerInfo.callback_url && !controllerInfo.webhook_url} +
                + + + +

                No URLs configured

                + +
                + {/if} +
                +
                +
                +
                + + + {#if controllerInfo.controller_webhook_url} +
                +
                +
                Controller Webhook URL
                +
                + +
                +
                +
                +
                +
                + + + +
                +
                + + {controllerInfo.controller_webhook_url} + +

                + Use this URL in your GitHub organization/repository webhook settings +

                +
                +
                +
                +
                + {/if} +
                +
                + + +{#if showSettingsModal} + +
                +

                Controller Settings

                + +
                + +
                + + + {#if !isValidUrl(metadataUrl)} +

                Please enter a valid URL

                + {/if} +

                + URL where runners can fetch metadata and setup information +

                +
                + + +
                + + + {#if !isValidUrl(callbackUrl)} +

                Please enter a valid URL

                + {/if} +

                + URL where runners send status updates and lifecycle events +

                +
                + + +
                + + + {#if !isValidUrl(webhookUrl)} +

                Please enter a valid URL

                + {/if} +

                + URL where GitHub/Gitea will send webhook events for job notifications +

                +
                + + +
                + + +

                + Time to wait before spinning up a runner for a new job (0 = immediate) +

                +
                + + +
                + + +
                +
                +
                +
                +{/if} \ No newline at end of file diff --git a/webapp/src/lib/components/CreateEnterpriseModal.svelte b/webapp/src/lib/components/CreateEnterpriseModal.svelte new file mode 100644 index 00000000..7e1b2f35 --- /dev/null +++ b/webapp/src/lib/components/CreateEnterpriseModal.svelte @@ -0,0 +1,213 @@ + + + dispatch('close')}> +
                +

                Create Enterprise

                +

                + Enterprises are only available for GitHub endpoints. +

                + + {#if error} +
                +

                {error}

                +
                + {/if} + + {#if loading} +
                +
                +

                Loading...

                +
                + {:else} +
                + +
                + + +
                + + +
                + + + {#if credentialsLoading} +

                + Loading credentials... +

                + {:else if filteredCredentials.length === 0} +

                + No GitHub credentials found. Please create GitHub credentials first. +

                + {/if} +
                + + +
                +
                + +
                + + + + +
                +
                + +
                + + +
                + + +

                + You'll need to manually configure this secret in GitHub's enterprise webhook settings. +

                +
                + + +
                + + +
                +
                + {/if} +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/CreateOrganizationModal.svelte b/webapp/src/lib/components/CreateOrganizationModal.svelte new file mode 100644 index 00000000..9a91abba --- /dev/null +++ b/webapp/src/lib/components/CreateOrganizationModal.svelte @@ -0,0 +1,271 @@ + + + dispatch('close')}> +
                +

                Create Organization

                + + {#if error} +
                +

                {error}

                +
                + {/if} + + {#if loading} +
                +
                +

                Loading...

                +
                + {:else} +
                + + + + +
                + + +
                + + +
                + + +
                + + +
                +
                + +
                + + + + +
                +
                + +
                + + +
                +
                + + +
                + +
                +
                + + +
                + + {#if !generateWebhookSecret} + + {:else} +

                + Webhook secret will be automatically generated +

                + {/if} +
                +
                + + +
                + + +
                + + {/if} +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/CreatePoolModal.svelte b/webapp/src/lib/components/CreatePoolModal.svelte new file mode 100644 index 00000000..36ce3179 --- /dev/null +++ b/webapp/src/lib/components/CreatePoolModal.svelte @@ -0,0 +1,541 @@ + + + dispatch('close')}> +
                +
                +

                Create New Pool

                +
                + +
                + {#if error} +
                +

                {error}

                +
                + {/if} + + +
                + + Entity Level * + +
                + + + +
                +
                + + {#if entityLevel} + +
                +

                + Entity & Provider Configuration +

                +
                +
                + + {#if loadingEntities} +
                + {:else} + + {/if} +
                +
                + + {#if loadingProviders} +
                + {:else} + + {/if} +
                +
                +
                + + +
                +

                + Image & OS Configuration +

                +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                +
                + + +
                +

                + Runner Limits & Timing +

                +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                +
                + + +
                +

                + Advanced Settings +

                +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                + + +
                + +
                +
                + + +
                + {#if tags.length > 0} +
                + {#each tags as tag, index} + + {tag} + + + {/each} +
                + {/if} +
                +
                + + +
                + + Extra Specs (JSON) + + +
                + + +
                + + +
                +
                + {/if} + + +
                + + +
                +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/CreateRepositoryModal.svelte b/webapp/src/lib/components/CreateRepositoryModal.svelte new file mode 100644 index 00000000..28ff4065 --- /dev/null +++ b/webapp/src/lib/components/CreateRepositoryModal.svelte @@ -0,0 +1,294 @@ + + + dispatch('close')}> +
                +

                Create Repository

                + + {#if error} +
                +

                {error}

                +
                + {/if} + + {#if loading} +
                +
                +

                Loading...

                +
                + {:else} +
                + + + + +
                + + +
                + + +
                + + +
                + + +
                + + +
                + + +
                +
                + +
                + + + + +
                +
                + +
                + + +
                +
                + + +
                + +
                +
                + + +
                + + {#if !generateWebhookSecret} + + {:else} +

                + Webhook secret will be automatically generated +

                + {/if} +
                +
                + + +
                + + +
                + + {/if} +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/CreateScaleSetModal.svelte b/webapp/src/lib/components/CreateScaleSetModal.svelte new file mode 100644 index 00000000..2711ba09 --- /dev/null +++ b/webapp/src/lib/components/CreateScaleSetModal.svelte @@ -0,0 +1,472 @@ + + + dispatch('close')}> +
                +
                +

                Create New Scale Set

                +

                Scale sets are only available for GitHub endpoints

                +
                + +
                + {#if error} +
                +

                {error}

                +
                + {/if} + + +
                + + +
                + + +
                +
                + + Entity Level * + +
                + + + +
                +
                +
                + + {#if entityLevel} + +
                +

                + Entity & Provider Configuration +

                +
                +
                + + {#if loadingEntities} +
                + {:else} + + {/if} +
                +
                + + {#if loadingProviders} +
                + {:else} + + {/if} +
                +
                +
                + + +
                +

                + Image & OS Configuration +

                +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                +
                + + +
                +

                + Runner Limits & Timing +

                +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                +
                + + +
                +

                + Advanced Settings +

                +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                + Extra Specs (JSON) +
                + +
                + + +
                + + +
                +
                + {/if} + + +
                + + +
                +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/DataTable.svelte b/webapp/src/lib/components/DataTable.svelte new file mode 100644 index 00000000..4723420c --- /dev/null +++ b/webapp/src/lib/components/DataTable.svelte @@ -0,0 +1,237 @@ + + +
                + {#if showSearch} + + {/if} + +
                + {#if loading} + + {:else if error} + + {:else if data.length === 0} + + {:else} + {#if showMobileCards} + +
                + {#each data as item, index (item.id || item.name || index)} +
                + {#if mobileCardConfig} + + {#key `${item.id || item.name}-${item.updated_at}-mobile`} + + {/key} + {:else} + + + {/if} +
                + {/each} +
                + {/if} + + + + {/if} + + {#if showPagination && !loading && !error && data.length > 0} + + {/if} +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/DeleteModal.svelte b/webapp/src/lib/components/DeleteModal.svelte new file mode 100644 index 00000000..88a0922d --- /dev/null +++ b/webapp/src/lib/components/DeleteModal.svelte @@ -0,0 +1,57 @@ + + + dispatch('close')}> +
                +
                + + + +
                + +
                +

                {title}

                +
                +

                {message}

                + {#if itemName} +

                {itemName}

                + {/if} +
                +
                + +
                + + +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/DetailHeader.svelte b/webapp/src/lib/components/DetailHeader.svelte new file mode 100644 index 00000000..3d675b4d --- /dev/null +++ b/webapp/src/lib/components/DetailHeader.svelte @@ -0,0 +1,56 @@ + + +
                +
                +
                +
                + {#if forgeIcon} +
                + {@html forgeIcon} +
                + {/if} +
                +

                {title}

                +

                + {subtitle} +

                +
                +
                + {#if onEdit || onDelete} +
                + {#if onEdit} + + {/if} + {#if onDelete} + + {/if} +
                + {/if} +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/EmptyState.svelte b/webapp/src/lib/components/EmptyState.svelte new file mode 100644 index 00000000..51eaee9d --- /dev/null +++ b/webapp/src/lib/components/EmptyState.svelte @@ -0,0 +1,37 @@ + + +
                + {#if iconType === 'document'} + + + + {:else if iconType === 'building'} + + + + {:else if iconType === 'users'} + + + + {:else if iconType === 'cog'} + + + + + {:else if iconType === 'key'} + + + + {:else if iconType === 'settings'} + + + + + {/if} +

                {title}

                +

                {message}

                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/EntityInformation.svelte b/webapp/src/lib/components/EntityInformation.svelte new file mode 100644 index 00000000..98977052 --- /dev/null +++ b/webapp/src/lib/components/EntityInformation.svelte @@ -0,0 +1,103 @@ + + +
                +
                +

                {getEntityTitle()}

                +
                +
                +
                ID
                +
                {entity.id}
                +
                +
                +
                Created At
                +
                {formatDate(entity.created_at)}
                +
                +
                +
                Updated At
                +
                {formatDate(entity.updated_at)}
                +
                +
                +
                Status
                +
                + {#if entity.pool_manager_status?.running} + + {:else} + + {/if} +
                +
                +
                +
                Pool Balancer Type
                +
                {getPoolBalancerDisplay()}
                +
                +
                +
                {getUrlLabel()}
                +
                + + {getEntityUrl()} + + + + +
                +
                +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/ErrorState.svelte b/webapp/src/lib/components/ErrorState.svelte new file mode 100644 index 00000000..ee42c73e --- /dev/null +++ b/webapp/src/lib/components/ErrorState.svelte @@ -0,0 +1,37 @@ + + +
                +
                +
                +
                + + + +
                +
                +

                {title}

                +

                {message}

                + {#if showRetry && onRetry} +
                + +
                + {/if} +
                +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/EventsSection.svelte b/webapp/src/lib/components/EventsSection.svelte new file mode 100644 index 00000000..0c17ef65 --- /dev/null +++ b/webapp/src/lib/components/EventsSection.svelte @@ -0,0 +1,47 @@ + + +{#if events && events.length > 0} +
                +
                +

                Events

                +
                + {#each events as event} +
                +
                +

                {event.message}

                +
                + {#if (event.event_level || 'info').toLowerCase() === 'error'} + + {:else if (event.event_level || 'info').toLowerCase() === 'warning'} + + {:else} + + {/if} + {formatDate(event.created_at)} +
                +
                +
                + {/each} +
                +
                +
                +{:else} +
                +
                +

                Events

                +
                + + + +

                No events available

                +
                +
                +
                +{/if} \ No newline at end of file diff --git a/webapp/src/lib/components/ForgeTypeSelector.svelte b/webapp/src/lib/components/ForgeTypeSelector.svelte new file mode 100644 index 00000000..68dbe187 --- /dev/null +++ b/webapp/src/lib/components/ForgeTypeSelector.svelte @@ -0,0 +1,40 @@ + + +
                + + {label} + +
                + + +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/Icons.svelte b/webapp/src/lib/components/Icons.svelte new file mode 100644 index 00000000..c38fadfe --- /dev/null +++ b/webapp/src/lib/components/Icons.svelte @@ -0,0 +1,51 @@ + + + + {@html iconPath} + \ No newline at end of file diff --git a/webapp/src/lib/components/InstancesSection.svelte b/webapp/src/lib/components/InstancesSection.svelte new file mode 100644 index 00000000..b17c4606 --- /dev/null +++ b/webapp/src/lib/components/InstancesSection.svelte @@ -0,0 +1,114 @@ + + +
                +
                +
                +

                Instances ({instances.length})

                + View all instances +
                + +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/JsonEditor.svelte b/webapp/src/lib/components/JsonEditor.svelte new file mode 100644 index 00000000..443c6e25 --- /dev/null +++ b/webapp/src/lib/components/JsonEditor.svelte @@ -0,0 +1,48 @@ + + +
                + + + {#if !isValidJson} +
                + + + +
                + {/if} +
                \ No newline at end of file diff --git a/webapp/src/lib/components/LoadingState.svelte b/webapp/src/lib/components/LoadingState.svelte new file mode 100644 index 00000000..0a9985c2 --- /dev/null +++ b/webapp/src/lib/components/LoadingState.svelte @@ -0,0 +1,8 @@ + + +
                +
                +

                {message}

                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/MobileCard.svelte b/webapp/src/lib/components/MobileCard.svelte new file mode 100644 index 00000000..d17ef66c --- /dev/null +++ b/webapp/src/lib/components/MobileCard.svelte @@ -0,0 +1,254 @@ + + +
                +
                + {#if config.primaryText.isClickable} + +

                + {getPrimaryText()} +

                + {#if config.secondaryText} +

                + {getSecondaryText()} +

                + {/if} +
                + {:else} +
                +

                + {getPrimaryText()} +

                + {#if config.secondaryText} +

                + {getSecondaryText()} +

                + {/if} +
                + {/if} + + {#if config.customInfo || config.badges?.some(b => b.type === 'forge')} +
                + {#if config.customInfo} + {#each config.customInfo as info} + {@const iconHtml = typeof info.icon === 'function' ? info.icon(item) : info.icon} + {@const text = typeof info.text === 'function' ? info.text(item) : info.text} +
                + {#if iconHtml} + {@html iconHtml} + {/if} + {text} +
                + {/each} + {/if} + + {#if config.badges} + {#each config.badges.filter(b => b.type === 'forge') as badge} +
                + {@html getForgeIcon(badge.field ? (item?.[badge.field] || 'unknown') : (item?.endpoint?.endpoint_type || 'unknown'))} + + {item?.endpoint?.name || 'Unknown'} + +
                + {/each} + {/if} +
                + {/if} +
                + +
                + {#if config.badges} + {#each config.badges.filter(b => b.type !== 'forge') as badge} + {#if badge.type === 'status'} + {@const badgeProps = getBadgeProps(badge)} + + {badgeProps.text} + + {:else} + {@const badgeProps = getBadgeProps(badge)} + + {/if} + {/each} + {/if} + + {#if config.actions} +
                + {#each config.actions as action} + handleAction(action.type)} + /> + {/each} +
                + {/if} +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/Modal.svelte b/webapp/src/lib/components/Modal.svelte new file mode 100644 index 00000000..b446f2ee --- /dev/null +++ b/webapp/src/lib/components/Modal.svelte @@ -0,0 +1,40 @@ + + + diff --git a/webapp/src/lib/components/Navigation.svelte b/webapp/src/lib/components/Navigation.svelte new file mode 100644 index 00000000..1b8b5b06 --- /dev/null +++ b/webapp/src/lib/components/Navigation.svelte @@ -0,0 +1,406 @@ + + + + + + +
                +
                + + + + +
                + GARM + GARM +

                GARM

                + + +
                + {#if wsState.connected} +
                +
                +
                + {:else if wsState.connecting} +
                +
                +
                + {:else if wsState.error} +
                +
                +
                + {:else} +
                +
                +
                + {/if} +
                +
                + + + +
                + + + {#if mobileMenuOpen} + + {/if} +
                + + +{#if userMenuOpen} +
                userMenuOpen = false} on:keydown={(e) => { if (e.key === 'Escape') userMenuOpen = false; }} role="button" tabindex="0" aria-label="Close user menu">
                +{/if} \ No newline at end of file diff --git a/webapp/src/lib/components/PageHeader.svelte b/webapp/src/lib/components/PageHeader.svelte new file mode 100644 index 00000000..4ac247af --- /dev/null +++ b/webapp/src/lib/components/PageHeader.svelte @@ -0,0 +1,39 @@ + + + +
                +
                +

                {title}

                +

                + {description} +

                +
                + {#if showAction && actionLabel} +
                + +
                + {/if} +
                \ No newline at end of file diff --git a/webapp/src/lib/components/PoolsSection.svelte b/webapp/src/lib/components/PoolsSection.svelte new file mode 100644 index 00000000..8ff740fa --- /dev/null +++ b/webapp/src/lib/components/PoolsSection.svelte @@ -0,0 +1,136 @@ + + +
                +
                +
                +

                Pools ({pools.length})

                + View all pools +
                + {#if pools.length === 0} + +
                + + + + +

                No pools configured

                +

                No pools configured for this {entityType}.

                +
                + +
                +
                + {:else} + + {/if} +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/SearchBar.svelte b/webapp/src/lib/components/SearchBar.svelte new file mode 100644 index 00000000..bc051b14 --- /dev/null +++ b/webapp/src/lib/components/SearchBar.svelte @@ -0,0 +1,30 @@ + + +
                +
                + +
                + +
                \ No newline at end of file diff --git a/webapp/src/lib/components/SearchFilterBar.svelte b/webapp/src/lib/components/SearchFilterBar.svelte new file mode 100644 index 00000000..fab0288c --- /dev/null +++ b/webapp/src/lib/components/SearchFilterBar.svelte @@ -0,0 +1,55 @@ + + +
                +
                +
                +
                + + +
                +
                + {#if showPerPageSelector} +
                +
                + + +
                +
                + {/if} +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/TablePagination.svelte b/webapp/src/lib/components/TablePagination.svelte new file mode 100644 index 00000000..f5cb0d96 --- /dev/null +++ b/webapp/src/lib/components/TablePagination.svelte @@ -0,0 +1,98 @@ + + +{#if totalPages > 1} +
                + +
                + + +
                + + + +
                +{/if} \ No newline at end of file diff --git a/webapp/src/lib/components/Toast.svelte b/webapp/src/lib/components/Toast.svelte new file mode 100644 index 00000000..02197e34 --- /dev/null +++ b/webapp/src/lib/components/Toast.svelte @@ -0,0 +1,107 @@ + + + +
                + {#each toasts as toast (toast.id)} +
                +
                +
                + {@html getToastIcon(toast.type)} +
                +
                +

                + {toast.title} +

                + {#if toast.message} +
                + {toast.message} +
                + {/if} +
                +
                + +
                +
                +
                + {/each} +
                \ No newline at end of file diff --git a/webapp/src/lib/components/Tooltip.svelte b/webapp/src/lib/components/Tooltip.svelte new file mode 100644 index 00000000..7071bf45 --- /dev/null +++ b/webapp/src/lib/components/Tooltip.svelte @@ -0,0 +1,29 @@ + + +
                + + + + + + +
                \ No newline at end of file diff --git a/webapp/src/lib/components/UpdateEnterpriseModal.svelte b/webapp/src/lib/components/UpdateEnterpriseModal.svelte new file mode 100644 index 00000000..839fd927 --- /dev/null +++ b/webapp/src/lib/components/UpdateEnterpriseModal.svelte @@ -0,0 +1,207 @@ + + + dispatch('close')}> +
                +
                +

                Update Enterprise

                +

                {enterprise.name}

                +
                + +
                + + {#if error} +
                +

                {error}

                +
                + {/if} + + {#if loading} +
                +
                +

                Loading...

                +
                + {:else} +
                + +
                + + +

                + Only showing credentials for GitHub endpoints +

                +
                + + +
                + + +
                + + +
                +
                + + +
                + + {#if changeWebhookSecret} +
                +
                + + +
                + {#if !generateWebhookSecret} + + {:else} +

                + A new webhook secret will be automatically generated +

                + {/if} +
                + {/if} +
                + + +
                + + +
                +
                + {/if} +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/UpdateEntityModal.svelte b/webapp/src/lib/components/UpdateEntityModal.svelte new file mode 100644 index 00000000..c2b80c34 --- /dev/null +++ b/webapp/src/lib/components/UpdateEntityModal.svelte @@ -0,0 +1,265 @@ + + + dispatch('close')}> +
                +
                +

                Update {getEntityTitle()}

                +

                {getEntityDisplayName()}

                +
                + +
                + {#if error} +
                +

                {error}

                +
                + {/if} + + +
                +

                {getEntityTitle()} Information

                +
                + {#if entityType === 'repository'} +
                + Owner: + {getOwner()} +
                + {/if} +
                + Name: + {entity.name} +
                +
                + Endpoint: + {entity.endpoint?.name} +
                +
                + Current Credentials: + {entity.credentials_name} +
                +
                + Current Pool Balancer: + {entity.pool_balancing_type || 'roundrobin'} +
                +
                +
                + +
                + +
                + + {#if loadingCredentials} +
                + {:else} + + {/if} +

                + Leave unchanged to keep current credentials +

                +
                + + +
                + + +

                + Round Robin distributes jobs evenly across pools, Pack fills pools in order +

                +
                + + +
                +
                + + +
                + + {#if changeWebhookSecret} +
                + + +

                + Leave empty to auto-generate a new secret +

                +
                + {/if} +
                +
                + + +
                + + +
                +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/UpdateOrganizationModal.svelte b/webapp/src/lib/components/UpdateOrganizationModal.svelte new file mode 100644 index 00000000..848804f5 --- /dev/null +++ b/webapp/src/lib/components/UpdateOrganizationModal.svelte @@ -0,0 +1,210 @@ + + + dispatch('close')}> +
                +
                +

                Update Organization

                +

                {organization.name}

                +
                + +
                + + {#if error} +
                +

                {error}

                +
                + {/if} + + {#if loading} +
                +
                +

                Loading...

                +
                + {:else} +
                + +
                + + +

                + Only showing credentials for {organizationEndpointType} endpoints +

                +
                + + +
                + + +
                + + +
                +
                + + +
                + + {#if changeWebhookSecret} +
                +
                + + +
                + {#if !generateWebhookSecret} + + {:else} +

                + A new webhook secret will be automatically generated +

                + {/if} +
                + {/if} +
                + + +
                + + +
                +
                + {/if} +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/UpdatePoolModal.svelte b/webapp/src/lib/components/UpdatePoolModal.svelte new file mode 100644 index 00000000..cbd85d8e --- /dev/null +++ b/webapp/src/lib/components/UpdatePoolModal.svelte @@ -0,0 +1,426 @@ + + + dispatch('close')}> +
                +
                +

                + Update Pool {pool.id} +

                +
                + +
                + {#if error} +
                +

                {error}

                +
                + {/if} + + +
                +

                Pool Information (Read-only)

                +
                +
                + Provider: + {pool.provider_name} +
                +
                + Entity: + + {getEntityType(pool)}: {getEntityName(pool)} + +
                +
                +
                + + +
                +

                + Image & OS Configuration +

                +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                +
                + + +
                +

                + Runner Limits & Timing +

                +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                +
                + + +
                +

                + Advanced Settings +

                +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                + + Tags + +
                +
                + + +
                + {#if tags.length > 0} +
                + {#each tags as tag, index} + + {tag} + + + {/each} +
                + {/if} +
                +
                +
                + + +
                +
                + + Extra Specs (JSON) + + +
                +
                + + +
                + + +
                +
                + + +
                + + +
                +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/UpdateRepositoryModal.svelte b/webapp/src/lib/components/UpdateRepositoryModal.svelte new file mode 100644 index 00000000..e5b209a9 --- /dev/null +++ b/webapp/src/lib/components/UpdateRepositoryModal.svelte @@ -0,0 +1,146 @@ + + + dispatch('close')}> +
                +
                +

                Update Repository

                +

                {repository.owner}/{repository.name}

                +
                + +
                + {#if error} +
                +

                {error}

                +
                + {/if} + + +
                +

                Repository Information

                +
                +
                + Owner: + {repository.owner} +
                +
                + Name: + {repository.name} +
                +
                + Endpoint: + {repository.endpoint?.name} +
                +
                + Credentials: + {repository.credentials_name} +
                +
                +
                + + +
                +
                + + +
                + + {#if changeWebhookSecret} +
                + + +

                + Leave empty to auto-generate a new secret +

                +
                + {/if} +
                + + +
                + + +
                +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/UpdateScaleSetModal.svelte b/webapp/src/lib/components/UpdateScaleSetModal.svelte new file mode 100644 index 00000000..73a31d63 --- /dev/null +++ b/webapp/src/lib/components/UpdateScaleSetModal.svelte @@ -0,0 +1,339 @@ + + + dispatch('close')}> +
                +
                +

                + Update Scale Set {scaleSet.name} +

                +
                + +
                + {#if error} +
                +

                {error}

                +
                + {/if} + + +
                +

                Scale Set Information

                +
                +
                + Provider: + {scaleSet.provider_name} +
                +
                + Entity: + + {#if scaleSet.repo_name}Repository: {scaleSet.repo_name} + {:else if scaleSet.org_name}Organization: {scaleSet.org_name} + {:else if scaleSet.enterprise_name}Enterprise: {scaleSet.enterprise_name} + {:else}Unknown Entity{/if} + +
                +
                +
                + + +
                + + +
                + + +
                +

                + Image & OS Configuration +

                +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                +
                + + +
                +

                + Runner Limits & Timing +

                +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                +
                + + +
                +

                + Advanced Settings +

                +
                +
                + + +
                +
                + + +
                +
                + + +
                +
                + + Extra Specs (JSON) + + +
                +
                + + +
                + + +
                +
                + + +
                + + +
                +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/WebhookSection.svelte b/webapp/src/lib/components/WebhookSection.svelte new file mode 100644 index 00000000..4d263935 --- /dev/null +++ b/webapp/src/lib/components/WebhookSection.svelte @@ -0,0 +1,172 @@ + + +
                +
                +
                +
                +

                + Webhook Status +

                +
                + {#if checking} +
                +
                + Checking... +
                + {:else if isInstalled} +
                + + + + Webhook installed +
                + {#if webhookInfo} +
                + URL: {webhookInfo.url || 'N/A'} +
                + {/if} + {:else} +
                + + + + No webhook installed +
                + {/if} +
                +
                + +
                + {#if !checking} + {#if isInstalled} + + {:else} + + {/if} + {/if} +
                +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/cells/ActionsCell.svelte b/webapp/src/lib/components/cells/ActionsCell.svelte new file mode 100644 index 00000000..f79df481 --- /dev/null +++ b/webapp/src/lib/components/cells/ActionsCell.svelte @@ -0,0 +1,46 @@ + + +
                + {#each actions as action} + handleAction(action.type)} + /> + {/each} +
                \ No newline at end of file diff --git a/webapp/src/lib/components/cells/EndpointCell.svelte b/webapp/src/lib/components/cells/EndpointCell.svelte new file mode 100644 index 00000000..0978b249 --- /dev/null +++ b/webapp/src/lib/components/cells/EndpointCell.svelte @@ -0,0 +1,15 @@ + + +
                +
                + {@html getForgeIcon(item?.endpoint?.endpoint_type || item?.endpoint_type || 'unknown', iconSize)} +
                +
                + {item?.endpoint?.name || item?.endpoint_name || item?.github_endpoint_name || 'Unknown'} +
                +
                \ No newline at end of file diff --git a/webapp/src/lib/components/cells/EntityCell.svelte b/webapp/src/lib/components/cells/EntityCell.svelte new file mode 100644 index 00000000..f81d4cf9 --- /dev/null +++ b/webapp/src/lib/components/cells/EntityCell.svelte @@ -0,0 +1,84 @@ + + +
                + + {entityName} + + {#if entityType === 'instance' && item?.provider_id} +
                + {item.provider_id} +
                + {/if} +
                \ No newline at end of file diff --git a/webapp/src/lib/components/cells/GenericCell.svelte b/webapp/src/lib/components/cells/GenericCell.svelte new file mode 100644 index 00000000..edbca9f1 --- /dev/null +++ b/webapp/src/lib/components/cells/GenericCell.svelte @@ -0,0 +1,59 @@ + + +{#if type === 'code'} + + {displayValue} + +{:else} + + {displayValue} + +{/if} \ No newline at end of file diff --git a/webapp/src/lib/components/cells/InstancePoolCell.svelte b/webapp/src/lib/components/cells/InstancePoolCell.svelte new file mode 100644 index 00000000..cadd9c17 --- /dev/null +++ b/webapp/src/lib/components/cells/InstancePoolCell.svelte @@ -0,0 +1,19 @@ + + +
                +{#if item?.pool_id} + + Pool: {item.pool_id} + +{:else if item?.scale_set_id} + + Scale Set: {item.scale_set_id} + +{:else} + - +{/if} +
                diff --git a/webapp/src/lib/components/cells/PoolEntityCell.svelte b/webapp/src/lib/components/cells/PoolEntityCell.svelte new file mode 100644 index 00000000..0861d11c --- /dev/null +++ b/webapp/src/lib/components/cells/PoolEntityCell.svelte @@ -0,0 +1,16 @@ + + +
                + + {getEntityName(item, eagerCache)} + + + {getEntityType(item)} + +
                \ No newline at end of file diff --git a/webapp/src/lib/components/cells/StatusCell.svelte b/webapp/src/lib/components/cells/StatusCell.svelte new file mode 100644 index 00000000..5526d307 --- /dev/null +++ b/webapp/src/lib/components/cells/StatusCell.svelte @@ -0,0 +1,118 @@ + + +{#key `${item?.name || 'item'}-${item?.[statusField] || 'status'}-${item?.updated_at || 'time'}`} + +{/key} \ No newline at end of file diff --git a/webapp/src/lib/components/cells/index.ts b/webapp/src/lib/components/cells/index.ts new file mode 100644 index 00000000..b54e5f74 --- /dev/null +++ b/webapp/src/lib/components/cells/index.ts @@ -0,0 +1,8 @@ +export { default as EntityCell } from './EntityCell.svelte'; +export { default as EndpointCell } from './EndpointCell.svelte'; +export { default as StatusCell } from './StatusCell.svelte'; +export { default as ActionsCell } from './ActionsCell.svelte'; +export { default as GenericCell } from './GenericCell.svelte'; +export { default as PoolEntityCell } from './PoolEntityCell.svelte'; +export { default as InstancePoolCell } from './InstancePoolCell.svelte'; +export { default as MobileCard } from '../MobileCard.svelte'; \ No newline at end of file diff --git a/webapp/src/lib/stores/auth.ts b/webapp/src/lib/stores/auth.ts new file mode 100644 index 00000000..5e5befa4 --- /dev/null +++ b/webapp/src/lib/stores/auth.ts @@ -0,0 +1,281 @@ +import { writable } from 'svelte/store'; +import { browser } from '$app/environment'; +import { garmApi } from '../api/client.js'; + +// Check if we're in development mode (cross-origin setup) +const isDevelopmentMode = () => { + if (!browser) return false; + // Development mode: either VITE_GARM_API_URL is set OR we detect cross-origin + return !!(import.meta.env.VITE_GARM_API_URL) || window.location.port === '5173'; +}; + +interface AuthState { + isAuthenticated: boolean; + user: string | null; + loading: boolean; + needsInitialization: boolean; +} + +const initialState: AuthState = { + isAuthenticated: false, + user: null, + loading: true, + needsInitialization: false +}; + +// Keep using writable store for compatibility with existing API calls +// but enhance with Svelte 5 features where possible +export const authStore = writable(initialState); + +// Cookie utilities +function setCookie(name: string, value: string, days: number = 7): void { + if (!browser) return; + + const expires = new Date(); + expires.setTime(expires.getTime() + (days * 24 * 60 * 60 * 1000)); + document.cookie = `${name}=${value};expires=${expires.toUTCString()};path=/;SameSite=Lax`; +} + +function getCookie(name: string): string | null { + if (!browser) return null; + + const nameEQ = name + "="; + const ca = document.cookie.split(';'); + for (let i = 0; i < ca.length; i++) { + let c = ca[i]; + while (c.charAt(0) === ' ') c = c.substring(1, c.length); + if (c.indexOf(nameEQ) === 0) { + const value = c.substring(nameEQ.length, c.length); + return value; + } + } + return null; +} + +function deleteCookie(name: string): void { + if (!browser) return; + document.cookie = `${name}=;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/`; +} + +// Auth utilities +export const auth = { + async login(username: string, password: string): Promise { + try { + authStore.update(state => ({ ...state, loading: true })); + + const response = await garmApi.login({ username, password }); + + // Store JWT token in cookies for server authentication and set it in the API client + if (browser) { + setCookie('garm_token', response.token); + setCookie('garm_user', username); + } + + // Set the token in the API client for future requests + garmApi.setToken(response.token); + + authStore.set({ + isAuthenticated: true, + user: username, + loading: false, + needsInitialization: false + }); + } catch (error) { + authStore.update(state => ({ ...state, loading: false })); + throw error; + } + }, + + logout(): void { + if (browser) { + deleteCookie('garm_token'); + deleteCookie('garm_user'); + } + + authStore.set({ + isAuthenticated: false, + user: null, + loading: false, + needsInitialization: false + }); + }, + + async init(): Promise { + if (browser) { + try { + authStore.update(state => ({ ...state, loading: true })); + + // First, always check initialization status by doing GET /api/v1/login + await auth.checkInitializationStatus(); + + // If we get here without needsInitialization being set, check for existing auth + const token = getCookie('garm_token'); + const user = getCookie('garm_user'); + + if (token && user) { + // Set the token in the API client for future requests + garmApi.setToken(token); + + // Verify token is still valid + const isValid = await auth.checkAuth(); + if (isValid) { + // Token is valid, set authenticated state + authStore.set({ + isAuthenticated: true, + user, + loading: false, + needsInitialization: false + }); + return; + } + } + + // No valid token, user needs to login (but GARM is initialized) + authStore.update(state => ({ + ...state, + loading: false, + needsInitialization: false + })); + + } catch (error) { + // If checkInitializationStatus threw an error, it should have set needsInitialization + authStore.update(state => ({ ...state, loading: false })); + } + } else { + authStore.update(state => ({ ...state, loading: false })); + } + }, + + // Check initialization status by calling GET /api/v1/login + async checkInitializationStatus(): Promise { + try { + // Make a GET request to /api/v1/login to check status + const headers: Record = { + 'Accept': 'application/json', + }; + + // In development mode, always use Bearer token; in production, prefer cookies + const token = getCookie('garm_token'); + const isDevMode = isDevelopmentMode(); + + if (isDevMode && token) { + headers['Authorization'] = `Bearer ${token}`; + } + + const response = await fetch('/api/v1/login', { + method: 'GET', + headers, + // Only include credentials in production (same-origin) + credentials: isDevMode ? 'omit' : 'include' + }); + + if (!response.ok) { + if (response.status === 409) { + const errorData = await response.json(); + if (errorData.error === 'init_required') { + // GARM needs initialization + authStore.update(state => ({ + ...state, + needsInitialization: true, + loading: false + })); + throw new Error('Initialization required'); + } + } + // For other 4xx/5xx errors, assume GARM is initialized + return; + } + + // GET /api/v1/login succeeded, GARM is initialized + return; + + } catch (error) { + // If it's our initialization error, re-throw it + if (error instanceof Error && error.message === 'Initialization required') { + throw error; + } + // For network errors or other issues, assume GARM is initialized + return; + } + }, + + // Check if token is still valid by making a test API call + async checkAuth(): Promise { + try { + // First check if initialization is still required + await auth.checkInitializationStatus(); + + // If we get here, GARM is initialized, now check if token is valid + await garmApi.getControllerInfo(); + return true; + } catch (error: any) { + // If it's initialization required, the checkInitializationStatus already handled it + if (error instanceof Error && error.message === 'Initialization required') { + return false; + } + + // Check if it's an initialization required error from the API call + if (error?.response?.status === 409 && + error?.response?.data?.error === 'init_required') { + authStore.update(state => ({ + ...state, + needsInitialization: true, + loading: false + })); + return false; + } + + // Token is invalid, logout + auth.logout(); + return false; + } + }, + + // Initialize GARM controller + async initialize( + username: string, + email: string, + password: string, + fullName?: string, + urls?: { + callbackUrl?: string; + metadataUrl?: string; + webhookUrl?: string; + } + ): Promise { + try { + authStore.update(state => ({ ...state, loading: true })); + + // Step 1: Create the admin user + const response = await garmApi.firstRun({ + username, + email, + password, + full_name: fullName || username + }); + + // Step 2: Login with the new credentials + await auth.login(username, password); + + // Step 3: Set controller URLs (similar to garm-cli init) + const currentUrl = window.location.origin; + const finalMetadataUrl = urls?.metadataUrl || `${currentUrl}/api/v1/metadata`; + const finalCallbackUrl = urls?.callbackUrl || `${currentUrl}/api/v1/callbacks`; + const finalWebhookUrl = urls?.webhookUrl || `${currentUrl}/webhooks`; + + await garmApi.updateController({ + metadata_url: finalMetadataUrl, + callback_url: finalCallbackUrl, + webhook_url: finalWebhookUrl + }); + + authStore.update(state => ({ + ...state, + needsInitialization: false + })); + } catch (error) { + authStore.update(state => ({ ...state, loading: false })); + throw error; + } + } +}; \ No newline at end of file diff --git a/webapp/src/lib/stores/eager-cache.ts b/webapp/src/lib/stores/eager-cache.ts new file mode 100644 index 00000000..37835e82 --- /dev/null +++ b/webapp/src/lib/stores/eager-cache.ts @@ -0,0 +1,609 @@ +import { writable, get } from 'svelte/store'; +import { garmApi } from '../api/client.js'; +import { websocketStore, type WebSocketEvent } from './websocket.js'; +import type { + Repository, + Organization, + Enterprise, + Pool, + ScaleSet, + ForgeCredentials, + ForgeEndpoint, + ControllerInfo +} from '../api/generated/api.js'; + +interface EagerCacheState { + repositories: Repository[]; + organizations: Organization[]; + enterprises: Enterprise[]; + pools: Pool[]; + scalesets: ScaleSet[]; + credentials: ForgeCredentials[]; + endpoints: ForgeEndpoint[]; + controllerInfo: ControllerInfo | null; + loading: { + repositories: boolean; + organizations: boolean; + enterprises: boolean; + pools: boolean; + scalesets: boolean; + credentials: boolean; + endpoints: boolean; + controllerInfo: boolean; + }; + loaded: { + repositories: boolean; + organizations: boolean; + enterprises: boolean; + pools: boolean; + scalesets: boolean; + credentials: boolean; + endpoints: boolean; + controllerInfo: boolean; + }; + errorMessages: { + repositories: string; + organizations: string; + enterprises: string; + pools: string; + scalesets: string; + credentials: string; + endpoints: string; + controllerInfo: string; + }; +} + +const initialState: EagerCacheState = { + repositories: [], + organizations: [], + enterprises: [], + pools: [], + scalesets: [], + credentials: [], + endpoints: [], + controllerInfo: null, + loading: { + repositories: false, + organizations: false, + enterprises: false, + pools: false, + scalesets: false, + credentials: false, + endpoints: false, + controllerInfo: false, + }, + loaded: { + repositories: false, + organizations: false, + enterprises: false, + pools: false, + scalesets: false, + credentials: false, + endpoints: false, + controllerInfo: false, + }, + errorMessages: { + repositories: '', + organizations: '', + enterprises: '', + pools: '', + scalesets: '', + credentials: '', + endpoints: '', + controllerInfo: '', + } +}; + +export const eagerCache = writable(initialState); + +class EagerCacheManager { + private unsubscribers: (() => void)[] = []; + private loadingPromises: Map> = new Map(); + private retryAttempts: Map = new Map(); + private readonly MAX_RETRIES = 3; + private readonly RETRY_DELAY_MS = 1000; + private websocketStatusUnsubscriber: (() => void) | null = null; + + async loadResource(resourceType: keyof Omit, priority: boolean = false) { + // Avoid duplicate loading + if (this.loadingPromises.has(resourceType)) { + return this.loadingPromises.get(resourceType); + } + + // Clear any previous error message and set loading state + eagerCache.update(state => ({ + ...state, + loading: { ...state.loading, [resourceType]: true }, + errorMessages: { ...state.errorMessages, [resourceType]: '' } + })); + + const loadPromise = this.attemptLoad(resourceType); + this.loadingPromises.set(resourceType, loadPromise); + + try { + const data = await loadPromise; + eagerCache.update(state => ({ + ...state, + [resourceType]: data, + loading: { ...state.loading, [resourceType]: false }, + loaded: { ...state.loaded, [resourceType]: true }, + errorMessages: { ...state.errorMessages, [resourceType]: '' } + })); + + // Reset retry attempts on success + this.retryAttempts.delete(resourceType); + + // If this is a priority load, start background loading of other resources + if (priority) { + this.startBackgroundLoading(resourceType); + } + + return data; + } catch (error) { + const errorMessage = error instanceof Error ? error.message : 'Failed to load data'; + eagerCache.update(state => ({ + ...state, + loading: { ...state.loading, [resourceType]: false }, + errorMessages: { ...state.errorMessages, [resourceType]: errorMessage } + })); + console.error(`Failed to load ${resourceType}:`, error); + throw error; + } finally { + this.loadingPromises.delete(resourceType); + } + } + + private async attemptLoad(resourceType: keyof Omit): Promise { + const currentAttempt = (this.retryAttempts.get(resourceType) || 0) + 1; + this.retryAttempts.set(resourceType, currentAttempt); + + try { + let loadPromise: Promise; + + switch (resourceType) { + case 'repositories': + loadPromise = garmApi.listRepositories(); + break; + case 'organizations': + loadPromise = garmApi.listOrganizations(); + break; + case 'enterprises': + loadPromise = garmApi.listEnterprises(); + break; + case 'pools': + loadPromise = garmApi.listAllPools(); + break; + case 'scalesets': + loadPromise = garmApi.listScaleSets(); + break; + case 'credentials': + loadPromise = garmApi.listAllCredentials(); + break; + case 'endpoints': + loadPromise = garmApi.listAllEndpoints(); + break; + case 'controllerInfo': + loadPromise = garmApi.getControllerInfo(); + break; + default: + throw new Error(`Unknown resource type: ${resourceType}`); + } + + return await loadPromise; + } catch (error) { + // If we haven't reached max retries, try again with exponential backoff + if (currentAttempt < this.MAX_RETRIES) { + const delay = this.RETRY_DELAY_MS * Math.pow(2, currentAttempt - 1); // Exponential backoff + console.warn(`Attempt ${currentAttempt} failed for ${resourceType}, retrying in ${delay}ms...`, error); + + await new Promise(resolve => setTimeout(resolve, delay)); + return this.attemptLoad(resourceType); + } else { + console.error(`All ${this.MAX_RETRIES} attempts failed for ${resourceType}:`, error); + throw error; + } + } + } + + private async startBackgroundLoading(excludeResource: string) { + const resourceTypes = ['repositories', 'organizations', 'enterprises', 'pools', 'scalesets', 'credentials', 'endpoints']; + const toLoad = resourceTypes.filter(type => type !== excludeResource); + + // Load in background with slight delays to avoid overwhelming the API + for (const resourceType of toLoad) { + setTimeout(() => { + this.loadResource(resourceType as any, false).catch(error => { + console.warn(`Background loading failed for ${resourceType}:`, error); + // Background loading failures are not critical, just log them + }); + }, 100 * toLoad.indexOf(resourceType)); + } + } + + // Public method to manually retry loading a resource + retryResource(resourceType: keyof Omit) { + // Clear any existing retry attempts to start fresh + this.retryAttempts.delete(resourceType); + return this.loadResource(resourceType, true); + } + + setupWebSocketSubscriptions() { + // Clean up existing subscriptions + this.cleanup(); + + // Subscribe to all resource types + const subscriptions = [ + websocketStore.subscribeToEntity('repository', ['create', 'update', 'delete'], this.handleRepositoryEvent.bind(this)), + websocketStore.subscribeToEntity('organization', ['create', 'update', 'delete'], this.handleOrganizationEvent.bind(this)), + websocketStore.subscribeToEntity('enterprise', ['create', 'update', 'delete'], this.handleEnterpriseEvent.bind(this)), + websocketStore.subscribeToEntity('pool', ['create', 'update', 'delete'], this.handlePoolEvent.bind(this)), + websocketStore.subscribeToEntity('scaleset', ['create', 'update', 'delete'], this.handleScaleSetEvent.bind(this)), + websocketStore.subscribeToEntity('controller', ['update'], this.handleControllerEvent.bind(this)), + websocketStore.subscribeToEntity('github_credentials', ['create', 'update', 'delete'], this.handleCredentialsEvent.bind(this)), + websocketStore.subscribeToEntity('gitea_credentials', ['create', 'update', 'delete'], this.handleCredentialsEvent.bind(this)), + websocketStore.subscribeToEntity('github_endpoint', ['create', 'update', 'delete'], this.handleEndpointEvent.bind(this)) + ]; + + this.unsubscribers = subscriptions; + + // Monitor WebSocket connection status + this.setupWebSocketStatusMonitoring(); + } + + private setupWebSocketStatusMonitoring() { + if (this.websocketStatusUnsubscriber) { + this.websocketStatusUnsubscriber(); + } + + let wasConnected = false; + + this.websocketStatusUnsubscriber = websocketStore.subscribe(state => { + // When WebSocket connects for the first time or reconnects after being disconnected + if (state.connected && !wasConnected) { + console.log('[EagerCache] WebSocket connected - reinitializing cache'); + // Reload all resources when WebSocket connects + this.initializeAllResources(); + } + wasConnected = state.connected; + }); + } + + // Reinitialize all resources when WebSocket connects + private async initializeAllResources() { + const resourceTypes: (keyof Omit)[] = [ + 'repositories', 'organizations', 'enterprises', 'pools', 'scalesets', + 'credentials', 'endpoints', 'controllerInfo' + ]; + + // Load all resources in parallel + const loadPromises = resourceTypes.map(resourceType => + this.loadResource(resourceType, true).catch(error => { + console.warn(`Failed to reload ${resourceType} on WebSocket reconnect:`, error); + }) + ); + + await Promise.allSettled(loadPromises); + } + + private handleRepositoryEvent(event: WebSocketEvent) { + eagerCache.update(state => { + if (!state.loaded.repositories) return state; + + const repositories = [...state.repositories]; + const repo = event.payload as Repository; + + if (event.operation === 'create') { + repositories.push(repo); + } else if (event.operation === 'update') { + const index = repositories.findIndex(r => r.id === repo.id); + if (index !== -1) repositories[index] = repo; + } else if (event.operation === 'delete') { + const repoId = typeof repo === 'object' ? repo.id : repo; + const index = repositories.findIndex(r => r.id === repoId); + if (index !== -1) repositories.splice(index, 1); + } + + return { ...state, repositories }; + }); + } + + private handleOrganizationEvent(event: WebSocketEvent) { + eagerCache.update(state => { + if (!state.loaded.organizations) return state; + + const organizations = [...state.organizations]; + const org = event.payload as Organization; + + if (event.operation === 'create') { + organizations.push(org); + } else if (event.operation === 'update') { + const index = organizations.findIndex(o => o.id === org.id); + if (index !== -1) organizations[index] = org; + } else if (event.operation === 'delete') { + const orgId = typeof org === 'object' ? org.id : org; + const index = organizations.findIndex(o => o.id === orgId); + if (index !== -1) organizations.splice(index, 1); + } + + return { ...state, organizations }; + }); + } + + private handleEnterpriseEvent(event: WebSocketEvent) { + eagerCache.update(state => { + if (!state.loaded.enterprises) return state; + + const enterprises = [...state.enterprises]; + const ent = event.payload as Enterprise; + + if (event.operation === 'create') { + enterprises.push(ent); + } else if (event.operation === 'update') { + const index = enterprises.findIndex(e => e.id === ent.id); + if (index !== -1) enterprises[index] = ent; + } else if (event.operation === 'delete') { + const entId = typeof ent === 'object' ? ent.id : ent; + const index = enterprises.findIndex(e => e.id === entId); + if (index !== -1) enterprises.splice(index, 1); + } + + return { ...state, enterprises }; + }); + } + + private handlePoolEvent(event: WebSocketEvent) { + eagerCache.update(state => { + if (!state.loaded.pools) return state; + + const pools = [...state.pools]; + const pool = event.payload as Pool; + + if (event.operation === 'create') { + pools.push(pool); + } else if (event.operation === 'update') { + const index = pools.findIndex(p => p.id === pool.id); + if (index !== -1) pools[index] = pool; + } else if (event.operation === 'delete') { + const poolId = typeof pool === 'object' ? pool.id : pool; + const index = pools.findIndex(p => p.id === poolId); + if (index !== -1) pools.splice(index, 1); + } + + return { ...state, pools }; + }); + } + + private handleScaleSetEvent(event: WebSocketEvent) { + eagerCache.update(state => { + if (!state.loaded.scalesets) return state; + + const scalesets = [...state.scalesets]; + const scaleset = event.payload as ScaleSet; + + if (event.operation === 'create') { + scalesets.push(scaleset); + } else if (event.operation === 'update') { + const index = scalesets.findIndex(s => s.id === scaleset.id); + if (index !== -1) scalesets[index] = scaleset; + } else if (event.operation === 'delete') { + const scalesetId = typeof scaleset === 'object' ? scaleset.id : scaleset; + const index = scalesets.findIndex(s => s.id === scalesetId); + if (index !== -1) scalesets.splice(index, 1); + } + + return { ...state, scalesets }; + }); + } + + private handleCredentialsEvent(event: WebSocketEvent) { + eagerCache.update(state => { + if (!state.loaded.credentials) return state; + + const credentials = [...state.credentials]; + const cred = event.payload as ForgeCredentials; + + if (event.operation === 'create') { + credentials.push(cred); + } else if (event.operation === 'update') { + const index = credentials.findIndex(c => c.id === cred.id); + if (index !== -1) credentials[index] = cred; + } else if (event.operation === 'delete') { + const credId = typeof cred === 'object' ? cred.id : cred; + const index = credentials.findIndex(c => c.id === credId); + if (index !== -1) credentials.splice(index, 1); + } + + return { ...state, credentials }; + }); + } + + private handleEndpointEvent(event: WebSocketEvent) { + eagerCache.update(state => { + if (!state.loaded.endpoints) return state; + + const endpoints = [...state.endpoints]; + const endpoint = event.payload as ForgeEndpoint; + + if (event.operation === 'create') { + endpoints.push(endpoint); + } else if (event.operation === 'update') { + const index = endpoints.findIndex(e => e.name === endpoint.name); + if (index !== -1) endpoints[index] = endpoint; + } else if (event.operation === 'delete') { + const endpointName = typeof endpoint === 'object' ? endpoint.name : endpoint; + const index = endpoints.findIndex(e => e.name === endpointName); + if (index !== -1) endpoints.splice(index, 1); + } + + return { ...state, endpoints }; + }); + } + + cleanup() { + this.unsubscribers.forEach(unsubscribe => unsubscribe()); + this.unsubscribers = []; + + if (this.websocketStatusUnsubscriber) { + this.websocketStatusUnsubscriber(); + this.websocketStatusUnsubscriber = null; + } + } + + // Helper method to check if we should use cache or direct API + private shouldUseCache(): boolean { + const wsState = get(websocketStore); + return wsState.connected; + } + + // Helper methods for components - check WebSocket status first + async getRepositories(): Promise { + const wsState = get(websocketStore); + + if (!wsState.connected) { + // WebSocket disconnected - fetch directly from API + console.log('[EagerCache] WebSocket disconnected - fetching repositories directly from API'); + return await garmApi.listRepositories(); + } + + const state = get(eagerCache); + if (state.loaded.repositories) { + return state.repositories; + } + + return this.loadResource('repositories', true); + } + + async getOrganizations(): Promise { + const wsState = get(websocketStore); + + if (!wsState.connected) { + console.log('[EagerCache] WebSocket disconnected - fetching organizations directly from API'); + return await garmApi.listOrganizations(); + } + + const state = get(eagerCache); + if (state.loaded.organizations) { + return state.organizations; + } + + return this.loadResource('organizations', true); + } + + async getEnterprises(): Promise { + const wsState = get(websocketStore); + + if (!wsState.connected) { + console.log('[EagerCache] WebSocket disconnected - fetching enterprises directly from API'); + return await garmApi.listEnterprises(); + } + + const state = get(eagerCache); + if (state.loaded.enterprises) { + return state.enterprises; + } + + return this.loadResource('enterprises', true); + } + + async getPools(): Promise { + const wsState = get(websocketStore); + + if (!wsState.connected) { + console.log('[EagerCache] WebSocket disconnected - fetching pools directly from API'); + return await garmApi.listAllPools(); + } + + const state = get(eagerCache); + if (state.loaded.pools) { + return state.pools; + } + + return this.loadResource('pools', true); + } + + async getScaleSets(): Promise { + const wsState = get(websocketStore); + + if (!wsState.connected) { + console.log('[EagerCache] WebSocket disconnected - fetching scalesets directly from API'); + return await garmApi.listScaleSets(); + } + + const state = get(eagerCache); + if (state.loaded.scalesets) { + return state.scalesets; + } + + return this.loadResource('scalesets', true); + } + + async getCredentials(): Promise { + const wsState = get(websocketStore); + + if (!wsState.connected) { + console.log('[EagerCache] WebSocket disconnected - fetching credentials directly from API'); + return await garmApi.listAllCredentials(); + } + + const state = get(eagerCache); + if (state.loaded.credentials) { + return state.credentials; + } + + return this.loadResource('credentials', true); + } + + async getEndpoints(): Promise { + const wsState = get(websocketStore); + + if (!wsState.connected) { + console.log('[EagerCache] WebSocket disconnected - fetching endpoints directly from API'); + return await garmApi.listAllEndpoints(); + } + + const state = get(eagerCache); + if (state.loaded.endpoints) { + return state.endpoints; + } + + return this.loadResource('endpoints', true); + } + + async getControllerInfo(): Promise { + const wsState = get(websocketStore); + + if (!wsState.connected) { + console.log('[EagerCache] WebSocket disconnected - fetching controller info directly from API'); + return await garmApi.getControllerInfo(); + } + + const state = get(eagerCache); + if (state.loaded.controllerInfo) { + return state.controllerInfo; + } + + return this.loadResource('controllerInfo', true); + } + + private handleControllerEvent(event: WebSocketEvent) { + eagerCache.update(state => { + if (!state.loaded.controllerInfo) return state; + + const controllerInfo = event.payload as ControllerInfo; + + // Controller info is a singleton, so we just replace it + if (event.operation === 'update') { + return { ...state, controllerInfo }; + } + + return state; + }); + } +} + +export const eagerCacheManager = new EagerCacheManager(); + +// Initialize websocket subscriptions when the module is loaded +if (typeof window !== 'undefined') { + eagerCacheManager.setupWebSocketSubscriptions(); +} \ No newline at end of file diff --git a/webapp/src/lib/stores/toast.ts b/webapp/src/lib/stores/toast.ts new file mode 100644 index 00000000..84619ec1 --- /dev/null +++ b/webapp/src/lib/stores/toast.ts @@ -0,0 +1,58 @@ +import { writable } from 'svelte/store'; + +export interface Toast { + id: string; + type: 'success' | 'error' | 'info' | 'warning'; + title: string; + message: string; + duration?: number; // milliseconds, 0 for manual dismiss +} + +function createToastStore() { + const { subscribe, set, update } = writable([]); + + const store = { + subscribe, + add: (toast: Omit) => { + const id = Math.random().toString(36).substr(2, 9); + const newToast: Toast = { + ...toast, + id, + duration: toast.duration ?? 5000 + }; + + update(toasts => [...toasts, newToast]); + + // Auto-remove after duration + if (newToast.duration && newToast.duration > 0) { + setTimeout(() => { + update(toasts => toasts.filter(t => t.id !== id)); + }, newToast.duration); + } + + return id; + }, + remove: (id: string) => { + update(toasts => toasts.filter(t => t.id !== id)); + }, + clear: () => { + set([]); + }, + success: (title: string, message: string = '', duration?: number) => { + return store.add({ type: 'success', title, message, duration }); + }, + error: (title: string, message: string = '', duration?: number) => { + return store.add({ type: 'error', title, message, duration }); + }, + info: (title: string, message: string = '', duration?: number) => { + return store.add({ type: 'info', title, message, duration }); + }, + warning: (title: string, message: string = '', duration?: number) => { + return store.add({ type: 'warning', title, message, duration }); + } + }; + + return store; +} + +export const toastStore = createToastStore(); \ No newline at end of file diff --git a/webapp/src/lib/stores/websocket.ts b/webapp/src/lib/stores/websocket.ts new file mode 100644 index 00000000..3938023b --- /dev/null +++ b/webapp/src/lib/stores/websocket.ts @@ -0,0 +1,367 @@ +import { writable, get } from 'svelte/store'; + +// Event types that match the websocket API +export type EntityType = + | 'repository' + | 'organization' + | 'enterprise' + | 'pool' + | 'user' + | 'instance' + | 'job' + | 'controller' + | 'github_credentials' + | 'gitea_credentials' + | 'github_endpoint' + | 'scaleset'; + +export type Operation = 'create' | 'update' | 'delete'; + +export interface EventFilter { + 'entity-type': EntityType; + operations: Operation[]; +} + +export interface FilterMessage { + 'send-everything'?: boolean; + filters?: EventFilter[]; +} + +export interface WebSocketEvent { + 'entity-type': EntityType; + operation: Operation; + payload: any; +} + +export interface WebSocketState { + connected: boolean; + connecting: boolean; + error: string | null; + lastEvent: WebSocketEvent | null; +} + +// Create the websocket store +function createWebSocketStore() { + const { subscribe, set, update } = writable({ + connected: false, + connecting: false, + error: null, + lastEvent: null + }); + + let ws: WebSocket | null = null; + let reconnectAttempts = 0; + let maxReconnectAttempts = 50; // Increased for more persistent reconnection + let baseReconnectInterval = 1000; // Base interval + let reconnectInterval = 1000; // Current interval + let maxReconnectInterval = 30000; // Max 30 seconds + let reconnectTimeout: number | null = null; + let currentFilters: EventFilter[] = []; + let manuallyDisconnected = false; + + // Event callbacks organized by entity type + const eventCallbacks = new Map void)[]>(); + + function getWebSocketUrl(): string { + const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; + const host = window.location.host; + return `${protocol}//${host}/api/v1/ws/events`; + } + + function connect() { + if (ws && (ws.readyState === WebSocket.CONNECTING || ws.readyState === WebSocket.OPEN)) { + return; + } + + manuallyDisconnected = false; + update(state => ({ ...state, connecting: true, error: null })); + + try { + const wsUrl = getWebSocketUrl(); + + // Use cookie authentication - no need for Bearer token in protocol + ws = new WebSocket(wsUrl); + + // Set connection timeout + const connectionTimeout = setTimeout(() => { + if (ws && ws.readyState === WebSocket.CONNECTING) { + ws.close(); + } + }, 10000); // 10 second timeout + + ws.onopen = () => { + clearTimeout(connectionTimeout); + reconnectAttempts = 0; + reconnectInterval = baseReconnectInterval; + + update(state => ({ ...state, connected: true, connecting: false, error: null })); + + // Send current filters if any + if (currentFilters.length > 0) { + sendFilters(currentFilters); + } + + // Setup heartbeat (currently no-op, but ready for future use) + startHeartbeat(); + }; + + ws.onmessage = (event) => { + try { + const data = JSON.parse(event.data); + + // Update the store with the last event + update(state => ({ ...state, lastEvent: data })); + + // Call registered callbacks for this entity type + const callbacks = eventCallbacks.get(data['entity-type']) || []; + callbacks.forEach(callback => { + try { + callback(data); + } catch (err) { + console.error('[WebSocket] Error in event callback:', err); + } + }); + } catch (err) { + console.error('[WebSocket] Error parsing message:', err); + } + }; + + ws.onclose = (event) => { + clearTimeout(connectionTimeout); + cleanup(); + + const wasManualDisconnect = event.code === 1000 && manuallyDisconnected; + const errorMessage = event.code !== 1000 ? `Connection closed: ${event.reason || 'Unknown reason'}` : null; + + update(state => ({ + ...state, + connected: false, + connecting: false, + error: errorMessage + })); + + // Attempt to reconnect unless it was explicitly a manual disconnect + // This includes server restarts that result in clean closes (code 1000) + if (!wasManualDisconnect) { + scheduleReconnect(); + } + }; + + ws.onerror = (error) => { + clearTimeout(connectionTimeout); + cleanup(); + + update(state => ({ + ...state, + connected: false, + connecting: false, + error: 'WebSocket connection error' + })); + + // Schedule reconnect on error if not manually disconnected + if (!manuallyDisconnected) { + scheduleReconnect(); + } + }; + + } catch (err) { + update(state => ({ + ...state, + connected: false, + connecting: false, + error: err instanceof Error ? err.message : 'Failed to connect' + })); + } + } + + function startHeartbeat() { + // Clear any existing intervals + cleanup(); + + // No need for client-side heartbeat checks since: + // 1. Server handles ping/pong automatically (every ~54 seconds) + // 2. Browser WebSocket automatically responds to ping frames with pong frames + // 3. Server will close connection if it doesn't receive pong responses + // 4. Server may not send any messages if there are no events to stream + // 5. onclose/onerror handlers will trigger reconnection if needed + } + + function cleanup() { + // No intervals to clean up currently + } + + function scheduleReconnect() { + if (manuallyDisconnected) { + return; + } + + if (reconnectTimeout) { + clearTimeout(reconnectTimeout); + } + + reconnectAttempts++; + + // Reset attempts periodically to allow for long-term reconnection + if (reconnectAttempts > maxReconnectAttempts) { + reconnectAttempts = 1; + reconnectInterval = baseReconnectInterval; + } + + const actualInterval = Math.min(reconnectInterval, maxReconnectInterval); + + reconnectTimeout = window.setTimeout(() => { + if (!manuallyDisconnected) { + connect(); + // Exponential backoff with jitter to avoid thundering herd + const jitter = Math.random() * 1000; // 0-1 second jitter + reconnectInterval = Math.min(reconnectInterval * 1.5 + jitter, maxReconnectInterval); + } + }, actualInterval); + } + + function sendFilters(filters: EventFilter[]) { + if (ws && ws.readyState === WebSocket.OPEN) { + const message: FilterMessage = { + 'send-everything': false, + filters: filters + }; + ws.send(JSON.stringify(message)); + currentFilters = [...filters]; + } + } + + function disconnect() { + manuallyDisconnected = true; + + if (reconnectTimeout) { + clearTimeout(reconnectTimeout); + reconnectTimeout = null; + } + + cleanup(); + + if (ws) { + ws.close(1000, 'Manual disconnect'); + ws = null; + } + + // Clear all callbacks + eventCallbacks.clear(); + currentFilters = []; + + update(state => ({ + ...state, + connected: false, + connecting: false, + error: null, + lastEvent: null + })); + } + + // Handle network connectivity changes + function handleNetworkChange() { + if (navigator.onLine && !manuallyDisconnected) { + // Delay reconnection slightly to allow network to stabilize + setTimeout(() => { + if (!ws || ws.readyState === WebSocket.CLOSED || ws.readyState === WebSocket.CLOSING) { + reconnectAttempts = 0; // Reset attempts on network recovery + reconnectInterval = baseReconnectInterval; + connect(); + } + }, 2000); + } + } + + // Listen for network changes + if (typeof window !== 'undefined') { + window.addEventListener('online', handleNetworkChange); + window.addEventListener('offline', () => { + update(state => ({ ...state, error: 'Network offline' })); + }); + + // Periodic check to ensure connection is maintained + setInterval(() => { + // Always maintain connection unless manually disconnected + if (!manuallyDisconnected) { + // If we should be connected but aren't, attempt to reconnect + if (!ws || ws.readyState === WebSocket.CLOSED || ws.readyState === WebSocket.CLOSING) { + connect(); + } + } + }, 10000); // Check every 10 seconds + } + + // Subscribe to events for a specific entity type + function subscribeToEntity(entityType: EntityType, operations: Operation[], callback: (event: WebSocketEvent) => void) { + + // Add callback to the list for this entity type + if (!eventCallbacks.has(entityType)) { + eventCallbacks.set(entityType, []); + } + eventCallbacks.get(entityType)!.push(callback); + + // Add or update the filter for this entity type + const existingFilterIndex = currentFilters.findIndex(f => f['entity-type'] === entityType); + const newFilter: EventFilter = { + 'entity-type': entityType, + operations: operations + }; + + if (existingFilterIndex >= 0) { + // Merge operations with existing filter + const existingOps = currentFilters[existingFilterIndex].operations; + newFilter.operations = Array.from(new Set([...existingOps, ...operations])); + currentFilters[existingFilterIndex] = newFilter; + } else { + currentFilters.push(newFilter); + } + + // Send updated filters if connected + if (ws && ws.readyState === WebSocket.OPEN) { + sendFilters(currentFilters); + } + + // Ensure connection exists (should already be connected via auto-connect) + if (!ws || ws.readyState === WebSocket.CLOSED || ws.readyState === WebSocket.CLOSING) { + connect(); + } + + // Return unsubscribe function + return () => { + const callbacks = eventCallbacks.get(entityType); + if (callbacks) { + const index = callbacks.indexOf(callback); + if (index > -1) { + callbacks.splice(index, 1); + } + + // If no more callbacks for this entity type, remove the filter + if (callbacks.length === 0) { + eventCallbacks.delete(entityType); + const filterIndex = currentFilters.findIndex(f => f['entity-type'] === entityType); + if (filterIndex > -1) { + currentFilters.splice(filterIndex, 1); + if (ws && ws.readyState === WebSocket.OPEN) { + sendFilters(currentFilters); + } + } + } + } + }; + } + + // Auto-connect when store is created (browser environment only) + if (typeof window !== 'undefined') { + // Connect immediately + connect(); + } + + return { + subscribe, + connect, + disconnect, + subscribeToEntity + }; +} + +export const websocketStore = createWebSocketStore(); \ No newline at end of file diff --git a/webapp/src/lib/utils/common.ts b/webapp/src/lib/utils/common.ts new file mode 100644 index 00000000..9bac810d --- /dev/null +++ b/webapp/src/lib/utils/common.ts @@ -0,0 +1,296 @@ +/** + * Common utility functions shared across components and pages + */ + +/** + * Formats a date string or Date object to a human-readable format + */ +export function formatDate(date: string | Date | null | undefined): string { + if (!date) return 'N/A'; + try { + const d = typeof date === 'string' ? new Date(date) : date; + return d.toLocaleString(); + } catch { + return 'Invalid Date'; + } +} + +/** + * Returns the appropriate forge icon SVG for the given endpoint type + * @param endpointType - The type of endpoint ('github', 'gitea', etc.) + * @param sizeClasses - Optional size classes (e.g., 'w-4 h-4', 'w-8 h-8'). Defaults to 'w-4 h-4' + */ +export function getForgeIcon(endpointType: string, sizeClasses: string = 'w-4 h-4'): string { + if (endpointType === 'gitea') { + return ``; + } else if (endpointType === 'github') { + // GitHub (also used for GHES) + return `
                `; + } else { + // Return a generic placeholder icon if endpoint type is unknown + return ` + + + `; + } +} + +/** + * Truncates an image name to a specified length and indicates if it was truncated + */ +export function truncateImageName(imageName: string, maxLength: number = 25): { truncated: string, isTruncated: boolean } { + if (imageName.length <= maxLength) { + return { truncated: imageName, isTruncated: false }; + } + return { truncated: imageName.substring(0, maxLength) + '...', isTruncated: true }; +} + +/** + * Gets the entity name for a Pool or ScaleSet object + */ +export function getEntityName(entity: any, eagerCacheStores?: any): string { + // Both Pool and ScaleSet objects now include the name fields directly + if (entity.repo_name) return entity.repo_name; + if (entity.org_name) return entity.org_name; + if (entity.enterprise_name) return entity.enterprise_name; + + // Fallback to eager cache lookup if name fields are not available (older API or cached data) + if (entity.repo_id && !entity.repo_name && eagerCacheStores?.repositories) { + const repo = eagerCacheStores.repositories.find((r: any) => r.id === entity.repo_id); + return repo ? `${repo.owner}/${repo.name}` : 'Unknown Entity'; + } + if (entity.org_id && !entity.org_name && eagerCacheStores?.organizations) { + const org = eagerCacheStores.organizations.find((o: any) => o.id === entity.org_id); + return (org && org.name) ? org.name : 'Unknown Entity'; + } + if (entity.enterprise_id && !entity.enterprise_name && eagerCacheStores?.enterprises) { + const enterprise = eagerCacheStores.enterprises.find((e: any) => e.id === entity.enterprise_id); + return (enterprise && enterprise.name) ? enterprise.name : 'Unknown Entity'; + } + + return 'Unknown Entity'; +} + +/** + * Gets the entity type for a Pool or ScaleSet object + */ +export function getEntityType(entity: any): string { + if (entity.repo_id) return 'repository'; + if (entity.org_id) return 'organization'; + if (entity.enterprise_id) return 'enterprise'; + return 'unknown'; +} + +/** + * Gets the URL for an entity detail page + */ +export function getEntityUrl(entity: any, base: string = ''): string { + if (entity.repo_id) return `${base}/repositories/${entity.repo_id}`; + if (entity.org_id) return `${base}/organizations/${entity.org_id}`; + if (entity.enterprise_id) return `${base}/enterprises/${entity.enterprise_id}`; + return '#'; +} + +/** + * Updates entity fields, preserving events and other non-API fields + */ +export function updateEntityFields(currentEntity: any, updatedFields: any): any { + // Preserve only fields that are definitely not in the API response + const { events: originalEvents } = currentEntity; + + // Use the API response as the primary source, add back preserved fields + const result = { + ...updatedFields, + events: originalEvents // Always preserve events since they're managed by websockets + }; + + return result; +} + +/** + * Scrolls to bottom of events container + */ +export function scrollToBottomEvents(eventsContainer: HTMLElement | null): void { + if (eventsContainer) { + eventsContainer.scrollTop = eventsContainer.scrollHeight; + } +} + +/** + * Changes pagination page + */ +export function changePage(currentPage: number, targetPage: number, totalPages: number): number { + if (targetPage >= 1 && targetPage <= totalPages) { + return targetPage; + } + return currentPage; +} + +/** + * Changes items per page and resets to page 1 + */ +export function changePerPage(newPerPage: number): { newPerPage: number, newCurrentPage: number } { + return { newPerPage, newCurrentPage: 1 }; +} + +/** + * Gets entity status badge information based on pool_manager_status + */ +export function getEntityStatusBadge(entity: any): { text: string, variant: 'success' | 'error' } { + if (entity.pool_manager_status?.running) { + return { + text: 'Running', + variant: 'success' + }; + } else { + return { + text: 'Stopped', + variant: 'error' + }; + } +} + +/** + * Gets badge variant for enabled/disabled status + */ +export function getEnabledStatusBadge(enabled: boolean): { text: string, variant: 'success' | 'error' } { + return { + text: enabled ? 'Enabled' : 'Disabled', + variant: enabled ? 'success' : 'error' + }; +} + +/** + * Gets badge variant for authentication type + */ +export function getAuthTypeBadge(authType: string): { text: string, variant: 'success' | 'info' } { + return { + text: authType === 'pat' ? 'PAT' : 'App', + variant: authType === 'pat' ? 'success' : 'info' + }; +} + +/** + * Gets badge variant for event level + */ +export function getEventLevelBadge(level: string): { text: string, variant: 'success' | 'error' | 'warning' | 'info' } { + const normalizedLevel = level.toLowerCase(); + switch (normalizedLevel) { + case 'error': + return { text: 'Error', variant: 'error' }; + case 'warning': + return { text: 'Warning', variant: 'warning' }; + case 'info': + return { text: 'Info', variant: 'info' }; + default: + return { text: level, variant: 'info' }; + } +} + +/** + * Filters entities by search term, supporting different search field configurations + */ +export function filterEntities>( + entities: T[], + searchTerm: string, + searchFields: string[] | ((entity: T, eagerCache?: any) => string) +): T[] { + if (!searchTerm.trim()) return entities; + + const lowercaseSearch = searchTerm.toLowerCase(); + + return entities.filter(entity => { + if (typeof searchFields === 'function') { + // Custom search function (e.g., for pools/scalesets using getEntityName) + const searchText = searchFields(entity); + return searchText.toLowerCase().includes(lowercaseSearch); + } else { + // Field-based search + return searchFields.some(field => { + const value = entity[field]; + return value?.toString().toLowerCase().includes(lowercaseSearch); + }); + } + }); +} + +/** + * Convenience function for filtering repositories (searches name and owner) + */ +export function filterRepositories(repositories: T[], searchTerm: string): T[] { + return filterEntities(repositories, searchTerm, ['name', 'owner']); +} + +/** + * Convenience function for filtering organizations/enterprises (searches name only) + */ +export function filterByName(entities: T[], searchTerm: string): T[] { + return filterEntities(entities, searchTerm, ['name']); +} + +/** + * Convenience function for filtering credentials (searches name, description, and endpoint name) + */ +export function filterCredentials(credentials: T[], searchTerm: string): T[] { + return filterEntities(credentials, searchTerm, (credential) => { + const searchableText = [ + credential.name || '', + credential.description || '', + credential.endpoint?.name || '' + ].join(' '); + return searchableText; + }); +} + +/** + * Convenience function for filtering endpoints (searches name, description, base_url, and api_base_url) + */ +export function filterEndpoints(endpoints: T[], searchTerm: string): T[] { + return filterEntities(endpoints, searchTerm, ['name', 'description', 'base_url', 'api_base_url']); +} + +/** + * Pagination utility functions + */ +export interface PaginationState { + currentPage: number; + perPage: number; + totalPages: number; +} + +/** + * Creates paginated slice of items + */ +export function paginateItems(items: T[], currentPage: number, perPage: number): T[] { + return items.slice( + (currentPage - 1) * perPage, + currentPage * perPage + ); +} + +/** + * Calculates total pages and adjusts current page if needed + */ +export function calculatePagination(totalItems: number, perPage: number, currentPage: number): PaginationState { + const totalPages = Math.ceil(totalItems / perPage); + const adjustedCurrentPage = (currentPage > totalPages && totalPages > 0) ? totalPages : currentPage; + + return { + currentPage: adjustedCurrentPage, + perPage, + totalPages + }; +} + +/** + * Creates pagination info text (e.g., "Showing 1 to 25 of 100 results") + */ +export function getPaginationInfo(currentPage: number, perPage: number, totalItems: number): string { + if (totalItems === 0) return 'No results'; + + const start = (currentPage - 1) * perPage + 1; + const end = Math.min(currentPage * perPage, totalItems); + + return `Showing ${start} to ${end} of ${totalItems} results`; +} + diff --git a/webapp/src/lib/utils/status.ts b/webapp/src/lib/utils/status.ts new file mode 100644 index 00000000..7f7f68a8 --- /dev/null +++ b/webapp/src/lib/utils/status.ts @@ -0,0 +1,90 @@ +/** + * Unified status formatting and styling utilities + * Provides consistent status display and color coding across all pages + */ + +/** + * Formats status text for display by replacing underscores with spaces + * and converting to proper case + */ +export function formatStatusText(status: string): string { + if (!status) return ''; + return status.replace(/_/g, ' ').toLowerCase() + .split(' ') + .map(word => word.charAt(0).toUpperCase() + word.slice(1)) + .join(' '); +} + +/** + * Returns Tailwind CSS classes for status badges based on industry-standard color conventions: + * - Green: Successfully running/active states + * - Blue: Idle/ready states + * - Yellow/Amber: Warning or transitional states + * - Purple: Creating/building states + * - Orange: Deletion/termination in progress + * - Red: Failed/error states + * - Gray: Unknown/pending states + */ +export function getStatusBadgeClass(status: string): string { + if (!status) { + return 'bg-gray-50 text-gray-700 ring-gray-600/20 dark:bg-gray-500/10 dark:text-gray-400 dark:ring-gray-500/20'; + } + + const normalizedStatus = status.toLowerCase(); + + switch (normalizedStatus) { + // Successfully running states - Green + case 'running': + case 'online': + return 'bg-green-50 text-green-700 ring-green-600/20 dark:bg-green-500/10 dark:text-green-400 dark:ring-green-500/20'; + + // Idle/ready states - Blue + case 'idle': + case 'stopped': + return 'bg-blue-50 text-blue-700 ring-blue-600/20 dark:bg-blue-500/10 dark:text-blue-400 dark:ring-blue-500/20'; + + // Active/working states - Yellow + case 'active': + return 'bg-yellow-50 text-yellow-700 ring-yellow-600/20 dark:bg-yellow-500/10 dark:text-yellow-400 dark:ring-yellow-500/20'; + + // Creating/building states - Purple with pulse animation + case 'creating': + case 'installing': + case 'pending_create': + case 'provisioning': + return 'bg-purple-50 text-purple-700 ring-purple-600/20 dark:bg-purple-500/10 dark:text-purple-400 dark:ring-purple-500/20 animate-pulse'; + + // Deletion/termination states - Orange with pulse animation + case 'deleting': + case 'terminating': + case 'pending_delete': + case 'destroying': + return 'bg-orange-50 text-orange-700 ring-orange-600/20 dark:bg-orange-500/10 dark:text-orange-400 dark:ring-orange-500/20 animate-pulse'; + + // Failed/error states - Red + case 'failed': + case 'error': + case 'terminated': + case 'offline': + return 'bg-red-50 text-red-700 ring-red-600/20 dark:bg-red-500/10 dark:text-red-400 dark:ring-red-500/20'; + + // General pending states - Gray with pulse animation + case 'pending': + case 'unknown': + return 'bg-gray-50 text-gray-700 ring-gray-600/20 dark:bg-gray-500/10 dark:text-gray-400 dark:ring-gray-500/20 animate-pulse'; + + // Default - Gray + default: + return 'bg-gray-50 text-gray-700 ring-gray-600/20 dark:bg-gray-500/10 dark:text-gray-400 dark:ring-gray-500/20'; + } +} + +/** + * Combined utility that returns both formatted text and CSS classes + */ +export function getFormattedStatus(status: string): { text: string; classes: string } { + return { + text: formatStatusText(status), + classes: getStatusBadgeClass(status) + }; +} \ No newline at end of file diff --git a/webapp/src/openapitools.json b/webapp/src/openapitools.json new file mode 100644 index 00000000..a82623d6 --- /dev/null +++ b/webapp/src/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.14.0" + } +} diff --git a/webapp/src/routes/+layout.svelte b/webapp/src/routes/+layout.svelte new file mode 100644 index 00000000..0ce5770f --- /dev/null +++ b/webapp/src/routes/+layout.svelte @@ -0,0 +1,87 @@ + + + + GARM - GitHub Actions Runner Manager + + +{#if $authStore.loading} +
                +
                +
                +

                Loading...

                +
                +
                +{:else if requiresAuth && !$authStore.isAuthenticated} + +
                +
                +

                Redirecting to login...

                +
                +
                +{:else if isLoginPage || isInitPage} + + +{:else} + +
                + + +
                +
                +
                + +
                +
                +
                +
                +{/if} + + + diff --git a/webapp/src/routes/+layout.ts b/webapp/src/routes/+layout.ts new file mode 100644 index 00000000..bc675bc0 --- /dev/null +++ b/webapp/src/routes/+layout.ts @@ -0,0 +1,13 @@ +import type { LayoutLoad } from './$types'; + +export const load: LayoutLoad = async ({ url }) => { + // For now, we'll handle auth redirect in the component + // In a real app, you might check auth state here + + return { + url: url.pathname + }; +}; + +export const prerender = false; +export const ssr = false; \ No newline at end of file diff --git a/webapp/src/routes/+page.svelte b/webapp/src/routes/+page.svelte new file mode 100644 index 00000000..a38ff4fc --- /dev/null +++ b/webapp/src/routes/+page.svelte @@ -0,0 +1,321 @@ + + + + Dashboard - GARM + + +
                + +
                +

                Dashboard

                +

                + Welcome to GARM - GitHub Actions Runner Manager +

                +
                + + {#if error} + +
                +
                +
                + + + +
                +
                +

                Error loading dashboard

                +

                {error}

                +
                +
                +
                + {/if} + + + + + + {#if controllerInfo} + + {/if} + + + +
                \ No newline at end of file diff --git a/webapp/src/routes/credentials/+page.svelte b/webapp/src/routes/credentials/+page.svelte new file mode 100644 index 00000000..d0433100 --- /dev/null +++ b/webapp/src/routes/credentials/+page.svelte @@ -0,0 +1,1022 @@ + + + + + + Credentials - GARM + + +
                + + + + + + +
                +
                +
                +

                + {credential.name} +

                +

                + {credential.description} +

                +
                +
                + {@html getForgeIcon(credential.forge_type || 'unknown')} + {credential.endpoint?.name || 'Unknown'} +
                +
                +
                +
                +
                + {#if (credential['auth-type'] || 'pat') === 'pat'} + + {:else} + + {/if} +
                + showEditCredentialsModal(credential)} + /> + showDeleteCredentialsModal(credential)} + /> +
                +
                +
                +
                + + +
                +
                + + +{#if showCreateModal} + +{/if} + + +{#if showEditModal && editingCredential} + +{/if} + + +{#if showDeleteModal && deletingCredential} + +{/if} \ No newline at end of file diff --git a/webapp/src/routes/endpoints/+page.svelte b/webapp/src/routes/endpoints/+page.svelte new file mode 100644 index 00000000..50873282 --- /dev/null +++ b/webapp/src/routes/endpoints/+page.svelte @@ -0,0 +1,838 @@ + + + + + + Endpoints - GARM + + +
                + + + + + + +
                +
                +
                +

                + {endpoint.name} +

                +

                + {endpoint.description} +

                +
                + {@html getForgeIcon(endpoint.endpoint_type || '', 'w-5 h-5')} + {endpoint.endpoint_type} +
                +
                +
                +
                + showEditEndpointModal(endpoint)} + /> + showDeleteEndpointModal(endpoint)} + /> +
                +
                +
                + +
                +
                + + +{#if showCreateModal} + +{/if} + + +{#if showEditModal && editingEndpoint} + +{/if} + + +{#if showDeleteModal && deletingEndpoint} + +{/if} \ No newline at end of file diff --git a/webapp/src/routes/enterprises/+page.svelte b/webapp/src/routes/enterprises/+page.svelte new file mode 100644 index 00000000..75f4af74 --- /dev/null +++ b/webapp/src/routes/enterprises/+page.svelte @@ -0,0 +1,329 @@ + + + + Enterprises - GARM + + +
                + + + + + + + {@const status = getEntityStatusBadge(enterprise)} +
                + +
                + +
                + openUpdateModal(enterprise)} + /> + openDeleteModal(enterprise)} + /> +
                +
                +
                +
                + +
                +
                + + +{#if showCreateModal} + showCreateModal = false} + on:submit={(e) => handleCreateEnterprise(e.detail)} + /> +{/if} + +{#if showUpdateModal && selectedEnterprise} + { showUpdateModal = false; selectedEnterprise = null; }} + on:submit={(e) => handleUpdateEnterprise(e.detail)} + /> +{/if} + +{#if showDeleteModal && selectedEnterprise} + { showDeleteModal = false; selectedEnterprise = null; }} + on:confirm={handleDeleteEnterprise} + /> +{/if} \ No newline at end of file diff --git a/webapp/src/routes/enterprises/[id]/+page.svelte b/webapp/src/routes/enterprises/[id]/+page.svelte new file mode 100644 index 00000000..22c77bd7 --- /dev/null +++ b/webapp/src/routes/enterprises/[id]/+page.svelte @@ -0,0 +1,381 @@ + + + + {enterprise ? `${enterprise.name} - Enterprise Details` : 'Enterprise Details'} - GARM + + +
                + + + + {#if loading} +
                +
                +

                Loading enterprise...

                +
                + {:else if error} +
                +

                {error}

                +
                + {:else if enterprise} + + showUpdateModal = true} + onDelete={() => showDeleteModal = true} + /> + + + + + + + + + + + + + {/if} +
                + + +{#if showUpdateModal && enterprise} + showUpdateModal = false} + on:submit={(e) => handleUpdate(e.detail)} + /> +{/if} + +{#if showDeleteModal && enterprise} + showDeleteModal = false} + on:confirm={handleDelete} + /> +{/if} + +{#if showDeleteInstanceModal && selectedInstance} + { showDeleteInstanceModal = false; selectedInstance = null; }} + on:confirm={handleDeleteInstance} + /> +{/if} + +{#if showCreatePoolModal && enterprise} + showCreatePoolModal = false} + on:submit={handleCreatePool} + /> +{/if} \ No newline at end of file diff --git a/webapp/src/routes/init/+page.svelte b/webapp/src/routes/init/+page.svelte new file mode 100644 index 00000000..528e150c --- /dev/null +++ b/webapp/src/routes/init/+page.svelte @@ -0,0 +1,431 @@ + + + + Initialize GARM - First Run Setup + + +
                +
                +
                + GARM + +
                +

                + Welcome to GARM +

                +

                + Complete the first-run setup to get started +

                +
                + +
                + +
                +
                +
                + + + +
                +
                +

                + First-Run Initialization +

                +
                +

                GARM needs to be initialized before first use. This will create the admin user and generate a unique controller ID for this installation.

                +
                +
                +
                +
                + + +
                +
                + +
                + +
                + + {#if !isValidUsername && username.length > 0} +

                + Username is required +

                + {/if} +
                +
                + + +
                + +
                + + {#if !isValidEmail && email.length > 0} +

                + Please enter a valid email address +

                + {/if} +
                +
                + + +
                + +
                + + {#if !isValidFullName && fullName.length > 0} +

                + Full name is required +

                + {/if} +
                +
                + + +
                + +
                + + {#if !isValidPassword && password.length > 0} +

                + Password must be at least 8 characters long +

                + {/if} +
                +
                + + +
                + +
                + + {#if !isValidConfirmPassword && confirmPassword.length > 0} +

                + Passwords do not match +

                + {/if} +
                +
                + + +
                + + + {#if showAdvanced} +
                +
                + +
                + +
                + +

                + URL where runners can fetch metadata and setup information. +

                +
                +
                + + +
                + +
                + +

                + URL where runners send status updates and lifecycle events. +

                +
                +
                + + +
                + +
                + +

                + URL where GitHub/Gitea will send webhook events for job notifications. +

                +
                +
                +
                +
                + {/if} +
                + + + {#if !isValid && (username.length > 0 || email.length > 0 || fullName.length > 0 || password.length > 0 || confirmPassword.length > 0)} +
                +
                +
                + + + +
                +
                +

                + Please complete all required fields +

                +
                +
                  + {#if !isValidUsername} +
                • Enter a username
                • + {/if} + {#if !isValidEmail} +
                • Enter a valid email address
                • + {/if} + {#if !isValidFullName} +
                • Enter your full name
                • + {/if} + {#if !isValidPassword} +
                • Enter a password with at least 8 characters
                • + {/if} + {#if !isValidConfirmPassword} +
                • Confirm your password
                • + {/if} +
                +
                +
                +
                +
                + {/if} + + + {#if error} +
                +
                +
                + + + +
                +
                +

                {error}

                +
                +
                +
                + {/if} + + +
                + +
                +
                + + +
                +
                +

                + This will create the admin user, generate a unique controller ID, and configure the required URLs for your GARM installation. +
                + Make sure to remember these credentials as they cannot be recovered. +

                +
                +
                +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/routes/instances/+page.svelte b/webapp/src/routes/instances/+page.svelte new file mode 100644 index 00000000..0710c711 --- /dev/null +++ b/webapp/src/routes/instances/+page.svelte @@ -0,0 +1,284 @@ + + + + Instances - GARM + + +
                + + + {#if error} +
                +
                +
                +

                Error

                +
                {error}
                +
                +
                +
                + {/if} + + + +
                + + +{#if showDeleteModal && instanceToDelete} + { + showDeleteModal = false; + instanceToDelete = null; + }} + on:confirm={confirmDelete} + /> +{/if} \ No newline at end of file diff --git a/webapp/src/routes/instances/[id]/+page.svelte b/webapp/src/routes/instances/[id]/+page.svelte new file mode 100644 index 00000000..5589aa5e --- /dev/null +++ b/webapp/src/routes/instances/[id]/+page.svelte @@ -0,0 +1,344 @@ + + + + {instance ? `${instance.name} - Instance Details` : 'Instance Details'} - GARM + + +
                + + + + {#if error} +
                +
                +
                +

                Error

                +
                {error}
                +
                +
                +
                + {/if} + + {#if loading} +
                +
                +
                +

                Loading instance details...

                +
                +
                + {:else if instance} + +
                + +
                +
                +

                Instance Information

                +
                + +
                +
                +
                +
                +
                ID:
                +
                {instance.id}
                +
                +
                +
                Name:
                +
                {instance.name}
                +
                +
                +
                Provider ID:
                +
                {instance.provider_id}
                +
                +
                +
                Provider:
                +
                {instance.provider_name || 'Unknown'}
                +
                +
                +
                Pool/Scale Set:
                +
                + {#if instance.pool_id} + + {instance.pool_id} + + {:else if instance.scale_set_id} + + {instance.scale_set_id} + + {:else} + - + {/if} +
                +
                +
                +
                Agent ID:
                +
                {instance.agent_id || 'Not assigned'}
                +
                +
                +
                Created At:
                +
                {formatDate(instance.created_at!)}
                +
                + {#if instance.updated_at && instance.updated_at !== instance.created_at} +
                +
                Updated At:
                +
                {formatDate(instance.updated_at)}
                +
                + {/if} +
                +
                + + +
                +

                Status & Network

                +
                +
                +
                Instance Status:
                +
                + + {formatStatusText(instance.status || 'unknown')} + +
                +
                +
                +
                Runner Status:
                +
                + + {formatStatusText(instance.runner_status || 'unknown')} + +
                +
                + {#if instance.addresses && instance.addresses.length > 0} +
                +
                Network Addresses:
                +
                + {#each instance.addresses as address} +
                + {address.address} + +
                + {/each} +
                +
                + {:else} +
                +
                Network Addresses:
                +
                No addresses available
                +
                + {/if} + {#if instance.os_type} +
                +
                OS Type:
                +
                {instance.os_type}
                +
                + {/if} + {#if instance.os_name} +
                +
                OS Name:
                +
                {instance.os_name}
                +
                + {/if} + {#if instance.os_version} +
                +
                OS Version:
                +
                {instance.os_version}
                +
                + {/if} + {#if instance.os_arch} +
                +
                OS Architecture:
                +
                {instance.os_arch}
                +
                + {/if} +
                +
                +
                + + {#if instance.status_messages && instance.status_messages.length > 0} + +
                +

                Status Messages

                +
                + {#each instance.status_messages as message} +
                +
                +

                {message.message}

                +
                + {#if message.event_level} + {@const levelBadge = getEventLevelBadge(message.event_level)} + + {/if} + + {#if message.created_at} + {formatDate(message.created_at)} + {:else} + Unknown date + {/if} + +
                +
                +
                + {/each} +
                +
                + {:else} + +
                +

                Status Messages

                +
                + + + +

                No status messages available

                +
                +
                + {/if} + {:else} +
                +
                + Instance not found. +
                +
                + {/if} +
                + + +{#if showDeleteModal && instance} + showDeleteModal = false} + on:confirm={handleDelete} + /> +{/if} \ No newline at end of file diff --git a/webapp/src/routes/login/+page.svelte b/webapp/src/routes/login/+page.svelte new file mode 100644 index 00000000..c358ebf3 --- /dev/null +++ b/webapp/src/routes/login/+page.svelte @@ -0,0 +1,159 @@ + + + + Login - GARM + + +
                +
                +
                +
                + GARM + +
                +

                + Sign in to GARM +

                +

                + GitHub Actions Runner Manager +

                +
                + +
                +
                +
                + + +
                +
                + + +
                +
                + + {#if error} +
                +
                +
                + + + +
                +
                +

                + {error} +

                +
                +
                +
                + {/if} + +
                + +
                +
                +
                +
                \ No newline at end of file diff --git a/webapp/src/routes/organizations/+page.svelte b/webapp/src/routes/organizations/+page.svelte new file mode 100644 index 00000000..978cb7e2 --- /dev/null +++ b/webapp/src/routes/organizations/+page.svelte @@ -0,0 +1,364 @@ + + + + Organizations - GARM + + +
                + + + + + + + {@const status = getEntityStatusBadge(organization)} + + + + +
                + + +{#if showCreateModal} + showCreateModal = false} + on:submit={handleCreateOrganization} + /> +{/if} + +{#if showUpdateModal && selectedOrganization} + { showUpdateModal = false; selectedOrganization = null; }} + on:submit={(e) => handleUpdateOrganization(e.detail)} + /> +{/if} + +{#if showDeleteModal && selectedOrganization} + { showDeleteModal = false; selectedOrganization = null; }} + on:confirm={handleDeleteOrganization} + /> +{/if} \ No newline at end of file diff --git a/webapp/src/routes/organizations/[id]/+page.svelte b/webapp/src/routes/organizations/[id]/+page.svelte new file mode 100644 index 00000000..dc69c856 --- /dev/null +++ b/webapp/src/routes/organizations/[id]/+page.svelte @@ -0,0 +1,392 @@ + + + + {organization ? `${organization.name} - Organization Details` : 'Organization Details'} - GARM + + +
                + + + + {#if loading} +
                +
                +

                Loading organization...

                +
                + {:else if error} +
                +

                {error}

                +
                + {:else if organization} + + showUpdateModal = true} + onDelete={() => showDeleteModal = true} + /> + + + + + + + + + + + + + + + + {/if} +
                + + +{#if showUpdateModal && organization} + showUpdateModal = false} + on:submit={(e) => handleUpdate(e.detail)} + /> +{/if} + +{#if showDeleteModal && organization} + showDeleteModal = false} + on:confirm={handleDelete} + /> +{/if} + +{#if showDeleteInstanceModal && selectedInstance} + { showDeleteInstanceModal = false; selectedInstance = null; }} + on:confirm={handleDeleteInstance} + /> +{/if} + +{#if showCreatePoolModal && organization} + showCreatePoolModal = false} + on:submit={handleCreatePool} + /> +{/if} \ No newline at end of file diff --git a/webapp/src/routes/pools/+page.svelte b/webapp/src/routes/pools/+page.svelte new file mode 100644 index 00000000..81b45c2a --- /dev/null +++ b/webapp/src/routes/pools/+page.svelte @@ -0,0 +1,339 @@ + + + + Pools - GARM + + +
                + + + + +
                + + +{#if showCreateModal} + showCreateModal = false} + on:submit={(e) => handleCreatePool(e.detail)} + /> +{/if} + +{#if showUpdateModal && selectedPool} + { showUpdateModal = false; selectedPool = null; }} + on:submit={(e) => handleUpdatePool(e.detail)} + /> +{/if} + +{#if showDeleteModal && selectedPool} + { showDeleteModal = false; selectedPool = null; }} + on:confirm={handleDeletePool} + /> +{/if} \ No newline at end of file diff --git a/webapp/src/routes/pools/[id]/+page.svelte b/webapp/src/routes/pools/[id]/+page.svelte new file mode 100644 index 00000000..d97bbe6a --- /dev/null +++ b/webapp/src/routes/pools/[id]/+page.svelte @@ -0,0 +1,398 @@ + + + + {pool ? `Pool ${pool.id} - Pool Details` : 'Pool Details'} - GARM + + +
                + + + + {#if loading} +
                +
                +

                Loading pool...

                +
                + {:else if error} +
                +

                {error}

                +
                + {:else if pool} + + showUpdateModal = true} + onDelete={() => showDeleteModal = true} + /> + + +
                + +
                +
                +

                Basic Information

                +
                +
                +
                Pool ID
                +
                {pool.id}
                +
                +
                +
                Provider
                +
                {pool.provider_name}
                +
                +
                +
                Image
                +
                + {pool.image} +
                +
                +
                +
                Flavor
                +
                {pool.flavor}
                +
                +
                +
                Status
                +
                + + {pool.enabled ? 'Enabled' : 'Disabled'} + +
                +
                +
                +
                Entity
                +
                +
                + + {getEntityType(pool)} + + + {getEntityName(pool)} + +
                +
                +
                +
                +
                Created At
                +
                {formatDate(pool.created_at || '')}
                +
                +
                +
                Updated At
                +
                {formatDate(pool.updated_at || '')}
                +
                +
                +
                +
                + + +
                +
                +

                Configuration

                +
                +
                +
                Max Runners
                +
                {pool.max_runners}
                +
                +
                +
                Min Idle Runners
                +
                {pool.min_idle_runners}
                +
                +
                +
                Bootstrap Timeout
                +
                {pool.runner_bootstrap_timeout} minutes
                +
                +
                +
                Priority
                +
                {pool.priority}
                +
                +
                +
                Runner Prefix
                +
                {pool.runner_prefix || 'garm'}
                +
                +
                +
                OS Type / Architecture
                +
                {pool.os_type} / {pool.os_arch}
                +
                + {#if pool['github-runner-group']} +
                +
                GitHub Runner Group
                +
                {pool['github-runner-group']}
                +
                + {/if} + {#if pool.tags && pool.tags.length > 0} +
                +
                Tags
                +
                +
                + {#each pool.tags as tag} + + {typeof tag === 'string' ? tag : tag.name} + + {/each} +
                +
                +
                + {/if} +
                +
                +
                +
                + + + {#if pool.extra_specs} +
                +
                +

                Extra Specifications

                +
                {formatExtraSpecs(pool.extra_specs)}
                +
                +
                + {/if} + + + {#if pool.instances} + + {/if} + + {/if} +
                + + +{#if showUpdateModal && pool} + showUpdateModal = false} + on:submit={(e) => handleUpdate(e.detail)} + /> +{/if} + +{#if showDeleteModal && pool} + showDeleteModal = false} + on:confirm={handleDelete} + /> +{/if} + +{#if showDeleteInstanceModal && selectedInstance} + { showDeleteInstanceModal = false; selectedInstance = null; }} + on:confirm={handleDeleteInstance} + /> +{/if} \ No newline at end of file diff --git a/webapp/src/routes/repositories/+page.svelte b/webapp/src/routes/repositories/+page.svelte new file mode 100644 index 00000000..36e74e32 --- /dev/null +++ b/webapp/src/routes/repositories/+page.svelte @@ -0,0 +1,339 @@ + + + + Repositories - GARM + + +
                + + { showCreateModal = true; }} + /> + + +
                + + +{#if showCreateModal} + showCreateModal = false} + on:submit={handleCreateRepository} + /> +{/if} + +{#if showEditModal && editingRepository} + handleUpdateRepository(e.detail)} + /> +{/if} + +{#if showDeleteModal && deletingRepository} + +{/if} diff --git a/webapp/src/routes/repositories/[id]/+page.svelte b/webapp/src/routes/repositories/[id]/+page.svelte new file mode 100644 index 00000000..0bafe74e --- /dev/null +++ b/webapp/src/routes/repositories/[id]/+page.svelte @@ -0,0 +1,392 @@ + + + + {repository ? `${repository.name} - Repository Details` : 'Repository Details'} - GARM + + +
                + + + + {#if loading} +
                +
                +

                Loading repository...

                +
                + {:else if error} +
                +

                {error}

                +
                + {:else if repository} + + showUpdateModal = true} + onDelete={() => showDeleteModal = true} + /> + + + + + + + + + + + + + + + + {/if} +
                + + +{#if showUpdateModal && repository} + showUpdateModal = false} + on:submit={(e) => handleUpdate(e.detail)} + /> +{/if} + +{#if showDeleteModal && repository} + showDeleteModal = false} + on:confirm={handleDelete} + /> +{/if} + +{#if showDeleteInstanceModal && selectedInstance} + { showDeleteInstanceModal = false; selectedInstance = null; }} + on:confirm={handleDeleteInstance} + /> +{/if} + +{#if showCreatePoolModal && repository} + showCreatePoolModal = false} + on:submit={handleCreatePool} + /> +{/if} \ No newline at end of file diff --git a/webapp/src/routes/scalesets/+page.svelte b/webapp/src/routes/scalesets/+page.svelte new file mode 100644 index 00000000..1a6acb7b --- /dev/null +++ b/webapp/src/routes/scalesets/+page.svelte @@ -0,0 +1,316 @@ + + + + Scale Sets - GARM + + +
                + + + + +
                + + +{#if showCreateModal} + showCreateModal = false} + on:submit={(e) => handleCreateScaleSet(e.detail)} + /> +{/if} + +{#if showUpdateModal && selectedScaleSet} + { showUpdateModal = false; selectedScaleSet = null; }} + on:submit={(e) => handleUpdateScaleSet(e.detail)} + /> +{/if} + +{#if showDeleteModal && selectedScaleSet} + { showDeleteModal = false; selectedScaleSet = null; }} + on:confirm={handleDeleteScaleSet} + /> +{/if} \ No newline at end of file diff --git a/webapp/src/routes/scalesets/[id]/+page.svelte b/webapp/src/routes/scalesets/[id]/+page.svelte new file mode 100644 index 00000000..2ad9c320 --- /dev/null +++ b/webapp/src/routes/scalesets/[id]/+page.svelte @@ -0,0 +1,383 @@ + + + + {scaleSet ? `${scaleSet.name} - Scale Set Details` : 'Scale Set Details'} - GARM + + +
                + + + + {#if loading} +
                +
                +

                Loading scale set...

                +
                + {:else if error} +
                +

                {error}

                +
                + {:else if scaleSet} + + showUpdateModal = true} + onDelete={() => showDeleteModal = true} + /> + + +
                + +
                +
                +

                Basic Information

                +
                +
                +
                Scale Set ID
                +
                {scaleSet.id}
                +
                +
                +
                Name
                +
                {scaleSet.name}
                +
                +
                +
                Provider
                +
                {scaleSet.provider_name}
                +
                +
                +
                Image
                +
                + {scaleSet.image} +
                +
                +
                +
                Flavor
                +
                {scaleSet.flavor}
                +
                +
                +
                Status
                +
                + + {scaleSet.enabled ? 'Enabled' : 'Disabled'} + +
                +
                +
                +
                Entity
                +
                +
                + + {getEntityType(scaleSet)} + + + {getEntityName(scaleSet)} + +
                +
                +
                +
                +
                Created At
                +
                {formatDate(scaleSet.created_at || '')}
                +
                +
                +
                Updated At
                +
                {formatDate(scaleSet.updated_at|| '')}
                +
                +
                +
                +
                + + +
                +
                +

                Configuration

                +
                +
                +
                Max Runners
                +
                {scaleSet.max_runners}
                +
                +
                +
                Min Idle Runners
                +
                {scaleSet.min_idle_runners}
                +
                +
                +
                Bootstrap Timeout
                +
                {scaleSet.runner_bootstrap_timeout} minutes
                +
                + +
                +
                Runner Prefix
                +
                {scaleSet.runner_prefix || 'garm'}
                +
                +
                +
                OS Type / Architecture
                +
                {scaleSet.os_type} / {scaleSet.os_arch}
                +
                + {#if scaleSet['github-runner-group']} +
                +
                GitHub Runner Group
                +
                {scaleSet['github-runner-group']}
                +
                + {/if} + +
                +
                +
                +
                + + + + {#if scaleSet.extra_specs} +
                +
                +

                Extra Specifications

                +
                {formatExtraSpecs(scaleSet.extra_specs)}
                +
                +
                + {/if} + + + {#if scaleSet.instances} + + {/if} + + {/if} +
                + + +{#if showUpdateModal && scaleSet} + showUpdateModal = false} + on:submit={(e) => handleUpdate(e.detail)} + /> +{/if} + +{#if showDeleteModal && scaleSet} + showDeleteModal = false} + on:confirm={handleDelete} + /> +{/if} + +{#if showDeleteInstanceModal && selectedInstance} + { showDeleteInstanceModal = false; selectedInstance = null; }} + on:confirm={handleDeleteInstance} + /> +{/if} \ No newline at end of file diff --git a/webapp/static/assets/garm-dark.svg b/webapp/static/assets/garm-dark.svg new file mode 100644 index 00000000..f0a0c564 --- /dev/null +++ b/webapp/static/assets/garm-dark.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/webapp/static/assets/garm-light.svg b/webapp/static/assets/garm-light.svg new file mode 100644 index 00000000..2495959d --- /dev/null +++ b/webapp/static/assets/garm-light.svg @@ -0,0 +1,36 @@ + + + + + + + + + + diff --git a/webapp/static/assets/gitea.svg b/webapp/static/assets/gitea.svg new file mode 100644 index 00000000..e4643ce3 --- /dev/null +++ b/webapp/static/assets/gitea.svg @@ -0,0 +1 @@ + diff --git a/webapp/static/assets/github-mark-white.svg b/webapp/static/assets/github-mark-white.svg new file mode 100644 index 00000000..d5e64918 --- /dev/null +++ b/webapp/static/assets/github-mark-white.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webapp/static/assets/github-mark.svg b/webapp/static/assets/github-mark.svg new file mode 100644 index 00000000..37fa923d --- /dev/null +++ b/webapp/static/assets/github-mark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/webapp/static/favicon-dark.png b/webapp/static/favicon-dark.png new file mode 100644 index 0000000000000000000000000000000000000000..d16186d1d64f35f2676d6bb462e4824345f811de GIT binary patch literal 3506 zcmeHK`8O197k|dsjeTus8v7{BkRoKsjAaI8u1 zT>wP=a+@u+0bts(Ftfoi0($3m{*iwe`2S&m@#opag&3^>=p-w1YXBfHerArVUBekj zx7}ags<>F|{M4q_RqBs_-1MUVSUD&P-YO6jozUWz)WsUueD>8pbLyxt6DD?XZ-0CB zU9kl_abWQM_{>hJKkX2o#L4I{LK@2?Hk0g1PM^2%-*%d49a$(rT~VR^XC#Z!-1!Re za=LnvE{STnU`N-&yD?GX3hwY-3VM3Qq{7RtaU8cz4X))ZW|UlBIJwE<&o| z>5aqr#}E(tCi_F>rJL}%VS1hmpT2L5T%ev6P=0M2cTen5z>$kB=WdaCgUX&=JAGL$ z^Mp*!&9?M6F0DP!jU9)g*5Yqp?|A&;rK*!do_2S2T1|MC*f7+PK?CH9sSy^$vm7>N z7;GdH0*-Bkotsrt@ZOQM&kV9WOtAVko-=EA!!N!4Al!L6+G04)XyGtTpR?F1p8ZT3 zv%*8c5pWcJOjbc0g_l;-7IL=3L7ZVvUmILxf#56`PAE9F?85t&zm^rReYJa<>3g*B zW3%s^GKx z#FgWn=h(@jp;>mGJ}zqDhTP=jgq8-JcP{4HAd{%a=j^^r{{Yc;S2aNbRFL;z)@VqL${1HT7F)@pQde%&LzlE+*V^UzKt1er>xfeM?2xlmLytT{!lY7YsJ9Y~fbG zs=DjBwuek%U&UW49$oDW zzku88V!T}inYBxV@@dE#@{Hny(MR&p~#CcVRQb6)}pQOiCbp z#CcXLZ2biJ;Fm9(oCS15yf%SIZiCHVt(ve4-xz)r+>yD%L)5ggKO2fT(Pthv*By_S z{jDbfr?I{cO6J%m5PJQqN%tK5bNt_|rViO2szL(YlVwf2F+6Dzbxoz`+#AE7`Yq;p zkFu#9#%yT~h6@GR6Jw9o5yLC%%RRjd^6qU5unLuH5uQL!I~SjW3}=?PfK z@9EzVsq{V%{T+JgUG0}h@;k(3k>j=?TNBeJeW7Z%R+q_9txG^phX28eM21*H?SqE( zTsoWZ5fQ;|(9yHP3fVXGx{e?RIF~~?t6yg|o2E5~j3+HfU91unXR<)bOsK6{aP$;3 zW*`LXZ)`7O+!ly*lk$X%FaR|4(uLn`TVBjUY&URJ9Bn4vC30n{CzxH$M{CI67NI{liu>=8XT)p#g&hBf8y=M{7CI> zk)PFPx_{Yv%iP1Uqh0-s*W-K+i2}r@3AKBj9~P4>%EhUH%&0iOL5zY6(wBqR_2;a% zf&a3$dx&IHjn~IdJH8X2D?YvA*Si!OTcF(%rJ<`gbl#~~S z6MCpfgi#0Wc&Wv0p&8|JY}z_F5o%Jjq7t+tknS!--VF9T0q-+u@|VzrgCJa+dD#egmGr5VQS!po?+w95 zoepu*Lqut@p2(pYEfvr+1qY`WpREf)o7)Pu_X(^Jm>J9|0t0b^YdZzl0RAB<&ogBE zBG-9gzlzP{B610wB|2eCU(P}}pT~eYB7Q-9BG$`!!}^7_p6L=6fVcLwt(0!_TMzyc zJ6UB;k)0TRaf6&U@^iTAvF&K4aR**P-V0GMtN7kK zoccKTcxro-dW8C^_az$ce8WG~)n$}6S#p(vt%-UpAHM3xrois5&Y9bk zU|`Scf-^#g)EtDIl@NUt=uSc36tfU8fP% ze{LjGKk&Chif3k;rXJ!;MeF%Yvu%g2K0Z+e%YCtHW60)6WLmK)1oo?Vm?GhN>jOSr ze$mo3#8E+>C8K$;!c`7w*uP3M63nIvvM2Qh1eU1?$G=wtnLG6#_qzDj-%WM|89LMU#!~tb#9efGIKxv`UPhl^Q*@_i2lirT(>em+` zKR3Jd-W)Ie0Uk>PcO`r(pXua9ha{TL{{c-*w>TsV6)(|IOFK{Yu0FmUn8Y)TDmZ@eGDsE za1~NMD%Png(AMrhu=<5%qeCt^tHf**Es1~mHons2lnjo&gI|#BSR%5K?9NiIMlKz= zR*ahB9$9zRxh>?Sk%l_#`K{xLO$$?xh#Jzq2jtqoIxi2D&24cS zR-K-2l}x2eJSDft!JLeH!dOVsi@FDcYpsDzs2!Gi^#H!b7KZ~>#AXilbhu6tgspnY zumo~aGbW2lO-T($eY%ot*un;y?i%sB2 z$bdsb0j=3TBKmORDw_NUnI)V{yuq=Vbcg?{u%0@{UV!sye1@_*UWIwn4{bd-y){nK zs$!SlX+5!!u~xaWeUN%rfl#K}Upkdx_UcdDzUYyS`Q2g7v=PP>B1^)ZBe^=0+%#SM z-53g}VpLBkVKkIfRBcpLHPtj2atwpf#9+$tIK~F_UjQGXtCxG|{|1bS9vmV8ED@D`scdCe z3E4v=SxSbX-ub@g{o(!P{R`gjIrq7rbMJjV&pqdJo*(YLZDDT24TVDi0Nf_VSStoP z{e3u?8UBOeUw;=^JoE|r06b0R+IMDU#7GxoD*^yvasZHH0N7)s$jbl(VgUH+1c2s! z07U(=8!fc~VA`=Tv%xVg@W|`@WB(}d|Dyoo&(HN{K4t)&WMys*00hR*!g;l0C=Kbh z`|Dc;7h8>=+T^-Q?eR~WUi2R;2L-`fd4i(jTHKPlSOc5SzWQfQ9TjH6#4hgbZ?C>D zwBR824}2J#-YNE{9paNX8T~~_W0}Nml35P*c?bV(r-{~)WhSUADzyHLWHp*SUnZXT zwK3V+>f>Xxk)@a`f%6aB^Ib)z-aMPBPbf;_387Rgp$zZdA2m0%_x8AC>0FA7kg9ur z<8baV#G{^xzEFAT27Gpyp69~c_l@BT)UyK0Z*Aiqh&>57a$Ei!LV$%|{JFUzH$ zkjc8)lG^Li-1XAfaWHBv{`U2@r>|bCIyvNMcUGoUg=dHjF&i>ufLt*(!h(3#!^Vt& zon%75v9EA&vuR2|^Ar66;P5cP>f3luuiX#7^zNf@`{`(lp*W+3!!&(pp;bJ`nG_a< z$AZJ)DEgSJf;b89&Gs!lRjQtO0jd zj<=uVAd7}(*m?T6sDT@D6BFZF8gSm(m=^;~q8^_!d(!;_L|a|e1PRQ7yl1l)-PGg- zUwu235s+Aj(3nPR(P?*I z(gMF(aI;hQyg&i9I9IHp&q9l*qjxc*HlnbQaLavF#=Y~c?Xr+JAJDs`jh5UDZzR`F z@ScX%u<*6Tc~heDIcEdS?8I2|<1Jbt;Ie}5;w|?r6npXB_LlGx>%;RP|;_R}ESSm!SN4i@rz z>Ni9xwZ}t$hhBVN`!$mM9&uUZxGl)k#I#6XsMxL6WpY&O5YUt1f3zZzCRSJdsBS%* z&MtgJM6eUIb*->L_6@zRBgg^HrOeREw;7G5DUBgx2@6seD@4VaERZteYHJppU3v9s z2*KJL+lv^t1tQ&~^v*>X02+F!!tb{&FJ?DPJgD&Pc^QqYzbXH7pm_e}j4ikGzR^89 zlc;rqc&?Lqs;#YBrzacUq7D$Z{Jqu_${<>Yn!Iiqdh zzpU*ZBH2*o^=WR$cl>kN+#7zqOR=$e+D%a!x_X1>ow_wXTN{ZBlw~LBTG~CQ)(AYK zhl)fPwb70jTih0!R*w2r*`K$Gwxlxky@vSoa%JNwdj&NS*A1#%-6H#;VXP$+SAk_Q zZC54(WNSAwO`M$1(Ry*^3eR)<>xtNhR#ZIfday$v!I0^@(;6%JN7a{BpdA?g=m zncsboHN~3U@0xr~LqFSRrqrO%=fWTpRVJ}ZXm25zDXAw)CIt@OVR=`8Ty0M|+=xKQ z;g1_J4?5t&au*zMLHqxl>J24rWXs9R#p@U_>wS|faGd)7algIcsGupa1_=`KkvKZL z@tcCySFp2_rjr(-sQ_RjDLOw%(ko}Oa=t0g^N8eVqcS*VMhP5^9#J|sgB!p8DU%{w zvH3l0{!Xl4pUq&a41oA9gzQxV+SaSRKwWl~Bh#JU5z527)5Qt5M+6EI7p{J<3pQ$Z zh?5>9N{e+x4o+*SfUZe6IKB8{U5L4{C2xD5zy^Vt!JHy65GS~{Q-BTNAC&SuL$)t) zofq~i+dM8JcL!Re6Snl_ECl*82GkJo3*zIkUd|iVudMYRk70b|QQpbwc)!3uO6*f2ga=2yLS1Dg|2=^;AB5)sJ0)!(APk-Ehai zp3Mbkgbt}X2stYu`XtCFE05BnieKw98T1V8z3?X7Y)`4wSRmmQWyf|%iqBoA9@Tel zI9)&Rw?mR=dWxnV;!9cc`E;{whmIaTQ3cC=v1_Bq#zD8)iDS71`0JFG7B4 zcIksTUiu?EmI&@k_>{lU$%zh0GzC_B#>UKdC;*Dump`Q;Fagdxwr4g?OkE;sNc%33Z3An+++Q-g@#)escBbj@;|ny5Kx|88 zYOYlxl`ip|+$0BcGVTgvB}p&p9t^BC2R5K~SZmb-_!gTS4pb4FS=7_vIt38+%1Of_ z$VttZ3@SA#IUJRB_u2^O#BVyAE)5YJ7 z0YDX_dO``Kp`@Z}qoS&*ropgd7>p(cQ;NqiHlY6^_z+#a+(Z92VN~?sfI-mtyF);b zho%eB$H&c=1ds;*?&OLL_9A&AO? { + // Load env variables based on the current mode + // Third param '' means load all variables, not just those prefixed with VITE_ + const env = loadEnv(mode, process.cwd(), ''); + + console.log(env.VITE_GARM_API_URL); + return { + plugins: [sveltekit()], + server: { + proxy: { + // Proxy API calls to GARM backend + '/api': { + target: env.VITE_GARM_API_URL, + changeOrigin: true, + ws: true, + configure: (proxy, _options) => { + proxy.on('error', (err, _req, _res) => { + console.log('proxy error', err); + }); + proxy.on('proxyReq', (proxyReq, req, _res) => { + console.log('Sending Request to the Target:', req.method, req.url); + }); + proxy.on('proxyRes', (proxyRes, req, _res) => { + console.log('Received Response from the Target:', proxyRes.statusCode, req.url); + }); + }, + secure: false + } + } + } + }; +}); + diff --git a/workers/entity/worker.go b/workers/entity/worker.go index 1cb40ad5..d16c15f5 100644 --- a/workers/entity/worker.go +++ b/workers/entity/worker.go @@ -92,6 +92,14 @@ func (w *Worker) Start() (err error) { w.mux.Lock() defer w.mux.Unlock() + epType, err := w.Entity.GetForgeType() + if err != nil { + return fmt.Errorf("failed to get endpoint type: %w", err) + } + if epType != params.GithubEndpointType { + return nil + } + ghCli, err := github.Client(w.ctx, w.Entity) if err != nil { return fmt.Errorf("creating github client: %w", err) diff --git a/workers/scaleset/scaleset.go b/workers/scaleset/scaleset.go index 03a93387..48aa8508 100644 --- a/workers/scaleset/scaleset.go +++ b/workers/scaleset/scaleset.go @@ -101,7 +101,8 @@ func (w *Worker) Start() (err error) { } for _, instance := range instances { - if instance.Status == commonParams.InstanceCreating { + switch { + case instance.Status == commonParams.InstanceCreating: // We're just starting up. We found an instance stuck in creating. // When a provider creates an instance, it sets the db instance to // creating and then issues an API call to the IaaS to create the @@ -176,7 +177,7 @@ func (w *Worker) Start() (err error) { return fmt.Errorf("updating runner %s: %w", instance.Name, err) } } - } else if instance.Status == commonParams.InstanceDeleting { + case instance.Status == commonParams.InstanceDeleting: // Set the instance in deleting. It is assumed that the runner was already // removed from github either by github or by garm. Deleting status indicates // that it was already being handled by the provider. There should be no entry on @@ -193,7 +194,7 @@ func (w *Worker) Start() (err error) { return fmt.Errorf("updating runner %s: %w", instance.Name, err) } } - } else if instance.Status == commonParams.InstanceDeleted { + case instance.Status == commonParams.InstanceDeleted: if err := w.handleInstanceCleanup(instance); err != nil { locking.Unlock(instance.Name, false) return fmt.Errorf("failed to remove database entry for %s: %w", instance.Name, err)