Files
zeekay 0c2f028a8c Generate the Swift client, which this copy did not carry
The forge tree held the package scaffolding and none of the generated sources —
2,435 files of APIs, Models and Infrastructure, including BaseAPI, were simply
absent, so anything depending on this copy had a package that compiled to
nothing usable.

Generated from the current API document rather than reconciled with the other
copy: a client is a function of the spec, so regenerating answers "which history
wins" without anyone having to choose. .spec-lock records which document, so the
next reader can tell.
2026-08-23 10:04:41 -07:00

83 lines
7.5 KiB
Swift

//
// CatalogAPI.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//
import Foundation
open class CatalogAPI {
/**
Browse searches AND browses the cross-org catalog: every project, app and site the fleet has built, whichever org built it.
- parameter q: (query) Q is the free-text query the lexical index scores relevance on. Empty is a browse rather than a search — the same request either way. (optional)
- parameter org: (query) Org narrows to one builder org: hanzo | lux | zoo. Case-insensitive. (optional)
- parameter kind: (query) Kind narrows to repo | site. Case-insensitive. (optional)
- parameter origin: (query) Origin narrows to what a row IS to you: template | community | third-party | product. This is the axis the two hanzo.app lanes are cut on. (optional)
- parameter archetype: (query) Archetype narrows to one project archetype. Case-insensitive. (optional)
- parameter language: (query) Language narrows to one implementation language. Case-insensitive. (optional)
- parameter template: (query) Template narrows a lane to ONE lineage: the id of the parent everything returned was forked from. (optional)
- parameter forkable: (query) Forkable is tri-state: \"true\" selects the forkable rows, \"false\" selects the rest, and anything else — including absent — applies no filter at all. (optional)
- parameter limit: (query) Limit caps the page at 200, default 50. A value that is not a non-negative integer falls back to the default. (optional)
- parameter offset: (query) Offset is where the page starts, default 0, with the same tolerance. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: CatalogPage
*/
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
open class func getCatalog(q: String? = nil, org: String? = nil, kind: String? = nil, origin: String? = nil, archetype: String? = nil, language: String? = nil, template: String? = nil, forkable: String? = nil, limit: String? = nil, offset: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) async throws(ErrorResponse) -> CatalogPage {
return try await getCatalogWithRequestBuilder(q: q, org: org, kind: kind, origin: origin, archetype: archetype, language: language, template: template, forkable: forkable, limit: limit, offset: offset, apiConfiguration: apiConfiguration).execute().body
}
/**
Browse searches AND browses the cross-org catalog: every project, app and site the fleet has built, whichever org built it.
- GET /v1/catalog
- Browse searches AND browses the cross-org catalog: every project, app and site the fleet has built, whichever org built it. It reads TWO corpora and returns them as one page — the published, world-readable catalog that every caller sees, plus the caller's OWN org's private entries when the request carries a validated principal. Each row says which it came from in `scope`, so a client can warn before sharing a link. An anonymous caller simply gets the published one; no filter can ever widen a caller into another tenant's corpus, because the query that would return it is never run for them. A request with no q is a browse rather than a search, and both answer the same shape: the page, the total before paging, and the facet counts over the whole matching set.
- Bearer Token:
- type: http
- name: bearer
- parameter q: (query) Q is the free-text query the lexical index scores relevance on. Empty is a browse rather than a search — the same request either way. (optional)
- parameter org: (query) Org narrows to one builder org: hanzo | lux | zoo. Case-insensitive. (optional)
- parameter kind: (query) Kind narrows to repo | site. Case-insensitive. (optional)
- parameter origin: (query) Origin narrows to what a row IS to you: template | community | third-party | product. This is the axis the two hanzo.app lanes are cut on. (optional)
- parameter archetype: (query) Archetype narrows to one project archetype. Case-insensitive. (optional)
- parameter language: (query) Language narrows to one implementation language. Case-insensitive. (optional)
- parameter template: (query) Template narrows a lane to ONE lineage: the id of the parent everything returned was forked from. (optional)
- parameter forkable: (query) Forkable is tri-state: \"true\" selects the forkable rows, \"false\" selects the rest, and anything else — including absent — applies no filter at all. (optional)
- parameter limit: (query) Limit caps the page at 200, default 50. A value that is not a non-negative integer falls back to the default. (optional)
- parameter offset: (query) Offset is where the page starts, default 0, with the same tolerance. (optional)
- parameter apiConfiguration: The configuration for the http request.
- returns: RequestBuilder<CatalogPage>
*/
open class func getCatalogWithRequestBuilder(q: String? = nil, org: String? = nil, kind: String? = nil, origin: String? = nil, archetype: String? = nil, language: String? = nil, template: String? = nil, forkable: String? = nil, limit: String? = nil, offset: String? = nil, apiConfiguration: HanzoAPIConfiguration = HanzoAPIConfiguration.shared) -> RequestBuilder<CatalogPage> {
let localVariablePath = "/v1/catalog"
let localVariableURLString = apiConfiguration.basePath + localVariablePath
let localVariableParameters: [String: any Sendable]? = nil
var localVariableUrlComponents = URLComponents(string: localVariableURLString)
localVariableUrlComponents?.queryItems = APIHelper.mapValuesToQueryItems([
"q": (wrappedValue: q?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"org": (wrappedValue: org?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"kind": (wrappedValue: kind?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"origin": (wrappedValue: origin?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"archetype": (wrappedValue: archetype?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"language": (wrappedValue: language?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"template": (wrappedValue: template?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"forkable": (wrappedValue: forkable?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"limit": (wrappedValue: limit?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
"offset": (wrappedValue: offset?.asParameter(codableHelper: apiConfiguration.codableHelper), isExplode: true),
])
let localVariableNillableHeaders: [String: (any Sendable)?] = [
:
]
let localVariableHeaderParameters = APIHelper.rejectNilHeaders(localVariableNillableHeaders)
let localVariableRequestBuilder: RequestBuilder<CatalogPage>.Type = apiConfiguration.requestBuilderFactory.getBuilder()
return localVariableRequestBuilder.init(method: "GET", URLString: (localVariableUrlComponents?.string ?? localVariableURLString), parameters: localVariableParameters, headers: localVariableHeaderParameters, requiresAuthentication: true, apiConfiguration: apiConfiguration)
}
}