(record pocketBaseScriptRecord)
| 243 | } |
| 244 | |
| 245 | func mapPocketBaseRecord(record pocketBaseScriptRecord) Script { |
| 246 | sourceType := record.Expand.Type.Type |
| 247 | if sourceType == "" { |
| 248 | sourceType = record.Type |
| 249 | } |
| 250 | |
| 251 | return Script{ |
| 252 | Name: record.Name, |
| 253 | Slug: record.Slug, |
| 254 | Description: record.Description, |
| 255 | Categories: record.Categories, |
| 256 | Type: normalizeScriptType(sourceType), |
| 257 | Updateable: record.Updateable, |
| 258 | Privileged: record.Privileged, |
| 259 | InterfacePort: record.Port, |
| 260 | Documentation: record.Documentation, |
| 261 | Website: record.Website, |
| 262 | ConfigPath: record.ConfigPath, |
| 263 | Logo: record.Logo, |
| 264 | ScriptPath: buildScriptPath(sourceType, record.Slug), |
| 265 | DateCreated: record.Created, |
| 266 | IsDev: record.IsDev, |
| 267 | IsDisabled: record.IsDisabled, |
| 268 | IsDeleted: record.IsDeleted, |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | func fetchPocketBase(url string, target any) error { |
| 273 | url, err := validateMetadataURL(url) |
no test coverage detected